mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 08:02:38 +00:00
fix: guard every component under a session editor against the navigation workspace
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
34aecb0d29
commit
a4eb80bd8d
+7
-5
@@ -19,7 +19,6 @@
|
||||
CtxAppInput
|
||||
} from '../../inputType'
|
||||
import type { AppViewerContext } from '../../types'
|
||||
import { workspaceStore } from '$lib/stores'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { deepEqual } from 'fast-equals'
|
||||
import { computeFields } from './utils'
|
||||
@@ -35,6 +34,9 @@
|
||||
import FlowEditorDrawer from '$lib/components/flows/content/FlowEditorDrawer.svelte'
|
||||
import { FlowService, ScriptService, type OpenFlow } from '$lib/gen'
|
||||
import { replaceScriptPlaceholderWithItsValues } from '$lib/hub'
|
||||
import { useOperatingWorkspace } from '$lib/components/operatingWorkspace.svelte'
|
||||
|
||||
const operatingWorkspace = useOperatingWorkspace()
|
||||
|
||||
interface Props {
|
||||
runnable: RunnableByPath
|
||||
@@ -131,7 +133,7 @@
|
||||
return
|
||||
}
|
||||
|
||||
const loaded = await loadSchema($workspaceStore ?? '', runnable.path, 'flow')
|
||||
const loaded = await loadSchema($operatingWorkspace ?? '', runnable.path, 'flow')
|
||||
const schema = loaded?.schema ?? emptySchema()
|
||||
if (!deepEqual(runnable.schema, schema)) {
|
||||
runnable.schema = schema
|
||||
@@ -167,7 +169,7 @@
|
||||
async function openScriptEditor(path: string) {
|
||||
try {
|
||||
const script = await ScriptService.getScriptByPath({
|
||||
workspace: $workspaceStore!,
|
||||
workspace: $operatingWorkspace!,
|
||||
path
|
||||
})
|
||||
scriptEditorDrawer?.openDrawer(script.hash, () => {
|
||||
@@ -344,7 +346,7 @@
|
||||
startIcon={{ icon: Eye }}
|
||||
endIcon={{ icon: ExternalLink }}
|
||||
target="_blank"
|
||||
href="{base}/flows/get/{runnable.path}?workspace={$workspaceStore}"
|
||||
href="{base}/flows/get/{runnable.path}?workspace={$operatingWorkspace}"
|
||||
>
|
||||
Details
|
||||
</Button>
|
||||
@@ -425,7 +427,7 @@
|
||||
{#if runnable.runType == 'flow' && isHubFlowPath(runnable.path)}
|
||||
Hub flow not found at {runnable.path}
|
||||
{:else}
|
||||
{runnable.runType} not found at {runnable.path} in workspace {$workspaceStore}
|
||||
{runnable.runType} not found at {runnable.path} in workspace {$operatingWorkspace}
|
||||
{/if}
|
||||
</div>
|
||||
{:else if runnable.runType == 'script' || runnable.runType == 'hubscript'}
|
||||
|
||||
Reference in New Issue
Block a user