Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(TripPlan.InputForm): change modes type from enum to map #2192

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

thecristen
Copy link
Collaborator

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 :)

image

Finally added some missing tests around form validation mostly.

@thecristen thecristen requested a review from a team as a code owner October 8, 2024 20:01
@thecristen thecristen merged commit 092eb65 into main Oct 10, 2024
26 checks passed
@thecristen thecristen deleted the cbj/mode-selector-tweak branch October 10, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants