-
-
- {renderEntityTypeBadge()}
-
{relativePath}
-
-
- {renderCommonInfoControls()}
+
+
+
+
+
+
+
+
+
+ {renderEntityTypeBadge()}
+
{relativePath}
+
+
+ {renderCommonInfoControls()}
+
+ {renderTabs()}
- {renderTabs()}
+
{renderTabContent()}
- {renderTabContent()}
-
-
+
+
+
+ {!isCollapsed && }
+
+
-
-
+
);
};
diff --git a/src/containers/Tenant/ObjectSummary/ObjectTree.tsx b/src/containers/Tenant/ObjectSummary/ObjectTree.tsx
index e1a10b87a..a0c149f1f 100644
--- a/src/containers/Tenant/ObjectSummary/ObjectTree.tsx
+++ b/src/containers/Tenant/ObjectSummary/ObjectTree.tsx
@@ -2,8 +2,8 @@ import {StringParam, useQueryParam} from 'use-query-params';
import {Loader} from '../../../components/Loader';
import {useGetSchemaQuery} from '../../../store/reducers/schema/schema';
-import {SchemaTree} from '../Schema/SchemaTree/SchemaTree';
+import {SchemaTree} from './SchemaTree/SchemaTree';
import i18n from './i18n';
import {b} from './shared';
diff --git a/src/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.tsx b/src/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.tsx
new file mode 100644
index 000000000..2b14d1276
--- /dev/null
+++ b/src/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.tsx
@@ -0,0 +1,21 @@
+import {ArrowRotateRight} from '@gravity-ui/icons';
+import {ActionTooltip, Button, Icon} from '@gravity-ui/uikit';
+import {nanoid} from '@reduxjs/toolkit';
+
+import {useDispatchTreeKey} from '../UpdateTreeContext';
+
+export function RefreshTreeButton() {
+ const updateTreeKey = useDispatchTreeKey();
+ return (
+
+
+
+ );
+}
diff --git a/src/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx b/src/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx
similarity index 97%
rename from src/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx
rename to src/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx
index 98fd08c98..01cc42db9 100644
--- a/src/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx
+++ b/src/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx
@@ -17,6 +17,7 @@ import {getSchemaControls} from '../../utils/controls';
import {isChildlessPathType, mapPathTypeToNavigationTreeType} from '../../utils/schema';
import {getActions} from '../../utils/schemaActions';
import {CreateDirectoryDialog} from '../CreateDirectoryDialog/CreateDirectoryDialog';
+import {useDispatchTreeKey, useTreeKey} from '../UpdateTreeContext';
interface SchemaTreeProps {
rootPath: string;
@@ -52,7 +53,8 @@ export function SchemaTree(props: SchemaTreeProps) {
const [querySettings, setQueryExecutionSettings] = useQueryExecutionSettings();
const [createDirectoryOpen, setCreateDirectoryOpen] = React.useState(false);
const [parentPath, setParentPath] = React.useState('');
- const [schemaTreeKey, setSchemaTreeKey] = React.useState('');
+ const setSchemaTreeKey = useDispatchTreeKey();
+ const schemaTreeKey = useTreeKey();
const fetchPath = async (path: string) => {
let schemaData: TEvDescribeSchemeResult | undefined;
diff --git a/src/containers/Tenant/ObjectSummary/UpdateTreeContext.tsx b/src/containers/Tenant/ObjectSummary/UpdateTreeContext.tsx
new file mode 100644
index 000000000..c6174c119
--- /dev/null
+++ b/src/containers/Tenant/ObjectSummary/UpdateTreeContext.tsx
@@ -0,0 +1,35 @@
+import React from 'react';
+
+const TreeKeyContext = React.createContext
(undefined);
+const TreeKeyDispatchContext = React.createContext | undefined>(undefined);
+
+interface TreeKeyProviderProps {
+ children: React.ReactNode;
+}
+
+export function TreeKeyProvider({children}: TreeKeyProviderProps) {
+ const [key, setKey] = React.useState('');
+
+ return (
+
+
+ {children}
+
+
+ );
+}
+
+export function useTreeKey() {
+ const key = React.useContext(TreeKeyContext);
+ if (key === undefined) {
+ throw new Error('useTreeKey must be used within a TreeKeyProvider');
+ }
+ return key;
+}
+export function useDispatchTreeKey() {
+ const updateKey = React.useContext(TreeKeyDispatchContext);
+ if (updateKey === undefined) {
+ throw new Error('useDispatchTreeKey must be used within a TreeKeyProvider');
+ }
+ return updateKey;
+}
diff --git a/src/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx b/src/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx
index 05ca284bf..150ddc98f 100644
--- a/src/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx
+++ b/src/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import {ChevronsUp} from '@gravity-ui/icons';
-import {Button, Icon} from '@gravity-ui/uikit';
+import {ActionTooltip, Button, Icon} from '@gravity-ui/uikit';
import {cn} from '../../../utils/cn';
@@ -84,32 +84,35 @@ export function PaneVisibilityToggleButtons({
}: ToggleButtonProps) {
return (
-
-
+
+
+
+
+
+
+
);
}