From ce51362ae80deff3fdbc0ae81503aa09a17d9b73 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Fri, 10 Nov 2023 10:26:22 +0100 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20draft=20script/flow=20can=20o?= =?UTF-8?q?nly=20access=20the=20edit=20page=20until=E2=80=A6=20(#2607)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(frontend): draft script/flow can only access the edit page until deployed * feat(frontend): remove redirect --- .../src/lib/components/FlowBuilder.svelte | 10 ++++++---- .../src/lib/components/ScriptBuilder.svelte | 19 ++++++++++++------- .../common/button/ButtonDropdown.svelte | 2 +- .../components/common/table/FlowRow.svelte | 4 +++- .../components/common/table/ScriptRow.svelte | 2 +- .../(logged)/flows/get/[...path]/+page.svelte | 1 - 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/frontend/src/lib/components/FlowBuilder.svelte b/frontend/src/lib/components/FlowBuilder.svelte index 981387096f..6a33ac03fd 100644 --- a/frontend/src/lib/components/FlowBuilder.svelte +++ b/frontend/src/lib/components/FlowBuilder.svelte @@ -420,12 +420,14 @@ const dropdownItems: Array<{ label: string onClick: () => void - }> = [ - { + }> = [] + + if (savedFlow?.draft_only === false) { + dropdownItems.push({ label: 'Exit & see details', onClick: () => dispatch('details', $pathStore) - } - ] + }) + } if (!newFlow) { dropdownItems.push({ diff --git a/frontend/src/lib/components/ScriptBuilder.svelte b/frontend/src/lib/components/ScriptBuilder.svelte index 49ca84f40b..ee03ada182 100644 --- a/frontend/src/lib/components/ScriptBuilder.svelte +++ b/frontend/src/lib/components/ScriptBuilder.svelte @@ -314,12 +314,16 @@ window.open(`/scripts/add?template=${initialPath}`) } }, - { - label: 'Exit & See details', - onClick: () => { - goto(`/scripts/get/${initialPath}?workspace=${$workspaceStore}`) - } - } + ...(!script.draft_only + ? [ + { + label: 'Exit & See details', + onClick: () => { + goto(`/scripts/get/${initialPath}?workspace=${$workspaceStore}`) + } + } + ] + : []) ] : [] @@ -584,7 +588,8 @@ {:else}
- No custom worker group tag defined on this instance in "Workers {"->"} Assignable Tags" + No custom worker group tag defined on this instance in "Workers {'->'} Assignable + Tags" = { diff --git a/frontend/src/lib/components/common/table/FlowRow.svelte b/frontend/src/lib/components/common/table/FlowRow.svelte index f6313f7099..65da8f7034 100644 --- a/frontend/src/lib/components/common/table/FlowRow.svelte +++ b/frontend/src/lib/components/common/table/FlowRow.svelte @@ -74,7 +74,9 @@ {/if}