+
{/if}
diff --git a/frontend/src/lib/components/ProgressBar.svelte b/frontend/src/lib/components/ProgressBar.svelte
new file mode 100644
index 0000000000..2518e22496
--- /dev/null
+++ b/frontend/src/lib/components/ProgressBar.svelte
@@ -0,0 +1,36 @@
+
+
+
+
+ {text}
+
+ {series.slice(0, i).reduce((x, y) => y + x, 0)}%
+
+
+
+ {#each series as serie, index}
+
y + x, 0)}
+ length={serie}
+ shouldToggle={toggled[index]}
+ />
+ {/each}
+
+
diff --git a/frontend/src/lib/components/ProgressBarPart.svelte b/frontend/src/lib/components/ProgressBarPart.svelte
new file mode 100644
index 0000000000..936d504c66
--- /dev/null
+++ b/frontend/src/lib/components/ProgressBarPart.svelte
@@ -0,0 +1,25 @@
+
+
+
diff --git a/frontend/src/lib/components/flows/flowStateUtils.ts b/frontend/src/lib/components/flows/flowStateUtils.ts
index 84c4e579ad..519e4eabf2 100644
--- a/frontend/src/lib/components/flows/flowStateUtils.ts
+++ b/frontend/src/lib/components/flows/flowStateUtils.ts
@@ -1,5 +1,12 @@
import type { Schema } from '$lib/common'
-import { CompletedJob, ScriptService, type Flow, type FlowModule, type RawScript } from '$lib/gen'
+import {
+ CompletedJob,
+ Job,
+ ScriptService,
+ type Flow,
+ type FlowModule,
+ type RawScript
+} from '$lib/gen'
import { initialCode } from '$lib/script_helpers'
import { userStore, workspaceStore } from '$lib/stores'
import {
@@ -15,7 +22,6 @@ import { get } from 'svelte/store'
import { flowStateStore, type FlowModuleSchema, type FlowState } from './flowState'
import { flowStore } from './flowStore'
import { jobsToResults, loadSchemaFromModule } from './utils'
-
export function emptyFlowModuleSchema(): FlowModuleSchema {
return {
flowModule: emptyModule(),
@@ -264,24 +270,42 @@ function extractPreviewResults(flowModuleSchemas: FlowModuleSchema[]) {
return flowModuleSchemas.map((fms) => fms.previewResult)
}
+export type JobResult = {
+ job?: Job
+ innerJobs?: JobResult[]
+ loopJobs?: JobResult[]
+}
+
export function mapJobResultsToFlowState(
- jobs: CompletedJob[],
+ jobs: JobResult,
config: 'upto' | 'justthis',
configIndex: number
): void {
- if (!Array.isArray(jobs) || jobs.length === 0) {
+ if (!Array.isArray(jobs.innerJobs) || jobs.innerJobs.length === 0) {
return
}
if (config === 'justthis') {
- const [result] = jobsToResults(jobs)
+ const job = jobs.job as CompletedJob
flowStateStore.update((flowState: FlowState) => {
- flowState[configIndex] = result
+ flowState[configIndex] = job.result
return flowState
})
} else {
- const result = jobsToResults(jobs)
+ const results = jobs.innerJobs.map(({ job, loopJobs }) => {
+ if (Array.isArray(loopJobs) && loopJobs.length > 0) {
+ return loopJobs.map(({ job }) => {
+ if (job && 'result' in job) {
+ return job.result
+ }
+ })
+ } else {
+ if (job && 'result' in job) {
+ return job.result
+ }
+ }
+ })
flowStateStore.update((flowState: FlowState) => {
if (!Array.isArray(flowState)) {
@@ -290,7 +314,7 @@ export function mapJobResultsToFlowState(
return flowState.map((flowModuleSchema: FlowModuleSchema, index) => {
if (index <= configIndex) {
- flowModuleSchema.previewResult = result[index]
+ flowModuleSchema.previewResult = results[index]
}
return flowModuleSchema
diff --git a/frontend/src/lib/components/preview/FlowPreviewStatus.svelte b/frontend/src/lib/components/preview/FlowPreviewStatus.svelte
new file mode 100644
index 0000000000..7e67ca847f
--- /dev/null
+++ b/frontend/src/lib/components/preview/FlowPreviewStatus.svelte
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ |
+ Status
+ |
+ |
+
+ {#if job}
+
+ |
+ Job Id
+ |
+
+
+ {job?.id}
+
+ |
+
+ {/if}
+
+
+
diff --git a/frontend/src/lib/components/tabs/Tab.svelte b/frontend/src/lib/components/tabs/Tab.svelte
new file mode 100644
index 0000000000..6528fb6a23
--- /dev/null
+++ b/frontend/src/lib/components/tabs/Tab.svelte
@@ -0,0 +1,13 @@
+
+
+
(value = index)}
+>
+
+
diff --git a/frontend/src/lib/components/tabs/TabPanel.svelte b/frontend/src/lib/components/tabs/TabPanel.svelte
new file mode 100644
index 0000000000..7ab27fb4c3
--- /dev/null
+++ b/frontend/src/lib/components/tabs/TabPanel.svelte
@@ -0,0 +1,12 @@
+
+
+{#if value === index}
+
+
+
+{/if}
diff --git a/frontend/src/lib/components/tabs/Tabs.svelte b/frontend/src/lib/components/tabs/Tabs.svelte
new file mode 100644
index 0000000000..5fd29c35d1
--- /dev/null
+++ b/frontend/src/lib/components/tabs/Tabs.svelte
@@ -0,0 +1,3 @@
+
+
+
diff --git a/frontend/src/lib/stores.ts b/frontend/src/lib/stores.ts
index cf77cd3f34..370c4a269d 100644
--- a/frontend/src/lib/stores.ts
+++ b/frontend/src/lib/stores.ts
@@ -51,3 +51,5 @@ export function clearStores(): void {
usersWorkspaceStore.set(undefined)
superadmin.set(undefined)
}
+
+export const arePreviewsReady = writable
([])
diff --git a/frontend/src/routes/run/[...run].svelte b/frontend/src/routes/run/[...run].svelte
index ac0dc1e542..0edf22a523 100644
--- a/frontend/src/routes/run/[...run].svelte
+++ b/frontend/src/routes/run/[...run].svelte
@@ -330,7 +330,7 @@
{#if job?.job_kind == 'flow' || job?.job_kind == 'flowpreview'}
-
+
{/if}