diff --git a/frontend/src/lib/components/graph/FlowGraphV2.svelte b/frontend/src/lib/components/graph/FlowGraphV2.svelte index 9df74199a6..8e49c3348c 100644 --- a/frontend/src/lib/components/graph/FlowGraphV2.svelte +++ b/frontend/src/lib/components/graph/FlowGraphV2.svelte @@ -32,6 +32,7 @@ import { Expand } from 'lucide-svelte' import Toggle from '../Toggle.svelte' import DataflowEdge from './renderers/edges/DataflowEdge.svelte' + import { encodeState } from '$lib/utils' export let success: boolean | undefined = undefined export let modules: FlowModule[] | undefined = [] @@ -169,9 +170,12 @@ const nodes = writable([]) const edges = writable([]) + let height = 0 function updateStores() { $nodes = layoutNodes(graph?.nodes) $edges = graph.edges + + height = Math.max(...$nodes.map((n) => n.position.y + NODE.height), minHeight) } $: graph && updateStores() @@ -209,11 +213,8 @@
handleNodeClick(e)} @@ -231,7 +233,17 @@ {#if download} - dispatch('expand')} class="!bg-surface"> + { + try { + localStorage.setItem('svelvet', encodeState({ modules, failureModule })) + } catch (e) { + console.error('error interacting with local storage', e) + } + window.open('/view_graph', '_blank') + }} + class="!bg-surface" + > {/if} diff --git a/frontend/src/routes/approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte b/frontend/src/routes/approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte index a4e7e681d1..645bc58c20 100644 --- a/frontend/src/routes/approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte +++ b/frontend/src/routes/approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte @@ -9,7 +9,6 @@ import JobArgs from '$lib/components/JobArgs.svelte' import { onDestroy, onMount } from 'svelte' import Tooltip from '$lib/components/Tooltip.svelte' - import FlowGraph from '$lib/components/graph/FlowGraph.svelte' import SchemaForm from '$lib/components/SchemaForm.svelte' import { enterpriseLicense, userStore, workspaceStore } from '$lib/stores' import { LogIn, AlertTriangle } from 'lucide-svelte' @@ -20,6 +19,7 @@ import { setLicense } from '$lib/enterpriseUtils' import DisplayResult from '$lib/components/DisplayResult.svelte' import ScheduleEditor from '$lib/components/ScheduleEditor.svelte' + import FlowGraphV2 from '$lib/components/graph/FlowGraphV2.svelte' $workspaceStore = $page.params.workspace let rd = $page.url.href.replace($page.url.origin, '') @@ -286,7 +286,7 @@ {#if job && job.raw_flow && !completed}

Flow details

- - import FlowGraph from '$lib/components/graph/FlowGraph.svelte' + import FlowGraphV2 from '$lib/components/graph/FlowGraphV2.svelte' import { decodeState } from '$lib/utils' let content = localStorage.getItem('svelvet') @@ -8,7 +8,7 @@ : { modules: [], failureModule: undefined } - +