diff --git a/packages/builder/src/builderStore/store/automation/index.js b/packages/builder/src/builderStore/store/automation/index.js index 66715faf3a..f60e10e50b 100644 --- a/packages/builder/src/builderStore/store/automation/index.js +++ b/packages/builder/src/builderStore/store/automation/index.js @@ -221,7 +221,7 @@ const automationActions = store => ({ newAutomation.definition.steps.splice(blockIdx, 0, block) await store.actions.save(newAutomation) }, - saveAutomationName: async (stepId, name) => { + saveAutomationName: async (blockId, name) => { const automation = get(selectedAutomation) let newAutomation = cloneDeep(automation) if (!automation) { @@ -229,18 +229,18 @@ const automationActions = store => ({ } newAutomation.definition.stepNames = { ...newAutomation.definition.stepNames, - [stepId]: name.trim(), + [blockId]: name.trim(), } await store.actions.save(newAutomation) }, - deleteAutomationName: async stepId => { + deleteAutomationName: async blockId => { const automation = get(selectedAutomation) let newAutomation = cloneDeep(automation) if (!automation) { return } - delete newAutomation.definition.stepNames[stepId] + delete newAutomation.definition.stepNames[blockId] await store.actions.save(newAutomation) }, @@ -257,6 +257,7 @@ const automationActions = store => ({ newAutomation.definition.steps = newAutomation.definition.steps.filter( step => step.id !== block.id ) + delete newAutomation.definition.stepNames[block.id] } await store.actions.save(newAutomation) }, diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index de3a66e216..d38cda8de1 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -194,6 +194,9 @@ bindingIcon = allSteps[idx].icon bindingRank = idx - loopBlockCount } + let bindingName = + automation.stepNames?.[allSteps[bindingRank - loopBlockCount].id] + bindings = bindings.concat( outputs.map(([name, value]) => { let runtimeName = isLoopBlock @@ -203,9 +206,6 @@ : `steps.${idx - loopBlockCount}.${name}` const runtime = idx === 0 ? `trigger.${name}` : runtimeName - let bindingName = - automation.stepNames?.[allSteps[bindingRank - loopBlockCount].id] - let categoryName if (idx === 0) { categoryName = "Trigger outputs" @@ -218,7 +218,7 @@ } return { - readableBinding: runtime, + readableBinding: bindingName ? `${bindingName}.${name}` : runtime, runtimeBinding: runtime, type: value.type, description: value.description,