From dcfb65b92d6116e9ca9fd36c3ce551fcc08b69e1 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 12 May 2023 15:56:24 +0100 Subject: [PATCH] sync / async automations go through one endpoint --- .../actions/TriggerAutomation.svelte | 21 ++++++++ packages/client/src/utils/buttonActions.js | 27 +++++----- packages/frontend-core/src/api/automations.js | 11 +---- .../server/src/api/controllers/automation.ts | 49 ++++++++++--------- packages/server/src/api/routes/automation.ts | 11 ----- packages/server/src/automations/triggers.ts | 4 +- packages/server/src/automations/utils.ts | 7 ++- 7 files changed, 68 insertions(+), 62 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/TriggerAutomation.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/TriggerAutomation.svelte index aa617ab9a3..ecbb5a9a31 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/TriggerAutomation.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/TriggerAutomation.svelte @@ -23,6 +23,12 @@ if (automationStatus === AUTOMATION_STATUS.NEW) { synchronous = false } + + if (automationStatus === AUTOMATION_STATUS.EXISTING) { + synchronous = automations.find( + automation => automation._id === parameters.automationId + ).synchronous + } } $: automations = $automationStore.automations .filter(a => a.definition.trigger?.stepId === TriggerStepID.APP) @@ -79,6 +85,8 @@ parameters.automationId = automationId parameters.synchronous = synchronous } + + $: error = parameters.timeout > 120 ? "Timeout must be less than 120s" : null
@@ -133,6 +141,16 @@ >
+