From 1ed99a0ecda5568407f17b877280225552bb9d07 Mon Sep 17 00:00:00 2001 From: Ramiro Medina <64783088+ramedina86@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:53:34 +0200 Subject: [PATCH 1/4] Update src/ui/src/components/workflows/base/WorkflowArrow.vue Co-authored-by: Alexandre Rousseau --- src/ui/src/components/workflows/base/WorkflowArrow.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ui/src/components/workflows/base/WorkflowArrow.vue b/src/ui/src/components/workflows/base/WorkflowArrow.vue index 79fe0dcbf..07ac642a4 100644 --- a/src/ui/src/components/workflows/base/WorkflowArrow.vue +++ b/src/ui/src/components/workflows/base/WorkflowArrow.vue @@ -9,7 +9,14 @@ opacity: isSelected ? `0.2` : `0`, }" > - + Date: Mon, 30 Sep 2024 14:58:42 +0200 Subject: [PATCH 2/4] Update src/ui/src/components/workflows/WorkflowsWorkflow.vue Co-authored-by: Alexandre Rousseau --- .../src/components/workflows/WorkflowsWorkflow.vue | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ui/src/components/workflows/WorkflowsWorkflow.vue b/src/ui/src/components/workflows/WorkflowsWorkflow.vue index fec57b177..6ec7f562f 100644 --- a/src/ui/src/components/workflows/WorkflowsWorkflow.vue +++ b/src/ui/src/components/workflows/WorkflowsWorkflow.vue @@ -282,14 +282,12 @@ watch( // Remove references when a node is deleted - const preIds = preChildren.map((c) => c.id); - const postIds = postChildren.map((c) => c.id); - const removedIds = preIds.filter((cId) => !postIds.includes(cId)); - removedIds.forEach((removedId) => { - postChildren.forEach((c) => { - if (!c.outs || c.outs.length == 0) return; - c.outs = c.outs.filter((out) => out.toNodeId !== removedId); - }); + const removedIds = new Set(postChildren.map((c) => c.id)); + preChildren.forEach(c => removedIds.delete(c.id)); + + postChildren.forEach((c) => { + c.outs = c.outs?.filter((out) => !removedIds.has(out.toNodeId)); + }); }); if (removedIds.length > 0) { From 262c3a9d936c4e9d420a888f67c736e292baae7d Mon Sep 17 00:00:00 2001 From: Ramiro Medina <64783088+ramedina86@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:59:53 +0200 Subject: [PATCH 3/4] Update src/ui/src/builder/useComponentActions.ts Co-authored-by: Alexandre Rousseau --- src/ui/src/builder/useComponentActions.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ui/src/builder/useComponentActions.ts b/src/ui/src/builder/useComponentActions.ts index 5c3807e2e..609e84979 100644 --- a/src/ui/src/builder/useComponentActions.ts +++ b/src/ui/src/builder/useComponentActions.ts @@ -729,11 +729,9 @@ export function useComponentActions(wf: Core, ssbm: BuilderManager) { ssbm.openMutationTransaction(transactionId, `Edit out`, true); ssbm.registerPreMutation(component); - component.outs = [ - ...component.outs.filter( - (o) => !(out.outId === o.outId && out.toNodeId === o.toNodeId), - ), - ]; + component.outs = component.outs.filter( + (o) => !(out.outId === o.outId && out.toNodeId === o.toNodeId), + ); ssbm.registerPostMutation(component); ssbm.closeMutationTransaction(transactionId); From 9e4f638ea280e0b093fe9d031838978bc29c9743 Mon Sep 17 00:00:00 2001 From: Ramiro Medina <64783088+ramedina86@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:00:33 +0200 Subject: [PATCH 4/4] Update src/ui/src/builder/useComponentActions.ts Co-authored-by: Alexandre Rousseau --- src/ui/src/builder/useComponentActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/src/builder/useComponentActions.ts b/src/ui/src/builder/useComponentActions.ts index 609e84979..3ad969607 100644 --- a/src/ui/src/builder/useComponentActions.ts +++ b/src/ui/src/builder/useComponentActions.ts @@ -127,7 +127,7 @@ export function useComponentActions(wf: Core, ssbm: BuilderManager) { type: string, parentId: Component["id"], position?: number, - initProperties?: Partial, + initProperties?: Partial>, ) { const newId = generateNewComponentId(); const definition = wf.getComponentDefinition(type);