From f779117ed6a7b82d63972ed15b75a97a637b269e Mon Sep 17 00:00:00 2001 From: "Yoan.liu" Date: Sun, 9 Mar 2025 12:23:14 +0800 Subject: [PATCH] fix the issue where the deployment node could not set the certificate source. --- ui/src/domain/workflow.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/src/domain/workflow.ts b/ui/src/domain/workflow.ts index 8886dee4..1a5f7278 100644 --- a/ui/src/domain/workflow.ts +++ b/ui/src/domain/workflow.ts @@ -436,11 +436,6 @@ export const getOutputBeforeNodeId = (root: WorkflowNode, nodeId: string, type: return true; } - // 如果当前节点是 ExecuteFailure,清除 ExecuteResultBranch 节点前一个节点的输出 - if (current.type === WorkflowNodeType.ExecuteFailure) { - output.splice(output.length - 1); - } - if (current.type !== WorkflowNodeType.Branch && current.outputs && current.outputs.some((io) => io.type === type)) { output.push({ ...current, @@ -449,8 +444,13 @@ export const getOutputBeforeNodeId = (root: WorkflowNode, nodeId: string, type: } if (isBranchLike(current)) { - const currentLength = output.length; + let currentLength = output.length; + const latestOutput = output.length > 0 ? output[output.length - 1] : null; for (const branch of current.branches!) { + if (branch.type === WorkflowNodeType.ExecuteFailure) { + output.splice(output.length - 1); + currentLength -= 1; + } if (traverse(branch, output)) { return true; } @@ -458,6 +458,9 @@ export const getOutputBeforeNodeId = (root: WorkflowNode, nodeId: string, type: if (output.length > currentLength) { output.splice(currentLength); } + if (latestOutput && branch.type === WorkflowNodeType.ExecuteFailure) { + output.push(latestOutput); + } } }