-
Notifications
You must be signed in to change notification settings - Fork 53
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
Deselect all submodes #1265
Deselect all submodes #1265
Conversation
…o reset to default values
… values of all subsettings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first round of thoughts on this here.
In general we should not be repeating work to find the mode buttons that we already have access to elsewhere in the application.
onToggleModeButton={setModeButton( | ||
enabledModeButtons, | ||
onSettingsUpdate(setQueryParam) | ||
onSettingsUpdate={onAdvancedModeSubsettingsUpdate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I am uncomfortable with here is that the advanced settings panel already has the mode button that corresponds with the mode setting that is being updated. I don't think we should do a bunch of work to get that mode button item again. It will require an update to the OTP UI component but I think there's a better way to go about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, maybe it would be possible to do this change almost entirely within OTP UI? Could we just add a prop for transportModesDisableCascade
? Weird name idk but something like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first round, I'll finish reviewing when OTP UI is merged
0648e80
to
8a6bef9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome! this is clean!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious what you both think of this setTimeout
idea @daniel-heppner-ibigroup @josh-willis-arcadis. We can also address in a follow up PR if need be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good as-is, we can move the conversation about potential setTimeout
to the OTP-UI PR! Thank you so much for your work on this!! :) Also just flagging daniel's note about the +1 line on 172.
Description:
When the user deselects all transport submode options(transit and rental), the mode should be disabled. This is reflected in the URL query params. When the mode is enabled after being disabled by deselecting all transport submode options, the defaults are used.
Blocked by opentripplanner/otp-ui#782
PR Checklist: