From df6f65d5ae323168ee8ea1ccd426a5ca6566468d Mon Sep 17 00:00:00 2001 From: tplevko Date: Thu, 5 Sep 2024 11:37:58 +0200 Subject: [PATCH] fix(1390): Pipe contextual menu broken buttons removed --- .../flows/__snapshots__/pipe-visual-entity.test.ts.snap | 8 ++++---- .../src/models/visualization/flows/pipe-visual-entity.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/ui/src/models/visualization/flows/__snapshots__/pipe-visual-entity.test.ts.snap b/packages/ui/src/models/visualization/flows/__snapshots__/pipe-visual-entity.test.ts.snap index d042c7fcc..4de6251da 100644 --- a/packages/ui/src/models/visualization/flows/__snapshots__/pipe-visual-entity.test.ts.snap +++ b/packages/ui/src/models/visualization/flows/__snapshots__/pipe-visual-entity.test.ts.snap @@ -4,12 +4,12 @@ exports[`Pipe getNodeInteraction should return the correct interaction for the ' { "canBeDisabled": false, "canHaveChildren": false, - "canHaveNextStep": true, - "canHavePreviousStep": true, + "canHaveNextStep": false, + "canHavePreviousStep": false, "canHaveSpecialChildren": false, "canRemoveFlow": true, - "canRemoveStep": true, - "canReplaceStep": true, + "canRemoveStep": false, + "canReplaceStep": false, } `; diff --git a/packages/ui/src/models/visualization/flows/pipe-visual-entity.ts b/packages/ui/src/models/visualization/flows/pipe-visual-entity.ts index 5fde095dc..4aaee2ef6 100644 --- a/packages/ui/src/models/visualization/flows/pipe-visual-entity.ts +++ b/packages/ui/src/models/visualization/flows/pipe-visual-entity.ts @@ -188,13 +188,13 @@ export class PipeVisualEntity implements BaseVisualCamelEntity { getNodeInteraction(data: IVisualizationNodeData): NodeInteraction { return { /** Pipe cannot have a Kamelet before the source property */ - canHavePreviousStep: data.path !== 'source', + canHavePreviousStep: data.path !== ROOT_PATH && data.path !== 'source', /** Pipe cannot have a Kamelet after the sink property */ - canHaveNextStep: data.path !== 'sink', + canHaveNextStep: data.path !== ROOT_PATH && data.path !== 'sink', canHaveChildren: false, canHaveSpecialChildren: false, - canReplaceStep: true, - canRemoveStep: true, + canReplaceStep: data.path !== ROOT_PATH, + canRemoveStep: data.path !== ROOT_PATH, canRemoveFlow: data.path === ROOT_PATH, canBeDisabled: false, };