From 15347237e75196435f5799df213a2be22d0e70fd Mon Sep 17 00:00:00 2001 From: alphaeusmote <41258468-alphaeusmote@users.noreply.replit.com> Date: Fri, 11 Apr 2025 03:39:30 +0000 Subject: [PATCH] Enhance cron job builder with "Select All" options for time units and remove "custom" option Replit-Commit-Author: Agent Replit-Commit-Session-Id: 705f2157-ef97-4fbd-89e4-8c7f2ecaea90 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ed01c5f-a82d-405a-b728-b2e3d127c60c/3e43a46b-eb88-40c4-b4c3-92293e8327e6.jpg --- .../dynamic-groups/cron-job-builder.tsx | 90 ++++++++++++++++++- shared/schema.ts | 5 +- 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/client/src/components/dynamic-groups/cron-job-builder.tsx b/client/src/components/dynamic-groups/cron-job-builder.tsx index 7832d20..6eb8960 100644 --- a/client/src/components/dynamic-groups/cron-job-builder.tsx +++ b/client/src/components/dynamic-groups/cron-job-builder.tsx @@ -281,10 +281,8 @@ export const CronJobBuilder: React.FC = ({ return `Runs weekly on ${schedule.dayOfWeek || 'Monday'} at ${formatTime(schedule.hour, schedule.minute)}`; case 'monthly': return `Runs monthly on day ${schedule.dayOfMonth || 1} at ${formatTime(schedule.hour, schedule.minute)}`; - case 'custom': - return 'Custom schedule'; default: - return 'Custom schedule'; + return 'Advanced schedule'; } }; @@ -724,6 +722,34 @@ export const CronJobBuilder: React.FC = ({
+
+ + +
{weekdays.map((day) => ( + +
{Array.from({ length: 31 }, (_, i) => i + 1).map((day) => ( + +
{[ 'January', 'February', 'March', 'April', diff --git a/shared/schema.ts b/shared/schema.ts index 0b92fea..df85793 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -154,8 +154,7 @@ export const scheduleFrequencies = [ "daily", "weekly", "monthly", - "yearly", - "custom" + "yearly" ] as const; export const weekdays = [ @@ -172,7 +171,7 @@ export const weekdays = [ export const scheduleRules = pgTable("schedule_rules", { id: serial("id").primaryKey(), ruleId: integer("rule_id").references(() => dynamicGroupRules.id, { onDelete: "cascade" }).notNull(), - frequency: text("frequency").notNull(), // once, minutely, hourly, daily, weekly, monthly, yearly, custom + frequency: text("frequency").notNull(), // once, minutely, hourly, daily, weekly, monthly, yearly minute: integer("minute"), // 0-59 hour: integer("hour"), // 0-23 dayOfMonth: integer("day_of_month"), // 1-31