Page MenuHomePhabricator

Add selectable general topic to contact form
Closed, ResolvedPublic1 Estimated Story Points

Description

As a fundraising service team member,
I want have incoming emails categorized automatically,
so that I can prioritize better.

Acceptance Criteria:

  • The contact form provides a select field containing options of general topics to choose from.
  • Users can only pick one of the entries.
  • The selected topic is sent as part of the content body as follows: Thema: {{value}}.
  • The label of the field says "Bitte wählen Sie ein Thema aus" and is positioned below the subject field.
  • No value is preselected.
  • The newly added field is mandatory.

Background:
Visitors of our donation application use the contact form pretty often. The system processing the incoming requests is capable of categorizing based on several conditions, (e. g. content body). Providing users with an additional field for categorization of their request enables us to filter incoming requests based on that information.

Event Timeline

@kai.nissen

general topics:
1 Zuwendungsbescheinigung benötigt
2 Korrektur Zuwendungsbescheinigung
3 Änderung meiner Adresse/Emailadresse
4 Beendigung meiner Zuwendungen (Spende/Mitgliedschaft)
5 Änderung meiner Bankverbindung
6 Fragen zu meiner Mitgliedschaft/Spende
7 Sonstiges

kai.nissen set the point value for this task to 3.
aniansson moved this task from Doing to Review on the WMDE-FUN-Sprint-2018-05-28 board.
aniansson subscribed.

I've merged the pull request, but would like to request a followup to make the code less brittle in case the number of catgories changes:

  1. move the categories out of messages.json into their own JSON file in i18n/de_DE/data/contact_categories.json
  2. Add an array parameter for the categories to GetInTouchHtmlPresenter. That array should be passed as contact_categories on to the template in the render call of the presenter.
  3. In FunFunFactory::newGetInTouchHtmlPresenter load the language-appropriate data file (see https://github.com/wmde/FundraisingFrontend/blob/master/src/Factories/FunFunFactory.php#L476-L477 for inspiration, maybe that can be extracted into a private loadLocalizedData method)
  4. Use for category in contact_categories in the templates.

https://github.com/wmde/FundraisingFrontend/pull/1254 - Gabriel's follow up on placeholder colors in different browsers
https://github.com/wmde/FundraisingFrontend/pull/1257 - My follow up on making the categories an array

Lea_WMDE changed the point value for this task from 3 to 1.

@tmletzko pointed out two issues:

  • When selecting a value, that exceeds (i. e. "Beendigung meiner Zuwendungen (Spende/Mitgliedschaft)") the width of the field, the layout breaks (see screenshot). This happens in Firefox 52 (which is ESR) on at least Windows and macOS.

contact-form-layout-bug-ff52.png (960×1 px, 38 KB)

  • Since the topic is a mandatory field, the label should not be part of the selectable options.

Since the topic is a mandatory field, the label should not be part of the selectable options.

So we should move it out of the select field and place it as a label in on top of the field, breaking the consistency of the rest of the form? please ask UX about that. From a validation point of view, you *can* select the label, but it has a different color and is not a valid input.

The address form contains a mandatory salutation field and an optional field for the academic title (see screenshot below). The topic selection field should look and behave like the salutation field: Showing a label, that is not added as a selectable option.

select-mandatory-vs-optional.png (239×281 px, 8 KB)

@tmletzko The form layout breaking when choosing a value that is wider than the field seems to be a bug in Firefox ESR 52 only. We will change the value to a fitting size (by removing the text in brackets, as you already proposed).

Vvjjkkii renamed this task from Add selectable general topic to contact form to iadaaaaaaa.Jul 1 2018, 1:10 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed the point value for this task.
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot updated the task description. (Show Details)
Vachovec1 renamed this task from iadaaaaaaa to Add selectable general topic to contact form.Jul 1 2018, 4:43 PM
Vachovec1 raised the priority of this task from High to Needs Triage.
Vachovec1 added a subscriber: Aklapper.

If you do not fill a required field (for example "Thema" or "Betreff") then the message "Dieses Feld ist ein Pflichtfeld" is displayed, but also all previously typed data will be deleted. That should not happen.

kontaktformular1.PNG (427×983 px, 12 KB)
kontaktformular2.PNG (475×984 px, 13 KB)