Skip to content

Commit f2867e1

Browse files
committed
feat(Tenant): use NavigationTree for schemas
1 parent f02bc15 commit f2867e1

File tree

16 files changed

+228
-610
lines changed

16 files changed

+228
-610
lines changed

src/components/GroupTreeViewer/GroupTreeViewer.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import '../../styles/react-treeview';
2-
31
.group-tree-viewer {
42
&__row {
53
display: flex;

src/containers/App/App.scss

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -117,32 +117,6 @@ body,
117117
border-color: var(--yc-color-text-danger);
118118
}
119119

120-
.tree-view_item {
121-
/* stylelint-disable-next-line declaration-no-important*/
122-
cursor: default !important;
123-
}
124-
125-
.tree-view_children {
126-
margin-left: 25px;
127-
}
128-
129-
.tree-view_arrow {
130-
padding: 2px;
131-
132-
line-height: 0.8;
133-
134-
transform: rotate(90deg);
135-
}
136-
137-
.tree-view_arrow-collapsed {
138-
transform: rotate(0deg);
139-
}
140-
141-
.tree-view_arrow:after {
142-
font-size: var(--yc-text-body2-font-size);
143-
content: '';
144-
}
145-
146120
.data-table__row:hover .entity-status__clipboard-button {
147121
display: flex;
148122
}

src/containers/Tenant/ObjectSummary/ObjectSummary.scss

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
&__action-button {
2828
position: absolute;
29-
top: 12px;
30-
right: 4px;
29+
top: 8px; // centered relative to the heading
30+
right: 5px; // centered relative to the collapsed panel
3131

3232
background-color: var(--yc-color-base-background);
3333
&_hidden {
@@ -41,32 +41,26 @@
4141
align-items: center;
4242
}
4343

44-
&__tree {
44+
&__tree-wrapper {
4545
display: flex;
46-
overflow: scroll;
47-
flex: 0 0 auto;
4846
flex-direction: column;
47+
}
48+
49+
&__tree {
50+
overflow-y: scroll;
51+
flex: 1 1 auto;
4952

5053
height: 100%;
5154
padding: 0 12px 12px;
52-
53-
.tree-view_item {
54-
margin: 0;
55-
padding: 2px 0;
56-
}
57-
58-
& > div > .tree-view {
59-
padding-bottom: 15px;
60-
}
6155
}
6256

6357
&__tree-header {
6458
display: flex;
59+
flex: 0 0 auto;
6560
justify-content: space-between;
6661
align-items: center;
6762

6863
padding: 12px 12px 8px;
69-
@include sticky-top();
7064
}
7165

7266
&__tree-title {

src/containers/Tenant/ObjectSummary/ObjectSummary.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,20 @@ import qs from 'qs';
77
import _ from 'lodash';
88

99
import {Button, HelpTooltip, Loader, Tabs} from '@yandex-cloud/uikit';
10-
//@ts-ignore
10+
1111
import SplitPane from '../../../components/SplitPane';
12-
//@ts-ignore
13-
import SchemaNode from '../Schema/SchemaNode/SchemaNode';
14-
//@ts-ignore
12+
import {SchemaTree} from '../Schema/SchemaTree/SchemaTree';
1513
import Acl from '../Acl/Acl';
16-
//@ts-ignore
1714
import SchemaViewer from '../Schema/SchemaViewer/SchemaViewer';
1815
import CopyToClipboard from '../../../components/CopyToClipboard/CopyToClipboard';
19-
//@ts-ignore
2016
import InfoViewer from '../../../components/InfoViewer/InfoViewer';
21-
//@ts-ignore
2217
import Icon from '../../../components/Icon/Icon';
2318

2419
import {OLAP_TABLE_TYPE, TABLE_TYPE} from '../Tenant';
2520

2621
import {
2722
DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED,
2823
DEFAULT_SIZE_TENANT_SUMMARY_KEY,
29-
//@ts-ignore
3024
} from '../../../utils/constants';
3125
import {
3226
TenantGeneralTabsIds,
@@ -41,10 +35,10 @@ import {
4135
paneVisibilityToggleReducerCreator,
4236
PaneVisibilityToggleButtons,
4337
} from '../utils/paneVisibilityToggleHelpers';
44-
//@ts-ignore
4538
import {setShowPreview} from '../../../store/reducers/schema';
4639

4740
import './ObjectSummary.scss';
41+
4842
const b = cn('object-summary');
4943

5044
const getInitialIsSummaryCollapsed = () => {
@@ -103,7 +97,7 @@ function ObjectSummary(props: ObjectSummaryProps) {
10397
});
10498

10599
const {name: tenantName, info: infoTab} = queryParams;
106-
const tenantData = _.get(data[tenantName as string], 'PathDescription.Self');
100+
const pathData = _.get(data[tenantName as string], 'PathDescription.Self');
107101
const currentSchemaData = _.get(data[currentSchemaPath], 'PathDescription.Self');
108102

109103
const tableSchema =
@@ -195,13 +189,20 @@ function ObjectSummary(props: ObjectSummaryProps) {
195189

196190
const renderTree = () => {
197191
return (
198-
<div>
192+
<div className={b('tree-wrapper')}>
199193
<div className={b('tree-header')}>
200194
<div className={b('tree-title')}>Navigation</div>
201195
</div>
202196
<div className={b('tree')}>
203-
{tenantData && (
204-
<SchemaNode fullPath={tenantName as string} data={tenantData} isRoot />
197+
{pathData && (
198+
<SchemaTree
199+
rootPath={tenantName as string}
200+
// for the root pathData.Name contains the same string as tenantName,
201+
// but without the leading slash
202+
rootName={pathData?.Name || tenantName}
203+
rootType={pathData.PathType}
204+
currentPath={currentSchemaPath}
205+
/>
205206
)}
206207
</div>
207208
</div>

src/containers/Tenant/Schema/SchemaNode/SchemaNode.js

Lines changed: 0 additions & 170 deletions
This file was deleted.

src/containers/Tenant/Schema/SchemaNode/SchemaNode.scss

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)