feat: added quarterly option for scheduler#9076
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fc4ba3ca9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!Number.isNaN(parsedDay) && parsedDay > maxDayOfMonth) { | ||
| setDayOfMonth(maxDayOfMonth.toString()); |
There was a problem hiding this comment.
Avoid rewriting existing quarterly schedules on load
When an existing cron like 0 0 14 31 1,4,7,10 * is loaded, the new quarter parsing path sets period='quarter' and this effect immediately clamps dayOfMonth from 31 to 30, so saving the modal without intentional schedule edits mutates the original cron. This is a regression for pre-existing schedules that legitimately used day 31 with quarterly month lists and now get silently downgraded to day 30.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
fixed by using custom cron expression on ui
| const clampedDayOfMonth = Math.min( | ||
| Math.max(parseInt(dayOfMonth, 10) || 1, 1), | ||
| maxDayOfMonth | ||
| ).toString(); |
There was a problem hiding this comment.
Keep quarter day input and emitted cron in sync
For quarter schedules, the emitted cron uses clampedDayOfMonth, but the component only writes back to state when the value is above maxDayOfMonth, not when it is empty or below 1. As a result, entering 0 (or clearing the field) can leave the UI showing an invalid day while onChange emits day 1, so users may save a schedule different from what the form displays.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7c83cd917
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case 'custom': | ||
| cron = customCron; | ||
| break; |
There was a problem hiding this comment.
Preserve current preset cron when entering custom mode
Switching from a preset (day/week/month/quarter/year) to custom currently emits a stale cron string, because customCron is only initialized from schedule and then reused in case 'custom' without being synced to the latest preset-generated cron. In practice, a user can configure a new schedule in preset controls, pick Custom to fine-tune it, and immediately overwrite their edits with the old/default expression, leading to unintended saves unless they manually re-enter the cron.
Useful? React with 👍 / 👎.
|
this is good. I think an extra control for daily/monthly where you get to pick which days (of the week) and which months (of the year) seems like a decent way to offer even more flexibility |
Summary
Close #8975
Added quarterly and custom cron options
Testing
Unit and manual
Screenshots/Demos (for UX changes)
After:
