Remove save button on add action step
This commit is contained in:
parent
57dbe3141f
commit
19d614b329
|
@ -17,12 +17,12 @@
|
||||||
|
|
||||||
export let blockIdx
|
export let blockIdx
|
||||||
export let lastStep
|
export let lastStep
|
||||||
|
export let modal
|
||||||
|
|
||||||
let syncAutomationsEnabled = $licensing.syncAutomationsEnabled
|
let syncAutomationsEnabled = $licensing.syncAutomationsEnabled
|
||||||
let triggerAutomationRunEnabled = $licensing.triggerAutomationRunEnabled
|
let triggerAutomationRunEnabled = $licensing.triggerAutomationRunEnabled
|
||||||
let collectBlockAllowedSteps = [TriggerStepID.APP, TriggerStepID.WEBHOOK]
|
let collectBlockAllowedSteps = [TriggerStepID.APP, TriggerStepID.WEBHOOK]
|
||||||
let selectedAction
|
let selectedAction
|
||||||
let actionVal
|
|
||||||
let actions = Object.entries($automationStore.blockDefinitions.ACTION)
|
let actions = Object.entries($automationStore.blockDefinitions.ACTION)
|
||||||
let lockedFeatures = [
|
let lockedFeatures = [
|
||||||
ActionStepID.COLLECT,
|
ActionStepID.COLLECT,
|
||||||
|
@ -91,19 +91,17 @@
|
||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
const selectAction = action => {
|
const selectAction = async action => {
|
||||||
actionVal = action
|
|
||||||
selectedAction = action.name
|
selectedAction = action.name
|
||||||
}
|
|
||||||
|
|
||||||
async function addBlockToAutomation() {
|
|
||||||
try {
|
try {
|
||||||
const newBlock = automationStore.actions.constructBlock(
|
const newBlock = automationStore.actions.constructBlock(
|
||||||
"ACTION",
|
"ACTION",
|
||||||
actionVal.stepId,
|
action.stepId,
|
||||||
actionVal
|
action
|
||||||
)
|
)
|
||||||
await automationStore.actions.addBlockToAutomation(newBlock, blockIdx + 1)
|
await automationStore.actions.addBlockToAutomation(newBlock, blockIdx + 1)
|
||||||
|
modal.hide()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Error saving automation")
|
notifications.error("Error saving automation")
|
||||||
}
|
}
|
||||||
|
@ -114,10 +112,10 @@
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||||
<ModalContent
|
<ModalContent
|
||||||
title="Add automation step"
|
title="Add automation step"
|
||||||
confirmText="Save"
|
|
||||||
size="L"
|
size="L"
|
||||||
|
showConfirmButton={false}
|
||||||
|
showCancelButton={false}
|
||||||
disabled={!selectedAction}
|
disabled={!selectedAction}
|
||||||
onConfirm={addBlockToAutomation}
|
|
||||||
>
|
>
|
||||||
<Layout noPadding gap="XS">
|
<Layout noPadding gap="XS">
|
||||||
<Detail size="S">Apps</Detail>
|
<Detail size="S">Apps</Detail>
|
||||||
|
|
|
@ -206,7 +206,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<Modal bind:this={actionModal} width="30%">
|
<Modal bind:this={actionModal} width="30%">
|
||||||
<ActionModal {lastStep} {blockIdx} />
|
<ActionModal modal={actionModal} {lastStep} {blockIdx} />
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal bind:this={webhookModal} width="30%">
|
<Modal bind:this={webhookModal} width="30%">
|
||||||
|
|
Loading…
Reference in New Issue