From 9aef311551d7c13e0ec13a7d67ab35f54c838b9d Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Tue, 24 Sep 2024 21:28:57 +0500 Subject: [PATCH 1/2] fix(edge-sidebar): add edge sidebar already open source and destination --- .../ModalsContainer/BlueprintModal/Body/index.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/ModalsContainer/BlueprintModal/Body/index.tsx b/src/components/ModalsContainer/BlueprintModal/Body/index.tsx index b67edd619..d083d46bb 100644 --- a/src/components/ModalsContainer/BlueprintModal/Body/index.tsx +++ b/src/components/ModalsContainer/BlueprintModal/Body/index.tsx @@ -194,9 +194,18 @@ export const Body = ({ Close }: BodyProps) => { links={filteredLinks} onEdgeClick={(refId, edgeType, source, target) => { setEdgeData({ refId, edgeType, source, target }) - setIsAddEdgeNode(true) - setIsCreateNew(false) - setSelectedSchemaId('') + + if (!isAddEdgeNode) { + setIsAddEdgeNode(true) + setIsCreateNew(false) + setSelectedSchemaId('') + } else { + setIsAddEdgeNode(false) + + setTimeout(() => { + setIsAddEdgeNode(true) + }, 200) + } }} schemasWithPositions={schemasWithChildren} selectedSchemaId={selectedSchemaId} From b5941f603a9073810469cd03b338a19c4a478727 Mon Sep 17 00:00:00 2001 From: Syed Mahtab Ali <98140673+MahtabBukhari@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:25:35 +0500 Subject: [PATCH 2/2] best way to update source and target fields value --- .../BlueprintModal/Body/index.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/components/ModalsContainer/BlueprintModal/Body/index.tsx b/src/components/ModalsContainer/BlueprintModal/Body/index.tsx index d083d46bb..f87c58b02 100644 --- a/src/components/ModalsContainer/BlueprintModal/Body/index.tsx +++ b/src/components/ModalsContainer/BlueprintModal/Body/index.tsx @@ -160,6 +160,7 @@ export const Body = ({ Close }: BodyProps) => { { links={filteredLinks} onEdgeClick={(refId, edgeType, source, target) => { setEdgeData({ refId, edgeType, source, target }) - - if (!isAddEdgeNode) { - setIsAddEdgeNode(true) - setIsCreateNew(false) - setSelectedSchemaId('') - } else { - setIsAddEdgeNode(false) - - setTimeout(() => { - setIsAddEdgeNode(true) - }, 200) - } + setIsAddEdgeNode(true) + setIsCreateNew(false) + setSelectedSchemaId('') }} schemasWithPositions={schemasWithChildren} selectedSchemaId={selectedSchemaId}