diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte index ccb1369c57..9899c454fc 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte @@ -17,12 +17,12 @@ export let blockIdx export let lastStep + export let modal let syncAutomationsEnabled = $licensing.syncAutomationsEnabled let triggerAutomationRunEnabled = $licensing.triggerAutomationRunEnabled let collectBlockAllowedSteps = [TriggerStepID.APP, TriggerStepID.WEBHOOK] let selectedAction - let actionVal let actions = Object.entries($automationStore.blockDefinitions.ACTION) let lockedFeatures = [ ActionStepID.COLLECT, @@ -91,19 +91,17 @@ return acc }, {}) - const selectAction = action => { - actionVal = action + const selectAction = async action => { selectedAction = action.name - } - async function addBlockToAutomation() { try { const newBlock = automationStore.actions.constructBlock( "ACTION", - actionVal.stepId, - actionVal + action.stepId, + action ) await automationStore.actions.addBlockToAutomation(newBlock, blockIdx + 1) + modal.hide() } catch (error) { notifications.error("Error saving automation") } @@ -114,10 +112,10 @@ Apps diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 48b630cb62..811909845a 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -206,7 +206,7 @@ {/if} - + diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte index 7d223299c7..2a553f8b48 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte @@ -81,7 +81,7 @@ // Check the schema to see if required fields have been entered $: isError = !isTriggerValid(trigger) || - !trigger.schema.outputs.required.every( + !trigger.schema.outputs.required?.every( required => $memoTestData?.[required] || required !== "row" )