From cdb135aab81757cfe1bc4f65d416e7ac9a9cfe6b Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Thu, 30 Jun 2022 17:44:07 +0530 Subject: [PATCH] fixed issue: 5780 unable to delete lineage edge (#5797) * fixed issue: 5780 unable to delete lineage edge * removed warrning while moving node --- .../EntityLineage/EntityLineage.component.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/EntityLineage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/EntityLineage.component.tsx index 57e79e074d3..a240396b0df 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/EntityLineage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/EntityLineage.component.tsx @@ -189,6 +189,8 @@ const Entitylineage: FunctionComponent = ({ [] ); + const customEdges = useMemo(() => ({ buttonedge: CustomEdge }), []); + /** * take node as input and check if node is main entity or not * @param node @@ -394,6 +396,8 @@ const Entitylineage: FunctionComponent = ({ }; if (newCol.fromColumns?.length) { return [...col, newCol]; + } else { + return col; } } @@ -421,13 +425,15 @@ const Entitylineage: FunctionComponent = ({ }), }); } - setEdges((pre) => - pre.filter( + setEdges((pre) => { + return pre.filter( (e) => - e.sourceHandle !== data.data?.sourceHandle && - e.targetHandle !== data.data?.targetHandle - ) - ); + !( + e.sourceHandle === data.data?.sourceHandle && + e.targetHandle === data.data?.targetHandle + ) + ); + }); addLineageHandler(selectedEdge); setNewAddedNode({} as Node); setSelectedEntity({} as EntityReference); @@ -1314,7 +1320,7 @@ const Entitylineage: FunctionComponent = ({