Skip to content

Commit

Permalink
SIT-794 Campsite form post launch tweaks (#2689)
Browse files Browse the repository at this point in the history
* SIT-794 post launch tweaks: fixed typo in vehicle conf block, updated ZD handler to send anonymous if no contact email provided, removed email requirement, made sure autocomplete is off for fields except contact, add campsite_in_park tag and change group for Ranger campsite tickets, updated IRP handler to use Developer form

* SIT-794 updated next steps block in park maintenance form to use Report a Campsite service link now that the new form is live

* SIT-794 add IRP ticket id to AbAuto, Parks, and ADA tickets; update ADA questions; make email required if requesting accommodation

* SIT-794 add IRP ticket id to AbAuto, Parks, and ADA tickets; update ADA questions; make email required if requesting accommodation

* SIT-794 add campsite tag to AbAutos test tickets

* SIT-794 changed order of answers on ADA accomodation field

* SIT-794 switched ADA question order

* SIT-794 updated zendesk handler to check for ticket ID from previous handler submission

* SIT-794 removed extra spaces

* SIT-794 removed space

* SIT-794 add hash symbol before campsite report ticket ID in ADA tickets, so that Zendesk turns it into a link

* SIT-794 changed value of new ADA option to 'no report'

* SIT-794 hide zendesk ticket ID field in CSUO block

* SIT-794 fix typo

* SIT-794 removed public records statement from ADA accommodation form

* SIT-794 demographics hotfix

* SIT-794 fix anon email

---------

Co-authored-by: Oden <hello@odensc.com>
  • Loading branch information
jookyg and odensc committed Dec 14, 2023
1 parent 36c9c2e commit 3effc7f
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ public static function getCompositeElements(array $element) {
'#type' => 'textfield',
'#id' => 'place_name',
'#title' => t('Location Name'),
'#attributes' => ['class' => ['place-name']],
'#attributes' => ['class' => ['place-name'], 'autocomplete' => 'off'],
'#description' => t('If this location has a name, such as a business or public building, please enter it here.'),
'#description_display' => 'before',
];
$element['location_details'] = [
'#type' => 'textarea',
'#id' => 'location_details',
'#title' => t('Location Details'),
'#attributes' => ['class' => ['location-details']],
'#attributes' => ['class' => ['location-details'], 'autocomplete' => 'off'],
'#description' => t('Please provide any other details that might help us locate the site you are reporting.'),
'#description_display' => 'before',
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static function getCompositeElements(array $element) {
'#type' => 'checkbox',
'#title' => t('Test Submission'),
'#id' => 'test_submission',
'#description' => 'For administrtor use only. Handlers can be configured to process form submissions differently based on whether this box is checked. Typically configured to place tickets in the Developer Test Group in Zendesk.',
'#description' => 'For administrator use only. Handlers can be configured to process form submissions differently based on whether this box is checked. Typically configured to place tickets in the Developer Test Group in Zendesk.',
'#access_create_roles' => ['administrator'],
'#access_update_roles' => ['administrator'],
'#access_view_roles' => ['administrator'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
*/
class ZendeskHandler extends WebformHandlerBase
{
private const ANONYMOUS_EMAIL = 'anonymous@portlandoregon.gov';
private const JSON_FORM_DATA_FIELD_ID = 17698062540823;

/**
Expand Down Expand Up @@ -504,6 +505,13 @@ public function sendToZendesk(array &$form, FormStateInterface &$form_state) {
// a webform_submission object from form_state and pull form values from that for the API submission.
$webform_submission = $form_state->getFormObject()->getEntity();

// check for a report_ticket_id value in the form state; if a handler previously submitted
// a ticket, the ID should be available to subsequent handlers.
$prev_ticket_id = $form_state->getValue('report_ticket_id');
if ($prev_ticket_id) {
$webform_submission->setElementData('report_ticket_id', $prev_ticket_id);
}

if ($fork_field_name) {
// if the handler has a fork field configured, grab the values array from that field so we can
// spin through it and stuff a single value into the webform_submission for each ticket being created.
Expand Down Expand Up @@ -569,6 +577,12 @@ public function submitTicket($submission_fields, $configuration, $webform_submis

// restructure requester
if(!isset($request['requester'])){
// if requester email doesn't contain an @, that means the field was empty or the value wasn't set,
// so default to anonymous.
if (!str_contains($request['requester_email'], '@')) {
$request['requester_email'] = self::ANONYMOUS_EMAIL;
}

$request['requester'] = $request['requester_name']
? [
'name' => Utility::convertName($request['requester_name']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ elements: |-
support_agent_use_only:
'#type': portland_support_agent_widget
'#title': 'Support Agent Use Only'
'#access_create_roles':
- authenticated
css: ''
javascript: ''
settings:
Expand Down Expand Up @@ -201,11 +203,13 @@ settings:
access:
create:
roles:
- administrator
- anonymous
- authenticated
users: { }
permissions: { }
view_any:
roles:
- sitewide_editor
- administrator
users: { }
permissions: { }
Expand All @@ -226,16 +230,18 @@ access:
permissions: { }
view_own:
roles:
- administrator
- authenticated
users: { }
permissions: { }
update_own:
roles:
- sitewide_editor
- administrator
users: { }
permissions: { }
delete_own:
roles:
- sitewide_editor
- administrator
users: { }
permissions: { }
Expand All @@ -246,6 +252,7 @@ access:
permissions: { }
test:
roles:
- sitewide_editor
- administrator
users: { }
permissions: { }
Expand Down
71 changes: 40 additions & 31 deletions web/sites/default/config/webform.webform.report_campsite.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -490,24 +490,24 @@ handlers:
sheet_id: '5651392804218756'
column_mappings:
5906210767562628: __submission_id
3668701731573636: purpose
857686929631108: report_form_id
839661186770820: report_race_ethnicity
5343260814141316: report_gender
6441191047384964: ''
3091461000456068: report_annual_household_income
2954311722395524: report_household_size
7457911349766020: report_age
4189391233699716: ''
1828411815552900: report_disabilities
6978614094784388: report_zip_code
7014782091612036: report_disability_details
4159241006829444: report_languages
3875800948363140: report_tribal_affiliation
1349114560571268: report_suggestions
8172301358944132: report_bds_project_type
853951964467076: report_bds_project_relation
8482598244640644: ''
multiple_rows_enable: null
multiple_rows_field: ''
multiple_rows_separator: ''
row_location: toBottom
upload_attachments: '1'
variants: { }
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ elements: |-
<div class="alert alert--info next-steps">
<h2>Next Steps</h2>
<p>Campsite report</p>
<p>If you want to report an unsanctioned campsite, please use the <a href="/homelessnessimpactreduction/report-campsite">Report a Campsite service</a>. A copy of the report will be sent to the Park Rangers.</p>
</div>
markup_call_ppb:
'#type': webform_markup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ title: 'A.D.A. Accommodation Request'
description: ''
categories: { }
elements: |-
section_public_records_statement:
'#type': webform_section
'#title': 'Public Records Statement'
'#title_display': invisible
public_records_statement_standard:
'#type': webform_markup
'#markup': |
<strong>Public Records Statement</strong><br />
Information you provide to the City is a public record and may be subject to release under Oregon&rsquo;s <a data-renderer-mark="true" href="https://www.doj.state.or.us/oregon-department-of-justice/public-records/attorney-generals-public-records-and-meetings-manual/i-public-records/#:~:text=Under%20Oregon's%20Public%20Records%20Law,committee%20of%20the%20Legislative%20Assembly" title="https://www.doj.state.or.us/oregon-department-of-justice/public-records/attorney-generals-public-records-and-meetings-manual/i-public-records/#:~:text=Under%20Oregon's%20Public%20Records%20Law,committee%20of%20the%20Legislative%20Assembly">Public Records Law</a>. This law classifies certain information as available to the public on request. See our <a data-renderer-mark="true" href="/help/about/privacy" title="https://www.portland.gov/help/about/privacy">privacy statement</a> for more information.
request_how:
'#type': radios
'#title': 'How would you like to make your request?'
Expand Down

0 comments on commit 3effc7f

Please sign in to comment.