1
0
Fork 0
mirror of synced 2024-07-01 12:30:41 +12:00

Automation fixes

This commit is contained in:
Peter Clement 2022-09-23 13:35:27 +01:00
parent caab57f585
commit 334ac0d512
4 changed files with 12 additions and 7 deletions

View file

@ -113,8 +113,9 @@
// Extract all outputs from all previous steps as available bindins // Extract all outputs from all previous steps as available bindins
let bindings = [] let bindings = []
let loopBlockCount = 0
for (let idx = 0; idx < blockIdx; idx++) { for (let idx = 0; idx < blockIdx; idx++) {
let wasLoopBlock = allSteps[idx]?.stepId === ActionStepID.LOOP let wasLoopBlock = allSteps[idx - 1]?.stepId === ActionStepID.LOOP
let isLoopBlock = let isLoopBlock =
allSteps[idx]?.stepId === ActionStepID.LOOP && allSteps[idx]?.stepId === ActionStepID.LOOP &&
allSteps.find(x => x.blockToLoop === block.id) allSteps.find(x => x.blockToLoop === block.id)
@ -122,7 +123,8 @@
// If the previous block was a loop block, decerement the index so the following // If the previous block was a loop block, decerement the index so the following
// steps are in the correct order // steps are in the correct order
if (wasLoopBlock) { if (wasLoopBlock) {
blockIdx-- loopBlockCount++
continue
} }
let schema = allSteps[idx]?.schema?.outputs?.properties ?? {} let schema = allSteps[idx]?.schema?.outputs?.properties ?? {}
@ -143,8 +145,8 @@
let runtimeName = isLoopBlock let runtimeName = isLoopBlock
? `loop.${name}` ? `loop.${name}`
: block.name.startsWith("JS") : block.name.startsWith("JS")
? `steps[${idx}].${name}` ? `steps[${idx - loopBlockCount}].${name}`
: `steps.${idx}.${name}` : `steps.${idx - loopBlockCount}.${name}`
const runtime = idx === 0 ? `trigger.${name}` : runtimeName const runtime = idx === 0 ? `trigger.${name}` : runtimeName
return { return {
label: runtime, label: runtime,
@ -155,7 +157,7 @@
? "Trigger outputs" ? "Trigger outputs"
: isLoopBlock : isLoopBlock
? "Loop Outputs" ? "Loop Outputs"
: `Step ${idx} outputs`, : `Step ${idx - loopBlockCount} outputs`,
path: runtime, path: runtime,
} }
}) })
@ -229,6 +231,7 @@
{bindings} {bindings}
{schemaFields} {schemaFields}
panel={AutomationBindingPanel} panel={AutomationBindingPanel}
fillWidth
/> />
</Drawer> </Drawer>
{:else if value.customType === "password"} {:else if value.customType === "password"}

View file

@ -247,7 +247,7 @@
return return
} }
hoverTarget = { hoverTarget = {
title: binding.display.name || binding.fieldSchema.name, title: binding.display?.name || binding.fieldSchema.name,
description: binding.description, description: binding.description,
} }
popover.show() popover.show()

View file

@ -27,6 +27,7 @@
export let panel = ClientBindingPanel export let panel = ClientBindingPanel
export let allowBindings = true export let allowBindings = true
export let allOr = false export let allOr = false
export let fillWidth = false
$: dispatch("change", filters) $: dispatch("change", filters)
$: enrichedSchemaFields = getFields(schemaFields || []) $: enrichedSchemaFields = getFields(schemaFields || [])
@ -177,6 +178,7 @@
{panel} {panel}
{bindings} {bindings}
on:change={event => (filter.value = event.detail)} on:change={event => (filter.value = event.detail)}
{fillWidth}
/> />
{:else if ["string", "longform", "number", "formula"].includes(filter.type)} {:else if ["string", "longform", "number", "formula"].includes(filter.type)}
<Input disabled={filter.noValue} bind:value={filter.value} /> <Input disabled={filter.noValue} bind:value={filter.value} />

View file

@ -80,7 +80,7 @@ exports.definition = {
}, },
success: { success: {
type: "boolean", type: "boolean",
description: "Whether the deletion was successful", description: "Whether the query was successful",
}, },
}, },
required: ["rows", "success"], required: ["rows", "success"],