-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: add types for DUP widgets #2115
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Normal" is generally not a useful prefix, and this resolves an inconsistency where the backend refers to this component as just `departures`.
This aligns with the convention used in the other Departures components where the props are exactly the "API" used by the server.
In the only places this prop was used, it was always set to `true`.
This DUP-specific logic was a duplicate of logic already incorporated into `RoutePill`, with an added bug that it would not correctly display a route numbered `200` at small size (if the MBTA had such a route).
This adds TypeScript types for most DUP widgets that were missing them. Includes these related changes: * DUPs have a unique "overnight" departure time type that displays a moon icon in place of a time. The backend serialized this as `%{type: :icon, icon: :overnight}`, but the frontend didn't use the `icon` field and unconditionally rendered a moon icon. This has been changed to just `%{type: :overnight}`. * DUP departure times mistakenly looked at the `type` field of the predicted time to determine how to show the scheduled time, rather than the scheduled time's own `type`. This worked anyway, because scheduled times are currently only produced when the type of both times is the same (`timestamp` specifically), but the type checker caught this as potentially broken.
digitalcora
force-pushed
the
cfg-dup-types
branch
from
July 29, 2024 21:25
d3fed8f
to
1124c47
Compare
Coverage of commit
|
cmaddox5
approved these changes
Jul 30, 2024
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.
Looks good. Thanks for adding the helpful comments.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This ended up being an exercise in stumbling upon a bunch of little things that could be refactored, so best reviewed per-commit (there are some explanations in the commit messages). The main point here is the final commit!