-
Notifications
You must be signed in to change notification settings - Fork 0
Switch to swiftly GTFS and drop InfoPoint #246
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: main
Are you sure you want to change the base?
Conversation
Apologies for the nasty diff in |
src/utils/publicMessagesFromGtfs.js
Outdated
// them out. Alerts are prototyped, so blank route ids end up being empty strings. So we will end up filtering | ||
// out agency wide alerts without that second conditional. | ||
gtfsEntities = gtfsEntities.filter((gtfsEntity) => { | ||
return gtfsEntity.alert.informedEntity.every((entity) => entity.routeId in routesGtfsMap) || |
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.
return gtfsEntity.alert.informedEntity.every((entity) => entity.routeId in routesGtfsMap) || | |
return gtfsEntity.alert.informedEntity.some((entity) => entity.routeId in routesGtfsMap) || |
It just occurred to me - what if the long-running alert applies to one route that stays and one route that is removed from the schedule? We'd probably want to keep that alert at this stage?
I think this would have to be paired with another adjustment I'm gonna suggest below
src/utils/publicMessagesFromGtfs.js
Outdated
alert: { | ||
...gtfsAlert.alert, | ||
...gtfsEntity.alert, | ||
informedEntity: routeIds.map((routeId) => routesGtfsMap[routeId]) |
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.
informedEntity: routeIds.map((routeId) => routesGtfsMap[routeId]) | |
informedEntity: routeIds.map((routeId) => routesGtfsMap[routeId]).filter((route) => route) |
i.e. if we didn't get an actual route from the routeMap, discard it?
Fix #224 and swap out our implementation of GTFS hooks for our gtfs-react-hooks package.