From f9c616e3e8850ef46236e11d88ad9a0645d1799c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 17 Sep 2020 15:07:32 +0100 Subject: [PATCH] Add labels to workflow blocks --- .../WorkflowBuilder/flowchart/FlowItem.svelte | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/components/workflow/WorkflowBuilder/flowchart/FlowItem.svelte b/packages/builder/src/components/workflow/WorkflowBuilder/flowchart/FlowItem.svelte index b88ab36c54..ceed34924f 100644 --- a/packages/builder/src/components/workflow/WorkflowBuilder/flowchart/FlowItem.svelte +++ b/packages/builder/src/components/workflow/WorkflowBuilder/flowchart/FlowItem.svelte @@ -6,9 +6,9 @@ export let block let selected - $: selected = - $workflowStore.selectedBlock != null && - $workflowStore.selectedBlock.id === block.id + $: selected = $workflowStore.selectedBlock?.id === block.id + $: steps = $workflowStore.selectedWorkflow?.workflow?.definition?.steps ?? [] + $: blockIdx = steps.findIndex(step => step.id === block.id) function selectBlock() { onSelect(block) @@ -31,18 +31,24 @@ .replaceAll("}}", "}}") -
+
{#if block.type === 'TRIGGER'} - When this happens... + When this happens... {:else if block.type === 'ACTION'} - Do this... + Do this... {:else if block.type === 'LOGIC'} - Only continue if... + Only continue if... {/if} +
+ {#if block.type === 'TRIGGER'}Trigger{:else}Step {blockIdx + 1}{/if} +

@@ -51,7 +57,7 @@