From ce6fb0b657230ddfb7e404c226b8a2b200d96065 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 12 Jan 2024 01:11:49 +0100 Subject: [PATCH] improve nested flow flow renderer --- .../components/FlowStatusViewerInner.svelte | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/frontend/src/lib/components/FlowStatusViewerInner.svelte b/frontend/src/lib/components/FlowStatusViewerInner.svelte index d631342e3f..5f4b4bf59b 100644 --- a/frontend/src/lib/components/FlowStatusViewerInner.svelte +++ b/frontend/src/lib/components/FlowStatusViewerInner.svelte @@ -59,6 +59,7 @@ export let globalModuleStates: Writable>[] export let globalDurationStatuses: Writable>[] + export let childFlow: boolean = false let jobResults: any[] = [] let jobFailures: boolean[] = [] @@ -251,11 +252,13 @@ function onJobsLoaded(mod: FlowStatusModule, job: Job): void { if (mod.id && (mod.flow_jobs ?? []).length == 0) { - if ($flowStateStore?.[mod.id]) { - $flowStateStore[mod.id] = { - ...$flowStateStore[mod.id], - previewResult: job['result'], - previewArgs: job.args + if (!childFlow) { + if ($flowStateStore?.[mod.id]) { + $flowStateStore[mod.id] = { + ...$flowStateStore[mod.id], + previewResult: job['result'], + previewArgs: job.args + } } } initializeByJob(mod.id) @@ -303,13 +306,15 @@ let modId = flowJobIds?.moduleId if (modId) { if ($flowStateStore?.[modId]) { - if ( - !$flowStateStore[modId].previewResult || - !Array.isArray($flowStateStore[modId]?.previewResult) - ) { - $flowStateStore[modId].previewResult = [] + if (!childFlow) { + if ( + !$flowStateStore[modId].previewResult || + !Array.isArray($flowStateStore[modId]?.previewResult) + ) { + $flowStateStore[modId].previewResult = [] + } + $flowStateStore[modId].previewArgs = jobLoaded.args } - $flowStateStore[modId].previewArgs = jobLoaded.args if (jobLoaded.type == 'QueuedJob') { jobResults[j] = 'Job in progress ...' } else { @@ -542,6 +547,7 @@
{ onJobsLoaded(mod, e.detail) }} /> {:else}