update bindings to use names
This commit is contained in:
parent
a209280daa
commit
aad6ab4fb4
|
@ -183,20 +183,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const outputs = Object.entries(schema)
|
const outputs = Object.entries(schema)
|
||||||
|
|
||||||
let bindingIcon = ""
|
let bindingIcon = ""
|
||||||
let bindindingRank = 0
|
let bindingRank = 0
|
||||||
|
|
||||||
if (idx === 0) {
|
if (idx === 0) {
|
||||||
bindingIcon = automation.trigger.icon
|
bindingIcon = automation.trigger.icon
|
||||||
} else if (isLoopBlock) {
|
} else if (isLoopBlock) {
|
||||||
bindingIcon = "Reuse"
|
bindingIcon = "Reuse"
|
||||||
bindindingRank = idx + 1
|
bindingRank = idx + 1
|
||||||
} else {
|
} else {
|
||||||
bindingIcon = allSteps[idx].icon
|
bindingIcon = allSteps[idx].icon
|
||||||
bindindingRank = idx - loopBlockCount
|
bindingRank = idx - loopBlockCount
|
||||||
}
|
}
|
||||||
|
|
||||||
bindings = bindings.concat(
|
bindings = bindings.concat(
|
||||||
outputs.map(([name, value]) => {
|
outputs.map(([name, value]) => {
|
||||||
let runtimeName = isLoopBlock
|
let runtimeName = isLoopBlock
|
||||||
|
@ -205,12 +202,21 @@
|
||||||
? `steps[${idx - loopBlockCount}].${name}`
|
? `steps[${idx - loopBlockCount}].${name}`
|
||||||
: `steps.${idx - loopBlockCount}.${name}`
|
: `steps.${idx - loopBlockCount}.${name}`
|
||||||
const runtime = idx === 0 ? `trigger.${name}` : runtimeName
|
const runtime = idx === 0 ? `trigger.${name}` : runtimeName
|
||||||
const categoryName =
|
|
||||||
idx === 0
|
let bindingName =
|
||||||
? "Trigger outputs"
|
automation.stepNames[allSteps[bindingRank - loopBlockCount].id]
|
||||||
: isLoopBlock
|
|
||||||
? "Loop Outputs"
|
let categoryName
|
||||||
: `Step ${idx - loopBlockCount} outputs`
|
if (idx === 0) {
|
||||||
|
categoryName = "Trigger outputs"
|
||||||
|
} else if (isLoopBlock) {
|
||||||
|
categoryName = "Loop Outputs"
|
||||||
|
} else if (bindingName) {
|
||||||
|
categoryName = `${bindingName} outputs`
|
||||||
|
} else {
|
||||||
|
categoryName = `Step ${idx - loopBlockCount} outputs`
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
readableBinding: runtime,
|
readableBinding: runtime,
|
||||||
runtimeBinding: runtime,
|
runtimeBinding: runtime,
|
||||||
|
@ -221,7 +227,7 @@
|
||||||
display: {
|
display: {
|
||||||
type: value.type,
|
type: value.type,
|
||||||
name: name,
|
name: name,
|
||||||
rank: bindindingRank,
|
rank: bindingRank,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue