mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-29 00:03:09 +00:00
fix(frontend): FlowMetadata view link targets the job's workspace
The "view script/flow" link in FlowMetadata still used flowPathToHref (which resolves the active workspace) for flows and a bare /scripts/get for scripts, so for a foreign-workspace job it pointed at the active workspace. Make it hub-aware and use the job's workspace (job.workspace_id ?? $workspaceStore), matching JobDetailHeader. Hub paths stay workspace-free. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a4634f3e70
commit
0664c52936
@@ -97,11 +97,15 @@
|
||||
{/if}
|
||||
|
||||
{#if (job && job.job_kind == 'flow') || job?.job_kind == 'script'}
|
||||
{@const stem = `${job?.job_kind}s`}
|
||||
{@const isScript = job?.job_kind === 'script'}
|
||||
{@const viewHref = isScript
|
||||
? `${base}/${stem}/get/${job?.script_hash}`
|
||||
: flowPathToHref(job?.script_path ?? '')}
|
||||
{@const jobWorkspace = job?.workspace_id ?? $workspaceStore}
|
||||
{@const viewHref = (job?.script_path ?? '').startsWith('hub/')
|
||||
? isScript
|
||||
? `${base}/scripts/get/${job?.script_hash}`
|
||||
: flowPathToHref(job?.script_path ?? '')
|
||||
: isScript
|
||||
? `${base}/scripts/get/${job?.script_hash}?workspace=${jobWorkspace}`
|
||||
: `${base}/flows/get/${job?.script_path}?workspace=${jobWorkspace}`}
|
||||
<div class="flex flex-row gap-2 items-center">
|
||||
{#if isScript}
|
||||
<Code2 size={SMALL_ICON_SIZE} class="min-w-3.5" />
|
||||
|
||||
Reference in New Issue
Block a user