-
Notifications
You must be signed in to change notification settings - Fork 25
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
refactor schedule inputs #264
Conversation
Feedback from UX testing: The "minutes of hour" interfere with the "time of day". If I select Hour, then pick 55, then switch to Day, the time is 00:55, but I had expected 00:00. Notably, this isn't bidirectional; if I change the time of day to 01:20, then switch back to Hour, the "minutes of hour" are 55, not 20. I think it would be better to keep "minutes of hour" and "time of day" (as hour and minute) as two separate state items. Minor: 24-hour time is properly If I enter 33 as the day of the month, before I blur the control, I see helper text that the job will not run in months with fewer than 33 days: When I blur the control, I see the expected 1–31 value validation message even after I refocus the control. It might be better to impose errors on change, not just on blur, to prevent this. Similarly, entering an invalid time causes a confusing helper text message, instead of an error: |
@jweill-aws They already are ( Screen.Recording.2022-11-02.at.2.07.43.PM.mov |
I also don't see the "minute of hour" propagating to "time of day" bug anymore after checking out your code and rebuilding. Must have been a problem on my end. |
Discussed this with @ellisonbg, we think it is better to validate on change rather than on blur. Just pushed this change. |
578ca2f
to
546f96f
Compare
I created a job description to run at 2 minutes past the hour. When I edit it, I see "2" when I choose "Hour," and when I choose "Day", "Weekday", or "Week", the time is set to 00:02, which I hadn't expected. Screen.Recording.2022-11-02.at.3.33.05.PM.mov |
@jweill-aws Fixed.
@jweill-aws I don't consider this a bug; it's more of an implementation detail of how coercion works. The user will have to edit the clock field if they go from a schedule running on an hourly basis to one running on a daily/weekly basis. We make the most logical choice (preserving as many cron terms as we can), but obviously this isn't going to cover cases in which coercion isn't even well-defined. |
* Extracts cron terms and coerces them into an array of numbers. Ranges are | ||
* coerced by their first term, e.g. "12-34" is coerced to 12. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, days of the week like MON
(1) and FRI
(5) are also valid cron terms, but this function would coerce them to 0 (Sunday).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this is expected of the current implementation.
Description
ScheduleInputs
component and the corresponding UI model to remove duplicate stateDemo (outdated)
Screen.Recording.2022-11-02.at.12.58.14.PM.mov
Limitations
parseInt()
, and uses a default only if the value cannot be parsed.99 99 * * MON-FRI
, then switching to "weekday" results in the time being set to99:99
.Related issues