-
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
@@ -319,6 +325,23 @@ class DefaultMap extends Component { | |||
const baseLayerUrls = baseLayersWithNames?.map((bl) => bl.url) | |||
const baseLayerNames = baseLayersWithNames?.map((bl) => bl.name) | |||
|
|||
const overlayTypes = overlays |
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.
One weird quirk...I realized after writing this that we don't actually specify that this logic should only fire when the from
is clicked on a rental vehicle popup. And yet, when I click the from
on other popups (like a stop), it doesn't enable the rental vehicle mode. I'm not really sure why...
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
@@ -319,6 +325,23 @@ class DefaultMap extends Component { | |||
const baseLayerUrls = baseLayersWithNames?.map((bl) => bl.url) | |||
const baseLayerNames = baseLayersWithNames?.map((bl) => bl.name) | |||
|
|||
const overlayTypes = overlays | |||
?.filter((overlay) => overlay?.type === 'otp2')?.[0] |
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.
Could we not use find
instead?
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?
@@ -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.
PR Checklist: