From dfbf7e2ee4c7b4a29bf599595757d76955806249 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 14 Sep 2021 14:39:45 +0100 Subject: [PATCH] Show test outputs and responses in modal --- packages/bbui/src/Modal/ModalContent.svelte | 7 +++ .../builderStore/store/automation/index.js | 7 ++- .../FlowChart/FlowChart.svelte | 13 +++- .../FlowChart/FlowItem.svelte | 23 +++++-- .../FlowChart/ResultsModal.svelte | 60 +++++++++++++------ .../FlowChart/TestDataModal.svelte | 8 +-- .../SetupPanel/AutomationBlockSetup.svelte | 1 - 7 files changed, 86 insertions(+), 33 deletions(-) diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte index bba72e6093..678a813a61 100644 --- a/packages/bbui/src/Modal/ModalContent.svelte +++ b/packages/bbui/src/Modal/ModalContent.svelte @@ -46,8 +46,10 @@

{title} +

{#if showDivider} @@ -120,4 +122,9 @@ .close-icon :global(svg) { margin-right: 0; } + + .header-spacing { + display: flex; + justify-content: space-between; + } diff --git a/packages/builder/src/builderStore/store/automation/index.js b/packages/builder/src/builderStore/store/automation/index.js index 36198821de..156dbfba11 100644 --- a/packages/builder/src/builderStore/store/automation/index.js +++ b/packages/builder/src/builderStore/store/automation/index.js @@ -82,7 +82,12 @@ const automationActions = store => ({ }, test: async ({ automation }, testData) => { const { _id } = automation - return await api.post(`/api/automations/${_id}/test`, testData) + const response = await api.post(`/api/automations/${_id}/test`, testData) + const json = await response.json() + store.update(state => { + state.testResults = json + return state + }) }, select: automation => { store.update(state => { diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte index b87f1009b7..e41ef5a634 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte @@ -4,7 +4,6 @@ import FlowItem from "./FlowItem.svelte" import TestDataModal from "./TestDataModal.svelte" - import Arrow from "./Arrow.svelte" import { flip } from "svelte/animate" import { fade, fly } from "svelte/transition" import { @@ -86,7 +85,9 @@ > {#if idx !== blocks.length - 1} - +
+ +
{/if}
{/each} @@ -97,6 +98,14 @@