1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

fix issue with readable bindings not displayinng correctly

This commit is contained in:
Peter Clement 2023-10-27 09:13:27 +01:00
parent 6ba9e68e64
commit 89a242f354
2 changed files with 9 additions and 8 deletions

View file

@ -221,7 +221,7 @@ const automationActions = store => ({
newAutomation.definition.steps.splice(blockIdx, 0, block) newAutomation.definition.steps.splice(blockIdx, 0, block)
await store.actions.save(newAutomation) await store.actions.save(newAutomation)
}, },
saveAutomationName: async (stepId, name) => { saveAutomationName: async (blockId, name) => {
const automation = get(selectedAutomation) const automation = get(selectedAutomation)
let newAutomation = cloneDeep(automation) let newAutomation = cloneDeep(automation)
if (!automation) { if (!automation) {
@ -229,18 +229,18 @@ const automationActions = store => ({
} }
newAutomation.definition.stepNames = { newAutomation.definition.stepNames = {
...newAutomation.definition.stepNames, ...newAutomation.definition.stepNames,
[stepId]: name.trim(), [blockId]: name.trim(),
} }
await store.actions.save(newAutomation) await store.actions.save(newAutomation)
}, },
deleteAutomationName: async stepId => { deleteAutomationName: async blockId => {
const automation = get(selectedAutomation) const automation = get(selectedAutomation)
let newAutomation = cloneDeep(automation) let newAutomation = cloneDeep(automation)
if (!automation) { if (!automation) {
return return
} }
delete newAutomation.definition.stepNames[stepId] delete newAutomation.definition.stepNames[blockId]
await store.actions.save(newAutomation) await store.actions.save(newAutomation)
}, },
@ -257,6 +257,7 @@ const automationActions = store => ({
newAutomation.definition.steps = newAutomation.definition.steps.filter( newAutomation.definition.steps = newAutomation.definition.steps.filter(
step => step.id !== block.id step => step.id !== block.id
) )
delete newAutomation.definition.stepNames[block.id]
} }
await store.actions.save(newAutomation) await store.actions.save(newAutomation)
}, },

View file

@ -194,6 +194,9 @@
bindingIcon = allSteps[idx].icon bindingIcon = allSteps[idx].icon
bindingRank = idx - loopBlockCount bindingRank = idx - loopBlockCount
} }
let bindingName =
automation.stepNames?.[allSteps[bindingRank - loopBlockCount].id]
bindings = bindings.concat( bindings = bindings.concat(
outputs.map(([name, value]) => { outputs.map(([name, value]) => {
let runtimeName = isLoopBlock let runtimeName = isLoopBlock
@ -203,9 +206,6 @@
: `steps.${idx - loopBlockCount}.${name}` : `steps.${idx - loopBlockCount}.${name}`
const runtime = idx === 0 ? `trigger.${name}` : runtimeName const runtime = idx === 0 ? `trigger.${name}` : runtimeName
let bindingName =
automation.stepNames?.[allSteps[bindingRank - loopBlockCount].id]
let categoryName let categoryName
if (idx === 0) { if (idx === 0) {
categoryName = "Trigger outputs" categoryName = "Trigger outputs"
@ -218,7 +218,7 @@
} }
return { return {
readableBinding: runtime, readableBinding: bindingName ? `${bindingName}.${name}` : runtime,
runtimeBinding: runtime, runtimeBinding: runtime,
type: value.type, type: value.type,
description: value.description, description: value.description,