1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

Remove save button on add action step

This commit is contained in:
Adria Navarro 2024-07-18 11:05:02 +02:00
parent 57dbe3141f
commit 19d614b329
2 changed files with 8 additions and 10 deletions

View file

@ -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 @@
<!-- svelte-ignore a11y-no-static-element-interactions -->
<ModalContent
title="Add automation step"
confirmText="Save"
size="L"
showConfirmButton={false}
showCancelButton={false}
disabled={!selectedAction}
onConfirm={addBlockToAutomation}
>
<Layout noPadding gap="XS">
<Detail size="S">Apps</Detail>

View file

@ -206,7 +206,7 @@
{/if}
<Modal bind:this={actionModal} width="30%">
<ActionModal {lastStep} {blockIdx} />
<ActionModal modal={actionModal} {lastStep} {blockIdx} />
</Modal>
<Modal bind:this={webhookModal} width="30%">