From ab2fd51dc2aea84e74914992e116fa3cbc016ed0 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 16 Sep 2021 14:48:55 +0100 Subject: [PATCH 1/2] fix debounce / store test data bug --- packages/bbui/src/Drawer/Drawer.svelte | 2 +- .../FlowChart/FlowChart.svelte | 5 +-- .../FlowChart/TestDataModal.svelte | 3 +- .../SetupPanel/AutomationBlockSetup.svelte | 34 +++++++++++-------- .../SetupPanel/QueryParamSelector.svelte | 1 + .../automation/SetupPanel/RowSelector.svelte | 1 + .../bindings/DrawerBindableInput.svelte | 2 +- .../app/[application]/automate/_layout.svelte | 6 ++-- 8 files changed, 32 insertions(+), 22 deletions(-) diff --git a/packages/bbui/src/Drawer/Drawer.svelte b/packages/bbui/src/Drawer/Drawer.svelte index 67252f72b6..277b840db6 100644 --- a/packages/bbui/src/Drawer/Drawer.svelte +++ b/packages/bbui/src/Drawer/Drawer.svelte @@ -8,7 +8,7 @@ export let title export let fillWidth let visible = false - + $: console.log(fillWidth) export function show() { if (visible) { return diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte index c969ef823d..53a5de3b51 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte @@ -19,7 +19,6 @@ export let onSelect let testDataModal let blocks - $: instanceId = $database._id $: { @@ -69,7 +68,9 @@ testDataModal.show()} + on:click={() => { + testDataModal.show() + }} icon="MultipleCheck" size="S">Run test diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte index 14ed1ef378..cce9c14a23 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte @@ -19,11 +19,11 @@ // check to see if there is existing test data in the store let testData = $automationStore.selectedAutomation.automation.testData - // Check the schema to see if required fields have been entered $: isError = !trigger.schema.outputs.required.every( required => testData[required] ) + function parseTestJSON(e) { try { const obj = JSON.parse(e.detail) @@ -52,6 +52,7 @@ {:else if value.customType === "email"} - {#if testData} + {#if isTestModal} onChange(e, key)} {bindings} + fillWidth /> {:else} {:else if value.type === "string" || value.type === "number"} - {#if testData} + {#if isTestModal} {/each} diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte index 57778cfe20..3f390e0a4f 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte @@ -69,6 +69,7 @@ label={field} type="string" {bindings} + fillWidth={true} /> {/if} {/if} diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index 502b56c4d4..e5bfab583c 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -14,7 +14,7 @@ export let placeholder export let label export let disabled = false - export let fillWidth = false + export let fillWidth const dispatch = createEventDispatcher() let bindingDrawer diff --git a/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte index 22a49e04d2..841acb22c0 100644 --- a/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte @@ -29,9 +29,9 @@ > - You have no automations - Let's fix that. Call the bots! - From 0d2854b464844f6909b70df9dff484a1e1e39533 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 16 Sep 2021 14:52:23 +0100 Subject: [PATCH 2/2] fix json parsing of test data --- .../automation/AutomationBuilder/FlowChart/TestDataModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte index cce9c14a23..d05c8fa326 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte @@ -18,7 +18,7 @@ // get the outputs so we can define the fields // check to see if there is existing test data in the store - let testData = $automationStore.selectedAutomation.automation.testData + $: testData = $automationStore.selectedAutomation.automation.testData // Check the schema to see if required fields have been entered $: isError = !trigger.schema.outputs.required.every( required => testData[required]