fix(ui): wrong form initial values

This commit is contained in:
Fu Diwei
2025-01-05 00:47:27 +08:00
parent 61843a4997
commit ddb6a88392
12 changed files with 38 additions and 29 deletions

View File

@@ -43,7 +43,7 @@ const WorkflowDetail = () => {
useZustandShallowSelector(["workflow", "initialized", "init", "destroy", "save", "setBaseInfo", "switchEnable"])
);
useEffect(() => {
// TODO: loading
// TODO: loading & error
init(workflowId!);
return () => {
@@ -64,7 +64,7 @@ const WorkflowDetail = () => {
setAllowDiscard(!isRunning && hasReleased && hasChanges);
setAllowRelease(!isRunning && hasChanges);
setAllowRun(hasReleased);
}, [workflow, isRunning]);
}, [workflow.content, workflow.draft, workflow.hasDraft, isRunning]);
const handleBaseInfoFormFinish = async (values: Pick<WorkflowModel, "name" | "description">) => {
try {
@@ -141,11 +141,6 @@ const WorkflowDetail = () => {
};
const handleRunClick = () => {
if (!workflow.enabled) {
alert("TODO: 暂时只支持执行已启用的工作流");
return;
}
const { promise, resolve, reject } = Promise.withResolvers();
if (workflow.hasDraft) {
modalApi.confirm({