fix(ui): wrong form initial values
This commit is contained in:
@@ -52,7 +52,9 @@ const ApplyNodeForm = ({ node }: ApplyNodeFormProps) => {
|
||||
providerAccessId: z
|
||||
.string({ message: t("workflow_node.apply.form.provider_access.placeholder") })
|
||||
.min(1, t("workflow_node.apply.form.provider_access.placeholder")),
|
||||
keyAlgorithm: z.string().nullish(),
|
||||
keyAlgorithm: z
|
||||
.string({ message: t("workflow_node.apply.form.key_algorithm.placeholder") })
|
||||
.nonempty(t("workflow_node.apply.form.key_algorithm.placeholder")),
|
||||
nameservers: z
|
||||
.string()
|
||||
.nullish()
|
||||
@@ -76,6 +78,7 @@ const ApplyNodeForm = ({ node }: ApplyNodeFormProps) => {
|
||||
formPending,
|
||||
formProps,
|
||||
} = useAntdForm<z.infer<typeof formSchema>>({
|
||||
name: "workflowApplyNodeForm",
|
||||
initialValues: (node?.config as WorkflowNodeConfigForApply) ?? initFormModel(),
|
||||
onSubmit: async (values) => {
|
||||
await formInst.validateFields();
|
||||
@@ -305,7 +308,7 @@ const FormFieldEmailSelect = ({
|
||||
|
||||
const handleSearch = (text: string) => {
|
||||
const temp = emailsToOptions();
|
||||
if (text) {
|
||||
if (text?.trim()) {
|
||||
if (temp.every((option) => option.label !== text)) {
|
||||
temp.unshift({ label: text, value: text });
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ const DeployNodeForm = ({ node }: DeployFormProps) => {
|
||||
formPending,
|
||||
formProps,
|
||||
} = useAntdForm<z.infer<typeof formSchema>>({
|
||||
name: "workflowDeployNodeForm",
|
||||
initialValues: (node?.config as WorkflowNodeConfigForDeploy) ?? initFormModel(),
|
||||
onSubmit: async (values) => {
|
||||
await formInst.validateFields();
|
||||
|
||||
@@ -57,6 +57,7 @@ const NotifyNodeForm = ({ node }: NotifyNodeFormProps) => {
|
||||
formPending,
|
||||
formProps,
|
||||
} = useAntdForm<z.infer<typeof formSchema>>({
|
||||
name: "workflowNotifyNodeForm",
|
||||
initialValues: (node?.config as WorkflowNodeConfigForNotify) ?? initFormModel(),
|
||||
onSubmit: async (values) => {
|
||||
await formInst.validateFields();
|
||||
|
||||
@@ -54,6 +54,7 @@ const StartNodeForm = ({ node }: StartNodeFormProps) => {
|
||||
formPending,
|
||||
formProps,
|
||||
} = useAntdForm<z.infer<typeof formSchema>>({
|
||||
name: "workflowStartNodeForm",
|
||||
initialValues: (node?.config as WorkflowNodeConfigForStart) ?? initFormModel(),
|
||||
onSubmit: async (values) => {
|
||||
await formInst.validateFields();
|
||||
|
||||
Reference in New Issue
Block a user