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 schedule view input #1021

Merged
merged 17 commits into from
Oct 13, 2023
Merged

Fix schedule view input #1021

merged 17 commits into from
Oct 13, 2023

Conversation

binh-dam-ibigroup
Copy link
Collaborator

Description

This PR ensures that web requests to get stop times are made only when the user enters a valid date
within the service range available in OTP. Stop times requests when the date is invalid or out of range are no longer made.
Bonus UI: the browser will show the valid dates and sometimes prevent users from entering a date outside the range.

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
Collaborator

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

Not sure how crazy I am about using the invisible component instead of baking this into a relevant redux action/graphql query, but it works well and code is clean! Thanks for this fix

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.

I really like this change. I think it's a little confusing from a user perspective. See comment about the timezone alert bug.

If a user enters an invalid date, they should be made aware the request was invalid and the schedule did not update. Or the schedule should disappear, so users do not mistakenly assume the schedule represents the invalid date.
image

Comment on lines +313 to +318
const timezoneCode = formatTz(
isShowingSchedule && date
? parse(date, inputDateFormat, new Date())
: new Date(), // TODO: mock for percy tests,
'z',
{
Copy link
Contributor

Choose a reason for hiding this comment

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

This is causing the timezone code to change & update in the alert if the year starts with 0, which is a little jarring as you're typing.
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! Fixed in 4d1e615.

@binh-dam-ibigroup
Copy link
Collaborator Author

If a user enters an invalid date, they should be made aware the request was invalid and the schedule did not update. Or the schedule should disappear, so users do not mistakenly assume...

Good catch, fixed in cc7e503.

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.

Working really well! Thank Binh, this looks great!

@binh-dam-ibigroup binh-dam-ibigroup merged commit 93e5500 into dev Oct 13, 2023
7 checks passed
@binh-dam-ibigroup binh-dam-ibigroup deleted the fix-schedule-view-input branch October 13, 2023 16:56
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