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

Support GraphQL Trip Requests #1253

Merged
merged 5 commits into from
Aug 12, 2024
Merged

Conversation

binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Aug 5, 2024

Description

This PR adds support for parsing trip request data from OTP-middleware that includes GraphQL variables, so that they are included in the Recent Searches list.
Support for old OTP1 query params in trip requests from OTP-middleware is removed.

Note that the label for a recent search includes the modes used, however the modes will not be updated upon clicking the recent search entry (the mode selector states are not passed or saved in the trip request).

PR Checklist

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

Copy link
Contributor

@josh-willis-arcadis josh-willis-arcadis left a comment

Choose a reason for hiding this comment

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

Looks good!

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.

Makes sense to me! Just a quick suggestion for cleanup

Comment on lines 172 to 188
function areRequestsSame(qp1, qp2) {
// Everything except modes.
// Exclude banned/preferred/unpreferred at this time.
return (
qp1.bikeReluctance === qp2.bikeReluctance &&
qp1.carReluctance === qp2.carReluctance &&
qp1.date === qp2.date &&
qp1.departArrive === qp2.departArrive &&
qp1.from?.name === qp2.from?.name &&
qp1.departArrive === qp2.departArrive &&
qp1.time === qp2.time &&
qp1.to?.name === qp2.to?.name &&
qp1.walkReluctance === qp2.walkReluctance &&
qp1.walkSpeed === qp2.walkSpeed &&
qp1.wheelchair === qp2.wheelchair
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of doing this many checks, would it be possible to filter out the properties you don't want to compare (eg. modes and banned routes) and then compare using JSON.stringify?

@binh-dam-ibigroup binh-dam-ibigroup merged commit ac565c7 into dev Aug 12, 2024
9 checks passed
@binh-dam-ibigroup binh-dam-ibigroup deleted the support-graphql-trip-requests branch August 12, 2024 18:40
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