From fc0200a159162c3df6b4ee57fa1bd7136848ceb6 Mon Sep 17 00:00:00 2001 From: Wroud Date: Wed, 6 Jul 2022 18:29:12 +0300 Subject: [PATCH] fix(core-app): CB-1990 nav tree groupping --- .../navigationTreeConnectionGroupFilter.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/webapp/packages/core-app/src/NavigationTree/ConnectionGroup/navigationTreeConnectionGroupFilter.ts b/webapp/packages/core-app/src/NavigationTree/ConnectionGroup/navigationTreeConnectionGroupFilter.ts index 5936332ff3..a1640f8417 100644 --- a/webapp/packages/core-app/src/NavigationTree/ConnectionGroup/navigationTreeConnectionGroupFilter.ts +++ b/webapp/packages/core-app/src/NavigationTree/ConnectionGroup/navigationTreeConnectionGroupFilter.ts @@ -26,21 +26,20 @@ function isDefined(val: T | undefined | null): val is T { function sortManageable(): (nodeA: NavNode, nodeB: NavNode) => number { return (nodeA: NavNode, nodeB: NavNode): number => { - const nodeAConnection = nodeA.objectFeatures.includes(EObjectFeature.dataSource); - const nodeBConnection = nodeB.objectFeatures.includes(EObjectFeature.dataSource); - - if (!nodeAConnection || !nodeBConnection) { - if (nodeAConnection === nodeBConnection) { - return 0; - } - return nodeAConnection ? 1 : -1; - } const nodeAShared = nodeA.features?.includes(ENodeFeature.shared); const nodeBShared = nodeB.features?.includes(ENodeFeature.shared); if (nodeAShared === nodeBShared) { - return 0; + const nodeAConnection = nodeA.objectFeatures.includes(EObjectFeature.dataSource); + const nodeBConnection = nodeB.objectFeatures.includes(EObjectFeature.dataSource); + + if (!nodeAConnection || !nodeBConnection) { + if (nodeAConnection === nodeBConnection) { + return 0; + } + return nodeAConnection ? 1 : -1; + } } return nodeBShared ? -1 : 1;