From e5dbe7076c96b819e90f7ccc69308cdea17332c7 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 6 Mar 2023 08:33:53 +0100 Subject: [PATCH 1/6] handle larger sized graphs --- .../src/lib/components/graph/FlowGraph.svelte | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/graph/FlowGraph.svelte b/frontend/src/lib/components/graph/FlowGraph.svelte index bb5122d20a..5b8a4ed7eb 100644 --- a/frontend/src/lib/components/graph/FlowGraph.svelte +++ b/frontend/src/lib/components/graph/FlowGraph.svelte @@ -454,11 +454,19 @@ const stratify = dagStratify().id(({ id }: Node) => id) const dag = stratify(nodes) - const layout = sugiyama() - .decross(decrossOpt().large('medium')) - .coord(coordCenter()) - .nodeSize(() => [NODE.width + NODE.gap.horizontal, NODE.height + NODE.gap.vertical]) - const boxSize = layout(dag) + let boxSize: any + try { + const layout = sugiyama() + .decross(decrossOpt()) + .coord(coordCenter()) + .nodeSize(() => [NODE.width + NODE.gap.horizontal, NODE.height + NODE.gap.vertical]) + boxSize = layout(dag) + } catch { + const layout = sugiyama() + .coord(coordCenter()) + .nodeSize(() => [NODE.width + NODE.gap.horizontal, NODE.height + NODE.gap.vertical]) + boxSize = layout(dag) + } return { nodes: dag.descendants().map((des) => ({ ...des.data, From a999eb21121a7c0010621448324e0c77caf2b3f6 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Mon, 6 Mar 2023 09:01:19 +0100 Subject: [PATCH 2/6] fix(frontend): fix branch deletion (#1261) * fix(frontend): fix branch deletion * fix(frontend): fix branch deletion * fix(frontend): fix branch deletion --- .../components/flows/map/FlowModuleSchemaMap.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/flows/map/FlowModuleSchemaMap.svelte b/frontend/src/lib/components/flows/map/FlowModuleSchemaMap.svelte index cdb5e35c3c..96ba4f674d 100644 --- a/frontend/src/lib/components/flows/map/FlowModuleSchemaMap.svelte +++ b/frontend/src/lib/components/flows/map/FlowModuleSchemaMap.svelte @@ -147,9 +147,14 @@ function removeBranch(module: FlowModule, index: number) { if (module.value.type === 'branchone' || module.value.type === 'branchall') { - const leaves = dfs(module.value.branches[index].modules, (mod) => mod.id) - leaves.forEach((leafId: string) => deleteFlowStateById(leafId)) - module.value.branches.splice(index, 1) + const offset = module.value.type === 'branchone' ? 1 : 0 + + if (module.value.branches[index - offset]?.modules) { + const leaves = dfs(module.value.branches[index - offset].modules, (mod) => mod.id) + leaves.forEach((leafId: string) => deleteFlowStateById(leafId)) + } + + module.value.branches.splice(index - offset, 1) } } From 8e563a42f595092368de5359661bff6f87959f36 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 6 Mar 2023 10:38:01 +0100 Subject: [PATCH 3/6] Update docker-compose.yml with oauth example --- docker-compose.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 01c45edcfc..7d3ec72401 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,9 @@ services: depends_on: db: condition: service_healthy - + volumes: + # - ./oauth.json/:/usr/src/app/oauth.json + windmill_worker: image: ghcr.io/windmill-labs/windmill:main deploy: @@ -61,7 +63,6 @@ services: # to mount the worker folder to debug,, KEEP_JOB_DIR=true and mount /tmp/windmill volumes: - worker_dependency_cache:/tmp/windmill/cache - # - ./oauth.json/:/usr/src/app/oauth.json lsp: image: ghcr.io/windmill-labs/windmill-lsp:latest From 9ee261fe1a47763c506b1ed3ef502223c085c23a Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 6 Mar 2023 10:39:00 +0100 Subject: [PATCH 4/6] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7d3ec72401..6bea31e0cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: depends_on: db: condition: service_healthy - volumes: + # volumes: # - ./oauth.json/:/usr/src/app/oauth.json windmill_worker: From 200cb69d827f826a27c2bd3b54d9daa99dfadd07 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 6 Mar 2023 11:19:56 +0100 Subject: [PATCH 5/6] make default branch non removable for branchone --- frontend/src/lib/components/graph/FlowGraph.svelte | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/graph/FlowGraph.svelte b/frontend/src/lib/components/graph/FlowGraph.svelte index 5b8a4ed7eb..c85f25a5f9 100644 --- a/frontend/src/lib/components/graph/FlowGraph.svelte +++ b/frontend/src/lib/components/graph/FlowGraph.svelte @@ -140,10 +140,11 @@ return flowModuleToLoop(modules, module, parent, loopDepth) } else if (type === 'branchone') { const branches = [ - { summary: 'Default branch', modules: module.value.default }, + { summary: 'Default Branch', modules: module.value.default, removable: false }, ...module.value.branches.map((b, i) => ({ summary: defaultIfEmptyString(b.summary, 'Branch ' + (i + 1)), - modules: b.modules + modules: b.modules, + removable: true })) ] return flowModuleToBranch( @@ -158,7 +159,8 @@ } else if (type === 'branchall') { const branches = module.value.branches.map((b, i) => ({ summary: defaultIfEmptyString(b.summary, `Branch ${i + 1}`), - modules: b.modules + modules: b.modules, + removable: true })) return flowModuleToBranch(module, modules, branches, [], parent, loopDepth, true) } @@ -345,7 +347,7 @@ function flowModuleToBranch( module: FlowModule, modules: FlowModule[], - branches: { summary: string; modules: FlowModule[] }[], + branches: { summary: string; modules: FlowModule[]; removable: boolean }[], edgesLabel: string[], parent: string | NestedNodes | undefined = undefined, loopDepth: number, @@ -380,7 +382,7 @@ ]) } - branches.forEach(({ summary, modules }, i) => { + branches.forEach(({ summary, modules, removable }, i) => { const items: NestedNodes = [] items.push( createVirtualNode( @@ -393,7 +395,7 @@ loopDepth, 0, false, - { module, index: i } + removable ? { module, index: i } : undefined ) ) if (modules.length) { From 2557e136bd0df1a023819b7d9b2235e30d7140b6 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Mon, 6 Mar 2023 11:26:00 +0100 Subject: [PATCH 6/6] fix(frontend): fix app map reactivity (#1260) --- .../src/lib/components/apps/components/display/AppMap.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/apps/components/display/AppMap.svelte b/frontend/src/lib/components/apps/components/display/AppMap.svelte index 9e0bcbe929..466b3c9196 100644 --- a/frontend/src/lib/components/apps/components/display/AppMap.svelte +++ b/frontend/src/lib/components/apps/components/display/AppMap.svelte @@ -147,7 +147,6 @@ }) $: css = concatCustomCss($app.css?.mapcomponent, customCss) - $: gridItem = findGridItem($app, id) function updateRegionOutput() { if (map) { @@ -164,6 +163,8 @@ } function handleSyncRegion() { + const gridItem = findGridItem($app, id) + if (!map || !gridItem) { return }