fix(ui): antd nested form bugs

This commit is contained in:
Fu Diwei
2025-01-06 19:10:29 +08:00
parent 4ba7237326
commit 87e1749553
60 changed files with 1694 additions and 1358 deletions

View File

@@ -31,6 +31,8 @@ const Login = () => {
await navigage("/");
} catch (err) {
notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) });
throw err;
}
},
});

View File

@@ -43,6 +43,8 @@ const SettingsAccount = () => {
}, 500);
} catch (err) {
notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) });
throw err;
}
},
});

View File

@@ -47,6 +47,8 @@ const SettingsPassword = () => {
}, 500);
} catch (err) {
notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) });
throw err;
}
},
});

View File

@@ -316,9 +316,9 @@ const WorkflowBaseInfoModal = ({ trigger }: { trigger?: React.ReactNode }) => {
try {
await workflowState.setBaseInfo(values.name!, values.description!);
} catch (err) {
console.error(err);
notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) });
return false;
throw err;
}
},
});

View File

@@ -216,7 +216,7 @@ const WorkflowList = () => {
<Tooltip title={t("workflow.action.delete")}>
<Button
color="danger"
danger={true}
danger
icon={<DeleteOutlinedIcon />}
variant="text"
onClick={() => {

View File

@@ -73,10 +73,9 @@ const WorkflowNew = () => {
workflow = await saveWorkflow(workflow);
navigate(`/workflows/${workflow.id}`, { replace: true });
} catch (err) {
console.error(err);
notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) });
return false;
throw err;
}
},
});
@@ -155,6 +154,7 @@ const WorkflowNew = () => {
</div>
<ModalForm
{...formProps}
disabled={formPending}
layout="vertical"
form={formInst}
@@ -165,7 +165,6 @@ const WorkflowNew = () => {
width={480}
onFinish={handleModalFormFinish}
onOpenChange={handleModalOpenChange}
{...formProps}
>
<Form.Item name="name" label={t("workflow.new.modal.form.name.label")} rules={[formRule]}>
<Input ref={(ref) => setTimeout(() => ref?.focus({ cursor: "end" }), 0)} placeholder={t("workflow.new.modal.form.name.placeholder")} />