-
Notifications
You must be signed in to change notification settings - Fork 57
Select scooter mode when starting trip from scooter in nearby view #1449
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
base: dev
Are you sure you want to change the base?
Conversation
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.
A few architectural questions
const overlayTypes = overlays | ||
?.filter((overlay) => overlay?.type === 'otp2')?.[0] | ||
?.layers?.map((layer) => layer?.type) | ||
const handleSetLocation = (location: MapLocationActionArg) => { |
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.
This is one approach, but could we not fix this by adjusting query params? What if we check for map state in the places where query params are set? Might that be a better separation of concerns than setting modes within the map component?
lib/components/map/default-map.tsx
Outdated
@@ -486,6 +509,7 @@ const mapStateToProps = (state) => { | |||
bikeRentalStations: state.otp.overlay.bikeRental.stations, | |||
carRentalStations: state.otp.overlay.carRental.stations, | |||
config: state.otp.config, | |||
currentQuery: state.otp.currentQuery, |
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.
Not a huge fan of importing query info into the map component...
Description:
This PR adds functionality to automatically select the rental vehicle mode in the trip planner when starting a trip from a selected rental vehicle in Nearby View. The logic respects the existing trip modes that are selected.
Currently blocked until opentripplanner/otp-ui#871 is merged and version bumped.PR Checklist: