From 38780dba0542242455c00d12b816051b6cd9784c Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Tue, 5 Nov 2024 04:26:42 -0800 Subject: [PATCH] Fix block label update source parameter keys issue (#1135) --- .../routes/workflows/editor/workflowEditorUtils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts index 828b12af..fad6c3fc 100644 --- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts +++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts @@ -744,7 +744,7 @@ function getUpdatedNodesAfterLabelUpdateForParameterKeys( } const oldLabel = labelUpdatedNode.data.label as string; return nodes.map((node) => { - if (node.type === "nodeAdder") { + if (node.type === "nodeAdder" || node.type === "start") { return node; } if (node.type === "task") { @@ -798,13 +798,13 @@ function getUpdatedParametersAfterLabelUpdateForSourceParameterKey( const oldOutputParameterKey = getOutputParameterKey(oldLabel); const newOutputParameterKey = getOutputParameterKey(newLabel); return parameters.map((parameter) => { - if (parameter.parameterType === "context") { + if ( + parameter.parameterType === "context" && + parameter.sourceParameterKey === oldOutputParameterKey + ) { return { ...parameter, - sourceParameterKey: - parameter.sourceParameterKey === oldOutputParameterKey - ? newOutputParameterKey - : oldOutputParameterKey, + sourceParameterKey: newOutputParameterKey, }; } return parameter;