Merge pull request #14198 from Budibase/BUDI-8452/remove-unnecessary-save-button
Remove unnecessary save button for automation steps
This commit is contained in:
commit
a62d71ec94
|
@ -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>
|
||||
|
|
|
@ -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%">
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue