diff --git a/packages/builder/cypress/integration/createAutomation.spec.js b/packages/builder/cypress/integration/createAutomation.spec.js index 0620a15e25..afd405d5ab 100644 --- a/packages/builder/cypress/integration/createAutomation.spec.js +++ b/packages/builder/cypress/integration/createAutomation.spec.js @@ -22,9 +22,9 @@ context("Create a automation", () => { cy.get(".spectrum-Picker-label").click() cy.wait(500) cy.contains("dog").click() - + cy.wait(2000) // Create action - cy.contains("Add Action").click() + cy.get(".block > .spectrum-Icon").click() cy.get(".modal-inner-wrapper").within(() => { cy.wait(1000) cy.contains("Create Row").trigger('mouseover').click().click() diff --git a/packages/builder/src/builderStore/store/automation/index.js b/packages/builder/src/builderStore/store/automation/index.js index 16cc490bb2..7bd0ccca22 100644 --- a/packages/builder/src/builderStore/store/automation/index.js +++ b/packages/builder/src/builderStore/store/automation/index.js @@ -93,7 +93,9 @@ const automationActions = store => ({ }, select: automation => { store.update(state => { + let testResults = state.selectedAutomation?.testResults state.selectedAutomation = new Automation(cloneDeep(automation)) + state.selectedAutomation.testResults = testResults state.selectedBlock = null return state }) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte index fee8afd711..2d6881d652 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte @@ -84,7 +84,6 @@ class="block" animate:flip={{ duration: 500 }} in:fly|local={{ x: 500, duration: 1500 }} - out:fly|local={{ x: 500, duration: 800 }} > diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 7ddc5c3e48..7f379ba138 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -25,10 +25,10 @@ let resultsModal let setupToggled let blockComplete + $: testResult = $automationStore.selectedAutomation.testResults?.steps.filter( step => step.stepId === block.stepId ) - $: isTrigger = block.type === "TRIGGER" $: selected = $automationStore.selectedBlock?.id === block.id @@ -150,15 +150,6 @@ >Finish and test automation {/if} - {/if} diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationList.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationList.svelte index 79de4bfbe6..aa3ab027a8 100644 --- a/packages/builder/src/components/automation/AutomationPanel/AutomationList.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationList.svelte @@ -9,6 +9,7 @@ onMount(() => { automationStore.actions.fetch() }) + function selectAutomation(automation) { automationStore.actions.select(automation) $goto(`./${automation._id}`) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 874a0e68eb..e7208518d5 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -51,31 +51,31 @@ : { schema: {} } $: schemaFields = table ? Object.values(table.schema) : [] - const onChange = debounce( - async function (e, key) { - if (isTestModal) { - // Special case for webhook, as it requires a body, but the schema already brings back the body's contents - if (stepId === "WEBHOOK") { - automationStore.actions.addTestDataToAutomation({ - body: { - [key]: e.detail, - ...$automationStore.selectedAutomation.automation.testData.body, - }, - }) - } + const onChange = debounce(async function (e, key) { + if (isTestModal) { + // Special case for webhook, as it requires a body, but the schema already brings back the body's contents + if (stepId === "WEBHOOK") { automationStore.actions.addTestDataToAutomation({ - [key]: e.detail, + body: { + [key]: e.detail, + ...$automationStore.selectedAutomation.automation.testData.body, + }, }) - testData[key] = e.detail - } else { - block.inputs[key] = e.detail - await automationStore.actions.save( - $automationStore.selectedAutomation?.automation - ) } - }, - isTestModal ? 0 : 800 - ) + automationStore.actions.addTestDataToAutomation({ + [key]: e.detail, + }) + testData[key] = e.detail + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) + } else { + block.inputs[key] = e.detail + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) + } + }, 800) function getAvailableBindings(block, automation) { if (!block || !automation) { diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 6d8c5811ec..0211a37557 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -72,15 +72,17 @@ } - -
- -
- Edit - {#if allowDeletion} +{#if allowDeletion} + +
+ +
+ {#if !external} + Edit + {/if} Delete - {/if} -
+
+{/if}