chore(TripPlan.InputForm): change modes type from enum to map #2192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While polishing up the mode selector I struggled to reconcile the current form field values (for modes, initially a list of atoms, e.g.
[:RAIL, :BUS]
) with how the default checkboxes work (each setting a true/false value). Rather than devise some new checkbox group component, I decided to keep the traditional checkboxes and change the form schema. So now modes is a map, where each key is a mode and each value is a boolean. It works great.I also moved some display logic outside of the form live component. This let me render the selected modes summary outside the form like so :)
Finally added some missing tests around form validation mostly.