feat(ui): new WorkflowNotifyNodeForm using antd

This commit is contained in:
Fu Diwei
2024-12-25 20:57:09 +08:00
parent 4d0f7c2e02
commit 6bd3b4998e
13 changed files with 168 additions and 235 deletions

View File

@@ -48,7 +48,7 @@ const StartNodeForm = ({ data }: StartNodeFormProps) => {
}
});
const formRule = createSchemaFieldRule(formSchema);
const [form] = Form.useForm<z.infer<typeof formSchema>>();
const [formInst] = Form.useForm<z.infer<typeof formSchema>>();
const [formPending, setFormPending] = useState(false);
const [initialValues, setInitialValues] = useState<Partial<z.infer<typeof formSchema>>>(
@@ -69,7 +69,7 @@ const StartNodeForm = ({ data }: StartNodeFormProps) => {
setTriggerType(value);
if (value === "auto") {
form.setFieldValue("crontab", form.getFieldValue("crontab") || initFormModel().crontab);
formInst.setFieldValue("crontab", formInst.getFieldValue("crontab") || initFormModel().crontab);
}
};
@@ -90,7 +90,7 @@ const StartNodeForm = ({ data }: StartNodeFormProps) => {
};
return (
<Form form={form} disabled={formPending} initialValues={initialValues} layout="vertical" onFinish={handleFormFinish}>
<Form form={formInst} disabled={formPending} initialValues={initialValues} layout="vertical" onFinish={handleFormFinish}>
<Form.Item
name="executionMethod"
label={t("workflow.nodes.start.form.trigger.label")}