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

feat(TripPlanner): Use Stop ID to query OTP #1799

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Conversation

kotva006
Copy link
Contributor

Summary of changes

This pull request allows us to query OTP using stop ids. This is supposed to remove walking directions to get to the initial stop if the user is already assumed at the stop.

Asana Ticket: Fix Trip planner origin and destinations


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.

New UI, or substantial UI changes

  • Cross-browser compatibility is less of an issue now that we're no longer supporting IE, but changes still need to work as expected in Safari, Chrome, and Firefox.
  • Are interactive elements accessible? This includes at minimum having relevant keyboard interactions and visible focus, but can also include verification with screen reader testing.
  • Other accessibility checks such as sufficient color constrast, or whether the layout holds up at 200% zoom level.

New endpoints, or non-trivial changes to current endpoints

  • Have we load-tested any new pages or internal API endpoints that will receive significant traffic? See load testing docs
  • If this change involves routes, does it work correctly with pertinent "unusual" routes such as the combined Green Line, Silver Line, Foxboro commuter rail, and single-direction bus routes like the 170?

@kotva006 kotva006 requested a review from a team as a code owner November 20, 2023 16:20
Copy link
Contributor

@anthonyshull anthonyshull left a comment

Choose a reason for hiding this comment

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

Overall looks good. Just a few questions.

Comment on lines +368 to +369
const stopIdEl = this.getById(ac._selectors.stop_id);
stopIdEl.value = hit.stop.id;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to set a const here?

this.getById(ac._selectors.stop_id).value = hit.stop.id;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No reason, just preference

@anthonyshull
Copy link
Contributor

Just so I know, are there no tests to write here?

@kotva006 kotva006 merged commit 1878cc0 into master Nov 21, 2023
17 of 18 checks passed
@kotva006 kotva006 deleted the rk/plan-origin-dest branch November 21, 2023 19:23
thecristen added a commit that referenced this pull request Nov 22, 2023
@thecristen
Copy link
Collaborator

I had to revert this in release 2023.11.22.02 as it wasn't working well when the origin and destination were not stop IDs.

It raises a GraphQL exception when I try to plan a trip between Fall River Historical Society, 451 Rock St, Fall River, MA, 02720, USA and Worcester locally, here's the response the query returns:

%{
    "data" => %{"plan" => nil},
    "errors" => [
        %{
            "extensions" => %{"classification" => "DataFetchingException"},
            "locations" => [%{"column" => 3, "line" => 2}],
            "message" => "Exception while fetching data (/plan) : Missing mandatory id on FeedScopeId [Value cannot be null, empty or just whitespace: '']",
            "path" => ["plan"]
        }
    ]
}

And when interacting with it on the front-end, I noticed if I edited the destination for a working trip plan (e.g. I've already pulled up itineraries) from a stop to an address, and regenerate the plan, the itineraries would appear to update, but are actually routing me to the initially selected stop. Not sure what's going on there.

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