fix: improve flow status viwer iteration picker

This commit is contained in:
Ruben Fiszel
2024-11-26 12:38:34 +01:00
parent 90cdb7c0ca
commit 121dd83a46
@@ -30,6 +30,7 @@
import FlowGraphViewerStep from './FlowGraphViewerStep.svelte'
import FlowGraphV2 from './graph/FlowGraphV2.svelte'
import { buildPrefix } from './graph/graphBuilder'
import { root } from 'postcss'
const dispatch = createEventDispatcher()
@@ -153,11 +154,11 @@
return prefix ? 'subflow:' + prefix + key : key
}
async function refresh(clearLoop: boolean, root: boolean) {
async function refresh(clearLoop: boolean, rootJob: string | undefined) {
let modId = flowJobIds?.moduleId
if (clearLoop) {
if (!root) {
if (!rootJob) {
let topLevelModuleStates = globalModuleStates?.[globalModuleStates?.length - 1]
if (modId) {
topLevelModuleStates?.update((x) => {
@@ -201,7 +202,10 @@
}
}
for (let rec of Object.values(recursiveRefresh)) {
for (let [k, rec] of Object.entries(recursiveRefresh)) {
if (rootJob != undefined && rootJob != k) {
return
}
await tick()
await rec(clearLoop, false)
}
@@ -593,7 +597,7 @@
) {
if (modId) {
if (clicked) {
await globalRefreshes?.[modId]?.(true, true)
await globalRefreshes?.[modId]?.(true, id)
}
globalModuleStates?.[globalModuleStates?.length - 1]?.update((topLevelModuleStates) => {
let state = topLevelModuleStates?.[modId]
@@ -620,7 +624,7 @@
})
if (clicked) {
await globalRefreshes?.[modId]?.(false, true)
await globalRefreshes?.[modId]?.(false, id)
}
}
}
@@ -1190,7 +1194,8 @@
on:selectedIteration={async (e) => {
let detail = e.detail
if (detail.manuallySet) {
await globalRefreshes?.[detail.moduleId]?.(true, true)
let rootJobId = detail.id
await globalRefreshes?.[detail.moduleId]?.(true, rootJobId)
$localModuleStates[detail.moduleId] = {
...$localModuleStates[detail.moduleId],
@@ -1199,7 +1204,9 @@
selectedForLoopSetManually: true
}
await globalRefreshes?.[detail.moduleId]?.(false, true)
await tick()
await globalRefreshes?.[detail.moduleId]?.(false, rootJobId)
} else {
$localModuleStates[detail.moduleId] = {
...$localModuleStates[detail.moduleId],