mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(core-app): CB-1990 nav tree groupping
This commit is contained in:
+9
-10
@@ -26,21 +26,20 @@ function isDefined<T>(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;
|
||||
|
||||
Reference in New Issue
Block a user