Skip to content
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

set viewedRouteStops when route viewer is active #1270

Merged
merged 11 commits into from
Sep 25, 2024

Conversation

miles-grant-ibigroup
Copy link
Collaborator

Description:
Blocked waiting for opentripplanner/otp-ui#772

PR Checklist:

  • Does the code follow accessibility standards (WCAG 2.1 AA Compliant)?
  • Are all languages supported (Internationalization/Localization)?
  • Are appropriate Typescript types implemented?

@miles-grant-ibigroup miles-grant-ibigroup added the BLOCKED Blocked (waiting on another PR to be merged) label Sep 6, 2024
@miles-grant-ibigroup miles-grant-ibigroup self-assigned this Sep 6, 2024
@miles-grant-ibigroup miles-grant-ibigroup removed the BLOCKED Blocked (waiting on another PR to be merged) label Sep 13, 2024
Copy link
Contributor

@daniel-heppner-ibigroup daniel-heppner-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just clean up the state mapper. I also noticed that sometimes a handful of stops just don't show up. Is that an OTP thing?

state.otp?.transitIndex?.routes?.[viewedRoute]?.patterns || {}
).reduce((acc, cur) => {
return Array.from(
new Set([...cur?.[1]?.stops.map((s) => s.id), ...acc])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be cleaned up. Remove the Array.from and Set from this and do it outside the reducer so it doesn't have to be repeated on each loop. Also, maybe we can move this to a function above? I found it quite difficult to read what was happening here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively just break out more variables. Like put the Object.entries into a variable.

@amy-corson-ibigroup amy-corson-ibigroup mentioned this pull request Sep 18, 2024
3 tasks
@miles-grant-ibigroup miles-grant-ibigroup added the BLOCKED Blocked (waiting on another PR to be merged) label Sep 19, 2024
@miles-grant-ibigroup
Copy link
Collaborator Author

Blocked by #1270

@amy-corson-ibigroup amy-corson-ibigroup removed the BLOCKED Blocked (waiting on another PR to be merged) label Sep 20, 2024
Copy link
Contributor

@daniel-heppner-ibigroup daniel-heppner-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thank you!

Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!!

@miles-grant-ibigroup miles-grant-ibigroup merged commit 818ac7d into dev Sep 25, 2024
9 checks passed
@miles-grant-ibigroup miles-grant-ibigroup deleted the show-stops-in-route-viewer branch September 25, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants