diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte
index f95de759c8..524e70e329 100644
--- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte
+++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte
@@ -9,6 +9,7 @@
Tags,
Tag,
} from "@budibase/bbui"
+ import { AutomationActionStepId } from "@budibase/types"
import { automationStore, selectedAutomation } from "stores/builder"
import { admin, licensing } from "stores/portal"
import { externalActions } from "./ExternalActions"
@@ -21,7 +22,12 @@
let triggerAutomationRunEnabled = $licensing.triggerAutomationRunEnabled
let collectBlockAllowedSteps = [TriggerStepID.APP, TriggerStepID.WEBHOOK]
let selectedAction
- let actions = Object.entries($automationStore.blockDefinitions.ACTION)
+ let actions = Object.entries($automationStore.blockDefinitions.ACTION).filter(
+ entry => {
+ const [key] = entry
+ return key !== AutomationActionStepId.BRANCH
+ }
+ )
let lockedFeatures = [
ActionStepID.COLLECT,
ActionStepID.TRIGGER_AUTOMATION_RUN,
diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte
index 117477cb24..d88ab0d28c 100644
--- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte
+++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte
@@ -45,12 +45,18 @@
let role
let blockEle
let positionStyles
+ let blockDims
+
+ const updateBlockDims = () => {
+ blockDims = blockEle?.getBoundingClientRect()
+ }
const loadSteps = blockRef => {
return blockRef
? automationStore.actions.getPathSteps(blockRef.pathTo, automation)
: []
}
+
$: pathSteps = loadSteps(blockRef)
$: collectBlockExists = pathSteps.some(
@@ -74,8 +80,12 @@
}
$: selected = $view?.moveStep && $view?.moveStep?.id === block.id
- $: blockDims = blockEle?.getBoundingClientRect()
- $: placeholderDims = buildPlaceholderStyles(blockDims)
+
+ $: {
+ selected, updateBlockDims()
+ }
+
+ $: placeholderDims = buildPlaceholderStyles(blockDims, selected)
// Move the selected item
// Listen for scrolling in the content. As its scrolled this will be updated
diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte
index 0a94e79aac..3e99786121 100644
--- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte
+++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte
@@ -21,6 +21,7 @@
let editing = false
const dispatch = createEventDispatcher()
+ $: blockRefs = $selectedAutomation.blockRefs || {}
$: stepNames = automation?.definition.stepNames
$: allSteps = automation?.definition.steps || []
$: automationName = itemName || stepNames?.[block.id] || block?.name || ""
@@ -37,11 +38,11 @@
}
}
- $: blockRef = $selectedAutomation.blockRefs[block.id]
+ $: blockRef = blockRefs[block.id]
$: isLooped = blockRef?.looped
async function onSelect(block) {
- await automationStore.update(state => {
+ automationStore.update(state => {
state.selectedBlock = block
return state
})
diff --git a/packages/builder/src/components/automation/AutomationBuilder/TestDisplay.svelte b/packages/builder/src/components/automation/AutomationBuilder/TestDisplay.svelte
index 91e7a07ed8..fd7961e3b0 100644
--- a/packages/builder/src/components/automation/AutomationBuilder/TestDisplay.svelte
+++ b/packages/builder/src/components/automation/AutomationBuilder/TestDisplay.svelte
@@ -3,10 +3,11 @@
import FlowItemHeader from "./FlowChart/FlowItemHeader.svelte"
import { ActionStepID } from "constants/backend/automations"
import { JsonView } from "@zerodevx/svelte-json-view"
- import { automationStore, selectedAutomation } from "stores/builder"
+ import { automationStore } from "stores/builder"
import { AutomationActionStepId } from "@budibase/types"
export let automation
+ export let automationBlockRefs = {}
export let testResults
let openBlocks = {}
@@ -39,18 +40,18 @@
$: filteredResults = prepTestResults(testResults)
$: {
if (testResults.message) {
- blocks = automation?.definition?.trigger
- ? [automation.definition.trigger]
- : []
+ const trigger = automation?.definition?.trigger
+ blocks = trigger ? [trigger] : []
} else if (automation) {
const terminatingStep = filteredResults.at(-1)
- const terminatingBlockRef =
- $selectedAutomation.blockRefs[terminatingStep.id]
- const pathSteps = automationStore.actions.getPathSteps(
- terminatingBlockRef.pathTo,
- automation
- )
- blocks = [...pathSteps].filter(x => x.stepId !== ActionStepID.LOOP)
+ const terminatingBlockRef = automationBlockRefs[terminatingStep.id]
+ if (terminatingBlockRef) {
+ const pathSteps = automationStore.actions.getPathSteps(
+ terminatingBlockRef.pathTo,
+ automation
+ )
+ blocks = [...pathSteps].filter(x => x.stepId !== ActionStepID.LOOP)
+ }
} else if (filteredResults) {
blocks = filteredResults || []
// make sure there is an ID for each block being displayed
diff --git a/packages/builder/src/components/automation/AutomationBuilder/TestPanel.svelte b/packages/builder/src/components/automation/AutomationBuilder/TestPanel.svelte
index a87350db75..d39d228717 100644
--- a/packages/builder/src/components/automation/AutomationBuilder/TestPanel.svelte
+++ b/packages/builder/src/components/automation/AutomationBuilder/TestPanel.svelte
@@ -1,7 +1,7 @@
@@ -24,7 +24,11 @@
-
+
diff --git a/packages/builder/src/stores/builder/automations.js b/packages/builder/src/stores/builder/automations.js
index 8eedb12734..4a4ba0bad8 100644
--- a/packages/builder/src/stores/builder/automations.js
+++ b/packages/builder/src/stores/builder/automations.js
@@ -559,13 +559,6 @@ const automationActions = store => ({
: pathBlock.icon
if (blockIdx === 0 && isTrigger) {
- schema = Object.fromEntries(
- Object.keys(pathBlock.inputs.fields || []).map(key => [
- key,
- { type: pathBlock.inputs.fields[key] },
- ])
- )
-
if (
pathBlock.event === AutomationEventType.ROW_UPDATE ||
pathBlock.event === AutomationEventType.ROW_SAVE
@@ -582,6 +575,13 @@ const automationActions = store => ({
}
// remove the original binding
delete schema.row
+ } else if (pathBlock.event === AutomationEventType.APP_TRIGGER) {
+ schema = Object.fromEntries(
+ Object.keys(pathBlock.inputs.fields || []).map(key => [
+ key,
+ { type: pathBlock.inputs.fields[key] },
+ ])
+ )
}
}