From bab75ade1e9af5e9d087066e8f2e49860f901e49 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 7 Apr 2022 15:09:53 +0100 Subject: [PATCH 1/2] Display correct selector label for JS Scripting --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 3d857ec9fb..a31e30487e 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -104,7 +104,10 @@ ) bindings = bindings.concat( outputs.map(([name, value]) => { - const runtime = idx === 0 ? `trigger.${name}` : `steps.${idx}.${name}` + const stepsLabel = block.name.toLowerCase().includes("bash") + ? `steps.${idx}.${name}` + : `steps[${idx - 1}].${name}` + const runtime = idx === 0 ? `trigger.${name}` : stepsLabel return { label: runtime, type: value.type, From 2694b32ac5afdd3131cf6c01a828f15402f10dd9 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 13 Apr 2022 13:27:17 +0100 Subject: [PATCH 2/2] Change to startsWith JS. Remove index decrement. --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index a31e30487e..53acb59cd9 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -104,9 +104,9 @@ ) bindings = bindings.concat( outputs.map(([name, value]) => { - const stepsLabel = block.name.toLowerCase().includes("bash") - ? `steps.${idx}.${name}` - : `steps[${idx - 1}].${name}` + const stepsLabel = block.name.startsWith("JS") + ? `steps[${idx}].${name}` + : `steps.${idx}.${name}` const runtime = idx === 0 ? `trigger.${name}` : stepsLabel return { label: runtime,