From 255a7780d5889f0df2ff9096a88b073439924f8f Mon Sep 17 00:00:00 2001 From: Aleksei Potsetsuev Date: Wed, 24 Jan 2024 17:30:28 +0800 Subject: [PATCH] CB-4541 chore: revert test code --- .../src/queries/fragments/NavNodeInfo.gql | 1 - .../src/Tree/ResourceManagerTree.tsx | 31 +------------------ 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/webapp/packages/core-sdk/src/queries/fragments/NavNodeInfo.gql b/webapp/packages/core-sdk/src/queries/fragments/NavNodeInfo.gql index 24a9c244d4..0c87b6b2bc 100644 --- a/webapp/packages/core-sdk/src/queries/fragments/NavNodeInfo.gql +++ b/webapp/packages/core-sdk/src/queries/fragments/NavNodeInfo.gql @@ -1,6 +1,5 @@ fragment NavNodeInfo on NavigatorNodeInfo { id - uri name plainName hasChildren diff --git a/webapp/packages/plugin-navigation-tree-rm/src/Tree/ResourceManagerTree.tsx b/webapp/packages/plugin-navigation-tree-rm/src/Tree/ResourceManagerTree.tsx index 45e4cc5cb0..b708a6c4eb 100644 --- a/webapp/packages/plugin-navigation-tree-rm/src/Tree/ResourceManagerTree.tsx +++ b/webapp/packages/plugin-navigation-tree-rm/src/Tree/ResourceManagerTree.tsx @@ -10,7 +10,7 @@ import { useMemo } from 'react'; import { getComputed, s, useResource, useS, useUserData } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; -import { EObjectFeature, NavNodeInfoResource, NavTreeResource, ProjectsNavNodeService } from '@cloudbeaver/core-navigation-tree'; +import { NavNodeInfoResource, NavTreeResource, ProjectsNavNodeService } from '@cloudbeaver/core-navigation-tree'; import { ProjectInfoResource, ProjectsService } from '@cloudbeaver/core-projects'; import { resourceKeyList } from '@cloudbeaver/core-resource'; import { getRmResourcePath, ResourceManagerResource, RESOURCES_NODE_PATH } from '@cloudbeaver/core-resource-manager'; @@ -22,8 +22,6 @@ import { getNavigationTreeUserSettingsId, IElementsTreeSettings, NavigationTreeService, - Tree, - useTreeData, validateElementsTreeSettings, } from '@cloudbeaver/plugin-navigation-tree'; import { ResourceManagerService } from '@cloudbeaver/plugin-resource-manager'; @@ -102,36 +100,9 @@ export const ResourceManagerTree: React.FC = observer(function ResourceMa const settingsElements = useMemo(() => [ProjectsSettingsPlaceholderElement], []); - const data = useTreeData({ - rootId: '', - getNode(nodeId) { - const node = navNodeInfoResource.get(nodeId); - const outdated = navTreeResource.isOutdated(nodeId); - const children = navTreeResource.get(nodeId); - - return { - name: node?.name ?? 'Unknown', - icon: node?.icon, - tooltip: node?.description, - leaf: node?.objectFeatures.includes(EObjectFeature.entity) || !node?.hasChildren || (children?.length === 0 && !outdated), - }; - }, - getChildren(nodeId) { - return navTreeService.getChildren(nodeId) ?? []; - }, - async load(nodeId, manual) { - await navTreeService.loadNestedNodes(nodeId, manual); - }, - }); - - function getNodeHeight(nodeId: string): number { - return nodeId === root ? 0 : 22; - } - return ( -