fix(core-app): CB-1990 nav tree groupping

This commit is contained in:
Wroud
2022-07-06 18:29:12 +03:00
parent 1c380dd626
commit fc0200a159
@@ -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;