Block deletion of workflow trigger unless it's the only step left
This commit is contained in:
parent
d31f4f5c34
commit
48f13af109
|
@ -10,8 +10,10 @@
|
||||||
|
|
||||||
let selectedTab = "SETUP"
|
let selectedTab = "SETUP"
|
||||||
|
|
||||||
$: workflow =
|
$: workflow = $workflowStore.selectedWorkflow?.workflow
|
||||||
$workflowStore.selectedWorkflow && $workflowStore.selectedWorkflow.workflow
|
$: allowDeleteBlock =
|
||||||
|
$workflowStore.selectedBlock?.type !== "TRIGGER" ||
|
||||||
|
!workflow?.definition?.steps?.length
|
||||||
|
|
||||||
function deleteWorkflow() {
|
function deleteWorkflow() {
|
||||||
open(
|
open(
|
||||||
|
@ -60,7 +62,13 @@
|
||||||
<Button green wide data-cy="save-workflow-setup" on:click={saveWorkflow}>
|
<Button green wide data-cy="save-workflow-setup" on:click={saveWorkflow}>
|
||||||
Save Workflow
|
Save Workflow
|
||||||
</Button>
|
</Button>
|
||||||
<Button red wide on:click={deleteWorkflowBlock}>Delete Block</Button>
|
<Button
|
||||||
|
disabled={!allowDeleteBlock}
|
||||||
|
red
|
||||||
|
wide
|
||||||
|
on:click={deleteWorkflowBlock}>
|
||||||
|
Delete Block
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{:else if $workflowStore.selectedWorkflow}
|
{:else if $workflowStore.selectedWorkflow}
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
|
|
Loading…
Reference in New Issue