feat(frontend): draft script/flow can only access the edit page until… (#2607)

* feat(frontend): draft script/flow can only access the edit page until deployed

* feat(frontend): remove redirect
This commit is contained in:
Faton Ramadani
2023-11-10 10:26:22 +01:00
committed by GitHub
parent d789a931b3
commit ce51362ae8
6 changed files with 23 additions and 15 deletions
@@ -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({
@@ -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 @@
</div>
{:else}
<div class="text-sm text-secondary flex flex-row gap-2">
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"
<a
href="https://www.windmill.dev/docs/core_concepts/worker_groups"
target="_blank"
@@ -6,7 +6,7 @@
import Portal from 'svelte-portal'
export let hasPadding: boolean = true
export let target: string | undefined = undefined
export let target: string | undefined = 'body'
const [popperRef, popperContent] = createPopperActions({ placement: 'auto' })
const popperOptions: PopperOptions<{}> = {
@@ -74,7 +74,9 @@
{/if}
<Row
href="/flows/get/{path}?workspace={$workspaceStore}"
href={draft_only
? `/flows/edit/${path}?nodraft=true`
: `/flows/get/${path}?workspace=${$workspaceStore}`}
kind="flow"
workspaceId={workspace_id ?? $workspaceStore ?? ''}
{marked}
@@ -93,7 +93,7 @@
{/if}
<Row
href="/scripts/get/{hash}?workspace={$workspaceStore}"
href={draft_only ? `/scripts/edit/${path}` : `/scripts/get/${hash}?workspace=${$workspaceStore}`}
kind="script"
{marked}
{path}
@@ -45,7 +45,6 @@
let can_write = false
let path = $page.params.path
let shareModal: ShareModal
let deploymentInProgress = false
$: cliCommand = `wmill flow run ${flow?.path} -d '${JSON.stringify(args)}'`