feat(KB-228): add schedule time presets

- Add morning, afternoon, evening, and night preset schedules to core automation types
- Update ScheduleForm with preset selection dropdown and time handling
- Add color coding for different schedule types in ScheduleCard
- Add tests for new schedule preset functionality
- Include changeset for release tracking
This commit is contained in:
gsxdsm
2026-03-30 18:42:04 -07:00
parent cd8a1e9779
commit 7fca1f7010
5 changed files with 60 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
/** Schedule type presets plus a custom cron option. */
export type ScheduleType = "hourly" | "daily" | "weekly" | "monthly" | "custom";
export type ScheduleType = "hourly" | "daily" | "weekly" | "monthly" | "custom" | "every15Minutes" | "every30Minutes" | "every2Hours" | "every6Hours" | "every12Hours" | "weekdays";
/** Mapping from preset schedule types to their cron expressions. */
export const AUTOMATION_PRESETS: Record<Exclude<ScheduleType, "custom">, string> = {
@@ -7,6 +7,12 @@ export const AUTOMATION_PRESETS: Record<Exclude<ScheduleType, "custom">, string>
daily: "0 0 * * *",
weekly: "0 0 * * 1",
monthly: "0 0 1 * *",
every15Minutes: "*/15 * * * *",
every30Minutes: "*/30 * * * *",
every2Hours: "0 */2 * * *",
every6Hours: "0 */6 * * *",
every12Hours: "0 */12 * * *",
weekdays: "0 9 * * 1-5",
};
/** Result of a single automation run. */