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

fix(SiteWeb.StopController): don't show route patterns for services that aren't running today #1762

Merged
merged 7 commits into from
Oct 13, 2023

Conversation

thecristen
Copy link
Collaborator

@thecristen thecristen commented Oct 3, 2023

Instead of using all route patterns from the whole rating, this PR adjusts the stop page's backend response for route patterns to remove those associated with services that aren't applicable today.

On the stop page, this removes headsigns associated with route patterns for this weekend's shuttle service, later disruptions, and so on.


General checks

  • Are the changes organized into self-contained commits with descriptive and well-formatted commit messages? This is a good practice that can facilitate easier reviews.
  • Testing. Do the changes include relevant passing updates to tests? This includes updating screenshots. Preferably tests are run locally to verify that there are no test failures created by these changes, before opening a PR.
  • Tech debt. Have you checked for tech debt you can address in the area you're working in? This can be a good time to address small issues, or create Asana tickets for larger issues.

@thecristen thecristen added the dev-blue Deploy to dev-blue label Oct 3, 2023
@thecristen thecristen temporarily deployed to dev-blue October 3, 2023 20:43 — with GitHub Actions Inactive
@thecristen thecristen temporarily deployed to dev-blue October 3, 2023 21:20 — with GitHub Actions Inactive
@thecristen thecristen force-pushed the cbj/route-patterns-in-service branch from d8ca79b to b3e0b3b Compare October 4, 2023 19:26
@thecristen thecristen force-pushed the cbj/route-patterns-in-service branch from b3e0b3b to 35f272f Compare October 4, 2023 19:30
@thecristen thecristen changed the title wip(StopPageRedesign): don't show route patterns for services that aren't running today fix(StopPageRedesign): don't show route patterns for services that aren't running today Oct 4, 2023
@thecristen thecristen temporarily deployed to dev-blue October 4, 2023 19:30 — with GitHub Actions Inactive
@thecristen thecristen changed the title fix(StopPageRedesign): don't show route patterns for services that aren't running today fix(SiteWeb.StopController): don't show route patterns for services that aren't running today Oct 4, 2023
@thecristen thecristen marked this pull request as ready for review October 4, 2023 19:35
@thecristen thecristen requested a review from a team as a code owner October 4, 2023 19:35
@thecristen thecristen requested a review from kotva006 October 4, 2023 19:35
and parse it from the trip's relationships
semi-adapted from the V3 API's approach
- remove route patterns associated to a service that is not running today
- except when it's a canonical service... let that route pattern through anyway
@thecristen thecristen force-pushed the cbj/route-patterns-in-service branch from 35f272f to d632823 Compare October 4, 2023 19:41
@thecristen thecristen temporarily deployed to dev-blue October 4, 2023 19:42 — with GitHub Actions Inactive
Comment on lines +160 to +164
"service" => [
%Item{
id: service_id
}
]
Copy link
Contributor

Choose a reason for hiding this comment

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

This arraying of relationships is exactly what is happening in the line parsing I am working on. Should we keep this behavior around?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I see what you mean.

Should we keep this behavior around?

Changing this (via removing list() in the relevant part of the %JsonApi.Item{} struct here) would require a baffling amount of downstream changes in all of our V3 API parsing. I don't see the benefit in changing it.

@spec parse_listed_dates([String.t()]) :: [NaiveDateTime.t()]
defp parse_listed_dates(date_strings) do
date_strings
|> Enum.map(&Timex.parse(&1, "{YYYY}-{0M}-{D}"))
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Does the {D} need the leading zero?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

..yes. I will update

Copy link
Contributor

@kotva006 kotva006 left a comment

Choose a reason for hiding this comment

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

Some minor questions but it looks good

@thecristen thecristen temporarily deployed to dev-blue October 13, 2023 15:32 — with GitHub Actions Inactive
@thecristen thecristen removed the dev-blue Deploy to dev-blue label Oct 13, 2023
@thecristen thecristen merged commit 3c2993d into master Oct 13, 2023
19 of 20 checks passed
@thecristen thecristen deleted the cbj/route-patterns-in-service branch October 13, 2023 16:00
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.

2 participants