From 48f13af109d17ade60f5d7a0ad316b29d1af9f08 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 17 Sep 2020 14:04:45 +0100 Subject: [PATCH] Block deletion of workflow trigger unless it's the only step left --- .../workflow/SetupPanel/SetupPanel.svelte | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/workflow/SetupPanel/SetupPanel.svelte b/packages/builder/src/components/workflow/SetupPanel/SetupPanel.svelte index e7419a05df..b309f72c2c 100644 --- a/packages/builder/src/components/workflow/SetupPanel/SetupPanel.svelte +++ b/packages/builder/src/components/workflow/SetupPanel/SetupPanel.svelte @@ -10,8 +10,10 @@ let selectedTab = "SETUP" - $: workflow = - $workflowStore.selectedWorkflow && $workflowStore.selectedWorkflow.workflow + $: workflow = $workflowStore.selectedWorkflow?.workflow + $: allowDeleteBlock = + $workflowStore.selectedBlock?.type !== "TRIGGER" || + !workflow?.definition?.steps?.length function deleteWorkflow() { open( @@ -60,7 +62,13 @@ - + {:else if $workflowStore.selectedWorkflow}