-
Notifications
You must be signed in to change notification settings - Fork 57
give map popup the agency names so it can render them in the stop popup #1433
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
Conversation
Blocked by opentripplanner/otp-ui#857 |
6b4cd00
to
6713ae1
Compare
This is blocked as in we can't merge it until we have the new version numbers, but it can be reviewed! |
otp-ui is ready for merge! I'll wait until this PR has the updated package version and merge conflicts fixed |
Is this ready for review? If so, can you update package versions and fix merge conflicts? |
done! |
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 questions
lib/components/map/default-map.tsx
Outdated
getAgencyFromStopId = async (stopId: string) => { | ||
this.props.findStopTimesForStop({ | ||
date: getCurrentDate(), | ||
stopId | ||
}) | ||
} | ||
|
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's this for?
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.
oops! no longer needed
@@ -462,6 +478,7 @@ class DefaultMap extends Component { | |||
const mapStateToProps = (state) => { | |||
const activeSearch = getActiveSearch(state) | |||
const viewedRoute = state.otp?.ui?.viewedRoute?.routeId | |||
const stops = state.otp.transitIndex.stops |
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 if transitIndex is undefined
@@ -486,6 +503,7 @@ const mapStateToProps = (state) => { | |||
bikeRentalStations: state.otp.overlay.bikeRental.stations, | |||
carRentalStations: state.otp.overlay.carRental.stations, | |||
config: state.otp.config, | |||
feeds: state.otp.transitIndex.feeds, |
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 if transit index is undefined
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.
it won't be, it's defined in the initial state in the reducer.
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.
a2913b2
to
e09193e
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.
Works well and code looks good! STill seeing some funky behavior when clickign on stations but I guess that's ok?
I am not seeing the updated text using other languages (e.g. Spanish). Any ideas? I'll try a to find the cause of 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.
Necessary changes for the scope of this PR seem fine. Out of scope for this PR: Better i18n handling for stop id formatting in other languages.
Description:
We needed to render the agency name for a stop in the stop popup. Sadly this information is not easy to get, it requires another network request. This change provides a callback for the tile overlay to request information about a stop ID, and then gives it a map of all the stops from the transit index along with their agency object. Note that because the stops can have multiple agencies, we just take the first one. Feel free to suggest a different behavior for shared stops.