From 7fe0a8f3666d6ba8d5a500f5ae57ffe7ce3a2741 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Thu, 15 Aug 2024 09:30:26 +0200 Subject: [PATCH] feat(frontend): Fix node position --- .../components/flows/map/FlowJobsMenu.svelte | 50 +++++----- .../lib/components/graph/FlowGraphV2.svelte | 1 + .../graph/renderers/nodes/InputNode.svelte | 92 +++++++++---------- .../graph/renderers/nodes/ModuleNode.svelte | 27 +++--- 4 files changed, 84 insertions(+), 86 deletions(-) diff --git a/frontend/src/lib/components/flows/map/FlowJobsMenu.svelte b/frontend/src/lib/components/flows/map/FlowJobsMenu.svelte index 6e3f0ba6a2..92a9e2619c 100644 --- a/frontend/src/lib/components/flows/map/FlowJobsMenu.svelte +++ b/frontend/src/lib/components/flows/map/FlowJobsMenu.svelte @@ -2,6 +2,7 @@ import Menu from '$lib/components/common/menu/MenuV2.svelte' import { createEventDispatcher } from 'svelte' import { ListFilter } from 'lucide-svelte' + import { MenuItem } from '@rgossiaux/svelte-headlessui' const dispatch = createEventDispatcher() @@ -42,29 +43,28 @@ - -
-
- - {#each flowJobs ?? [] as id, idx (id)} - {#if filter == undefined || (idx + 1).toString().includes(filter.toString())} - - {/if} - {/each} -
-
+ + + + {#each flowJobs ?? [] as id, idx (id)} + {#if filter == undefined || (idx + 1).toString().includes(filter.toString())} + + + + {/if} + {/each} diff --git a/frontend/src/lib/components/graph/FlowGraphV2.svelte b/frontend/src/lib/components/graph/FlowGraphV2.svelte index 5ebd6eab4e..6b869b13f1 100644 --- a/frontend/src/lib/components/graph/FlowGraphV2.svelte +++ b/frontend/src/lib/components/graph/FlowGraphV2.svelte @@ -252,6 +252,7 @@ connectionLineType={ConnectionLineType.SmoothStep} defaultEdgeOptions={{ type: 'smoothstep' }} preventScrolling={scroll} + zoomOnDoubleClick={false} {proOptions} nodesDraggable={false} on:nodeclick={(e) => handleNodeClick(e)} diff --git a/frontend/src/lib/components/graph/renderers/nodes/InputNode.svelte b/frontend/src/lib/components/graph/renderers/nodes/InputNode.svelte index b690eb4638..0e7aa81e3f 100644 --- a/frontend/src/lib/components/graph/renderers/nodes/InputNode.svelte +++ b/frontend/src/lib/components/graph/renderers/nodes/InputNode.svelte @@ -1,6 +1,5 @@ -{#if data.insertable && !data.disableAi} - - -
- - - {#if !$copilotInfo.exists_openai_resource_path} -
-

- Enable Windmill AI in the - { - close() - }} - > - workspace settings - - -

-
- {/if} -
-
- - AI Flow builder -
-
-{/if} - + {#if data.insertable && !data.disableAi} +
+ +
+ + + {#if !$copilotInfo.exists_openai_resource_path} +
+

+ Enable Windmill AI in the + { + close() + }} + > + workspace settings + + +

+
+ {/if} +
+
+ + AI Flow builder +
+
+ {/if} - import { NodeToolbar, Position } from '@xyflow/svelte' import MapItem from '$lib/components/flows/map/MapItem.svelte' import type { FlowModule, FlowModuleValue } from '$lib/gen' import { GitBranchPlus } from 'lucide-svelte' @@ -82,17 +81,17 @@ data.eventHandlers.selectedIteration(e.detail, data.module.id) }} /> -
- - {#if (data.value.type === 'branchall' || data.value.type === 'branchone') && data.insertable} - - {/if} - +
+ {#if (data.value.type === 'branchall' || data.value.type === 'branchone') && data.insertable} + + {/if} +
+