diff --git a/frontend/src/lib/components/FlowBuilder.svelte b/frontend/src/lib/components/FlowBuilder.svelte index 601446a8a8..7245abf033 100644 --- a/frontend/src/lib/components/FlowBuilder.svelte +++ b/frontend/src/lib/components/FlowBuilder.svelte @@ -115,7 +115,9 @@ } flowStore.subscribe((flow: Flow) => { - setQueryWithoutLoad($page.url, 'state', encodeState(flowToMode(flow, $mode))) + if (flow) { + setQueryWithoutLoad($page.url, 'state', encodeState(flowToMode(flow, $mode))) + } }) onMount(() => { @@ -171,6 +173,7 @@ {/if} +
{#if initialPath && initialPath != $flowStore?.path} {initialPath} → {/if} @@ -181,21 +184,25 @@ - {#if step === 1} - - {:else if step === 2} - + {#if $flowStore} + {#if step === 1} + + {:else if step === 2} + + {/if} + {:else} +

Loading

{/if}
diff --git a/frontend/src/lib/components/FlowStatusViewer.svelte b/frontend/src/lib/components/FlowStatusViewer.svelte index c759e8c6f5..eabd733a88 100644 --- a/frontend/src/lib/components/FlowStatusViewer.svelte +++ b/frontend/src/lib/components/FlowStatusViewer.svelte @@ -31,7 +31,6 @@ logs[i] = (await JobService.getJob({ workspace: $workspaceStore ?? '', id: last.job ?? '' })) .logs ?? '' - console.log(logs[i]) logs = logs pres[i].scroll({ top: pres[i]?.scrollHeight, behavior: 'smooth' }) } diff --git a/frontend/src/lib/components/ObjectResourceInput.svelte b/frontend/src/lib/components/ObjectResourceInput.svelte index 9f31082e7d..b66e36f347 100644 --- a/frontend/src/lib/components/ObjectResourceInput.svelte +++ b/frontend/src/lib/components/ObjectResourceInput.svelte @@ -9,7 +9,6 @@ export let format: string export let value: any - console.log(value) function isString(value: any) { return typeof value === 'string' || value instanceof String } diff --git a/frontend/src/lib/components/SchemaEditor.svelte b/frontend/src/lib/components/SchemaEditor.svelte index aceed7be28..77f64d0fc8 100644 --- a/frontend/src/lib/components/SchemaEditor.svelte +++ b/frontend/src/lib/components/SchemaEditor.svelte @@ -58,7 +58,6 @@ } else if (Object.keys(schema.properties).includes(modalProperty.name) && !editing) { argError = 'There is already an argument with this name' } else { - console.log('XXXXXX') schema.properties[modalProperty.name] = modalToSchema(modalProperty) if (modalProperty.required) { schema.required = [...schema.required, modalProperty.name] diff --git a/frontend/src/routes/flows/add.svelte b/frontend/src/routes/flows/add.svelte index 531781b812..9c37ec4171 100644 --- a/frontend/src/routes/flows/add.svelte +++ b/frontend/src/routes/flows/add.svelte @@ -17,27 +17,24 @@ const initialState = $page.url.searchParams.get('state') const hubId = $page.url.searchParams.get('hub') - let flow: Flow = - initialState != undefined - ? decodeState(initialState) - : { - path: '', - summary: '', - value: { modules: [] }, - edited_by: '', - edited_at: '', - archived: false, - extra_perms: {}, - schema: emptySchema() - } - async function loadFlow() { + let flow: Flow = + initialState != undefined + ? decodeState(initialState) + : { + path: '', + summary: '', + value: { modules: [] }, + edited_by: '', + edited_at: '', + archived: false, + extra_perms: {}, + schema: emptySchema() + } + if (hubId) { const hub = (await FlowService.getHubFlowById({ id: Number(hubId) })).flow - flow.summary = hub?.summary ?? '' - flow.value = hub?.value ?? { modules: [] } - flow.description = hub?.description - flow.schema = hub?.schema ?? emptySchema() + Object.assign(flow, hub) flow = flow $page.url.searchParams.delete('hub') sendUserToast(`Flow has been loaded from hub flow id ${hubId}.`)