refactor(ui): clean code

This commit is contained in:
Fu Diwei
2025-06-04 10:50:52 +08:00
parent c3e7590f53
commit 252da5d7e1
9 changed files with 72 additions and 34 deletions

View File

@@ -6,7 +6,7 @@ import dayjs from "dayjs";
import { z } from "zod";
import Show from "@/components/Show";
import { WORKFLOW_TRIGGERS, type WorkflowNodeConfigForStart, type WorkflowTriggerType } from "@/domain/workflow";
import { WORKFLOW_TRIGGERS, type WorkflowNodeConfigForStart, type WorkflowTriggerType, defaultNodeConfigForStart } from "@/domain/workflow";
import { useAntdForm } from "@/hooks";
import { getNextCronExecutions, validCronExpression } from "@/utils/cron";
@@ -27,10 +27,7 @@ export type StartNodeConfigFormInstance = {
};
const initFormModel = (): StartNodeConfigFormFieldValues => {
return {
trigger: WORKFLOW_TRIGGERS.AUTO,
triggerCron: "0 0 * * *",
};
return defaultNodeConfigForStart();
};
const StartNodeConfigForm = forwardRef<StartNodeConfigFormInstance, StartNodeConfigFormProps>(