5309 update contact type selection
What github issue is this PR for, if any?
Resolves #5309
What changed, and why?
This code change an existing code dependency library to create a better UX when selecting contact types.
To accomplish this, I refactored an existing stimulus controller to allow for the instantiation a multi-select with option groups. The tomselect library provides all the requested functionality, though there are a few differences in UX from the figma spec (e.g., no checkboxes, once options are selected, they disappear from the dropdown options).
Though not explicitly requested in spec, the solution also provides highlighting to improve UX of search functionality.
This change also removes some custom JS (related to checkboxes) and view logic that seems unnecessary, given that this partial is only used in this form.
How will this affect user permissions?
- Volunteer permissions: N/A
- Supervisor permissions: N/A
- Admin permissions: N/A
This code change is expressly focused on view logic.
How is this tested? (please write tests!) 💖💪
Since this is a change to view logic, the best testing is either manual QA or e2e tests.
User story for manual QA: As a volunteer, I should be able to arrive on this form page. Selecting the dropdown should allow me to see different options, grouped by contact group type. I should be able to select and remove multiple contact types using the mouse. I should be able to select and remove multiple contact types using the keyboard. When I submit this stage of the contact wizard, I should be able to return and see that the contact types have persisted (those I selected are still there).
Screenshots please :)
Feedback please? (optional)
Well scoped ticket, fun to work on. Well done!