-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Add alert icons for stops on the map #111
Conversation
# Conflicts: # iosApp/iosApp/ContentView.swift
@@ -44,13 +44,29 @@ class StopLayerGenerator { | |||
static func getStopLayerIcon(_ locationType: LocationType) -> Value<ResolvedImage> { | |||
switch locationType { |
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.
I tried to move back to a single stop layer like I mentioned in this thread, but it doesn't allow you to use .zoom
outside of a top level .step
expression for some reason, so having it nested one layer deeper in a .match
doesn't seem possible.
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.
Ran locally, looks great! A few questions & suggestions to consider. Are there any station closures to see? May be worth creating one in the alerts dev UI if not!
shared/src/commonMain/kotlin/com/mbta/tid/mbta_app/model/Stop.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/com/mbta/tid/mbta_app/model/AlertAssociatedStop.kt
Show resolved
Hide resolved
shared/src/commonMain/kotlin/com/mbta/tid/mbta_app/model/GlobalStaticData.kt
Show resolved
Hide resolved
shared/src/commonMain/kotlin/com/mbta/tid/mbta_app/model/AlertAssociatedStop.kt
Outdated
Show resolved
Hide resolved
shared/src/commonTest/kotlin/com/mbta/tid/mbta_app/model/GlobalResponseTest.kt
Outdated
Show resolved
Hide resolved
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.
Thanks for making those updates!
return alerts.filter { Alert.serviceDisruptionEffects.contains(it.effect) } | ||
} | ||
|
||
private fun getServiceStatus( |
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.
suggestion (non-blocking): this has a lot of important logic, would it be worth unit testing independently?
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.
Hm, possibly. The behavior in the existing tests was meant to cover everything here, so it would probably be a bit redundant, but it's not a bad idea.
Summary
Ticket: Stop icons on map reflect current alerts
Backend PR: mbta/mobile_app_backend#109
Show alert icons on stops for partial alerts, and red X icons for completely closed stops.
Testing
Added unit tests for kotlin alert to stop association, and for the map GeoJSON stop source generation