ydb-embedded-ui 1.5.0 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +31 -0
- package/dist/components/AsideNavigation/Settings/Settings.scss +4 -4
- package/dist/components/Breadcrumbs/Breadcrumbs.scss +1 -1
- package/dist/components/Collapse/Collapse.scss +8 -8
- package/dist/components/EmptyState/EmptyState.scss +6 -6
- package/dist/components/EntityStatus/EntityStatus.scss +6 -6
- package/dist/components/FullNodeViewer/FullNodeViewer.scss +7 -7
- package/dist/components/GroupViewer/GroupViewer.scss +1 -1
- package/dist/components/InfoViewer/InfoViewer.scss +4 -4
- package/dist/components/PDiskViewer/PDiskViewer.scss +1 -1
- package/dist/components/PoolUsage/PoolUsage.scss +5 -5
- package/dist/components/ProgressViewer/ProgressViewer.scss +9 -9
- package/dist/components/TableSkeleton/TableSkeleton.scss +1 -1
- package/dist/components/TabletsViewer/TabletsViewer.scss +2 -2
- package/dist/containers/App/App.js +2 -1
- package/dist/containers/App/App.scss +6 -0
- package/dist/containers/App/TipPopup/TipPopup.js +1 -1
- package/dist/containers/AsideNavigation/AsideNavigation.scss +1 -1
- package/dist/containers/Authentication/Authentication.scss +2 -2
- package/dist/containers/Authentication/Authentication.tsx +1 -0
- package/dist/containers/Header/Header.scss +2 -2
- package/dist/containers/Header/Host/Host.scss +6 -6
- package/dist/containers/Heatmap/Heatmap.js +1 -2
- package/dist/containers/Heatmap/Heatmap.scss +2 -2
- package/dist/containers/Node/Node.scss +0 -1
- package/dist/containers/Node/Node.tsx +1 -0
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +3 -3
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +6 -6
- package/dist/containers/Pdisk/Pdisk.scss +2 -2
- package/dist/containers/Pool/Pool.scss +3 -3
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.scss +2 -2
- package/dist/containers/Storage/Storage.scss +3 -3
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +4 -4
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +4 -4
- package/dist/containers/Tablet/Tablet.scss +4 -4
- package/dist/containers/Tablets/Tablets.js +1 -2
- package/dist/containers/TabletsFilters/TabletsFilters.js +1 -2
- package/dist/containers/TabletsFilters/TabletsFilters.scss +2 -2
- package/dist/containers/Tenant/Acl/Acl.scss +2 -2
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +15 -21
- package/dist/containers/Tenant/Diagnostics/Network/Network.scss +6 -6
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +4 -4
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.scss +2 -2
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.scss +7 -8
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +2 -12
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +5 -8
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.scss +1 -1
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +1 -3
- package/dist/containers/Tenant/Tenant.scss +2 -2
- package/dist/containers/Tenant/utils/schemaActions.ts +3 -18
- package/dist/containers/Vdisk/Vdisk.scss +2 -2
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.scss +2 -2
- package/dist/store/reducers/tenant.js +30 -0
- package/dist/store/state-url-mapping.js +6 -0
- package/dist/styles/mixins.scss +13 -13
- package/dist/utils/getNodesColumns.js +2 -3
- package/package.json +5 -4
@@ -5,7 +5,7 @@
|
|
5
5
|
display: inline-block;
|
6
6
|
|
7
7
|
width: 100%;
|
8
|
-
height: var(--yc-text-
|
8
|
+
height: var(--yc-text-body-2-line-height);
|
9
9
|
|
10
10
|
border: 1px solid var(--yc-color-infographics-misc-medium);
|
11
11
|
border-radius: 2px;
|
@@ -67,7 +67,7 @@
|
|
67
67
|
position: absolute;
|
68
68
|
z-index: 2;
|
69
69
|
|
70
|
-
font-size: var(--yc-text-body-font-size);
|
70
|
+
font-size: var(--yc-text-body-1-font-size);
|
71
71
|
line-height: inherit;
|
72
72
|
|
73
73
|
color: inherit;
|
@@ -16,12 +16,12 @@
|
|
16
16
|
overflow: auto;
|
17
17
|
flex-grow: 1;
|
18
18
|
|
19
|
-
font-size: var(--yc-text-
|
20
|
-
line-height: var(--yc-text-
|
19
|
+
font-size: var(--yc-text-body-2-font-size);
|
20
|
+
line-height: var(--yc-text-body-2-line-height);
|
21
21
|
|
22
22
|
.yc-tooltip {
|
23
23
|
// stylelint-disable-next-line declaration-no-important
|
24
|
-
height: var(--yc-text-
|
24
|
+
height: var(--yc-text-body-2-line-height) !important;
|
25
25
|
}
|
26
26
|
|
27
27
|
table {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import DataTable, {Column, Settings, SortOrder} from '@yandex-cloud/react-data-table';
|
4
|
-
import {
|
4
|
+
import {Popover, PopoverBehavior} from '@yandex-cloud/uikit';
|
5
5
|
|
6
6
|
import Vdisk from '../Vdisk/Vdisk';
|
7
7
|
//@ts-ignore
|
@@ -90,15 +90,15 @@ function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGro
|
|
90
90
|
return (
|
91
91
|
<div className={b('pool-name-wrapper')}>
|
92
92
|
{splitted && (
|
93
|
-
<
|
93
|
+
<Popover
|
94
94
|
content={<span className={b('tooltip')}>{value as string}</span>}
|
95
95
|
placement={['right']}
|
96
|
-
behavior={
|
96
|
+
behavior={PopoverBehavior.Immediate}
|
97
97
|
>
|
98
98
|
<span className={b('pool-name')}>
|
99
99
|
{splitted[splitted.length - 1]}
|
100
100
|
</span>
|
101
|
-
</
|
101
|
+
</Popover>
|
102
102
|
)}
|
103
103
|
</div>
|
104
104
|
);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import DataTable, {Column, Settings, SortOrder} from '@yandex-cloud/react-data-table';
|
4
|
-
import {
|
4
|
+
import {Popover, PopoverBehavior} from '@yandex-cloud/uikit';
|
5
5
|
//@ts-ignore
|
6
6
|
import {VisibleEntities} from '../../../store/reducers/storage';
|
7
7
|
import Pdisk from '../Pdisk/Pdisk';
|
@@ -71,13 +71,13 @@ function StorageNodes({data, tableSettings, visibleEntities}: StorageGroupsProps
|
|
71
71
|
render: ({value}) => {
|
72
72
|
return (
|
73
73
|
<div className={b('tooltip-wrapper')}>
|
74
|
-
<
|
74
|
+
<Popover
|
75
75
|
content={<span className={b('tooltip')}>{value as string}</span>}
|
76
76
|
placement={['right']}
|
77
|
-
behavior={
|
77
|
+
behavior={PopoverBehavior.Immediate}
|
78
78
|
>
|
79
79
|
<span className={b('pool-name')}>{value as string}</span>
|
80
|
-
</
|
80
|
+
</Popover>
|
81
81
|
</div>
|
82
82
|
);
|
83
83
|
},
|
@@ -46,9 +46,9 @@
|
|
46
46
|
&__title {
|
47
47
|
margin-right: 16px;
|
48
48
|
|
49
|
-
font-size: var(--yc-text-
|
49
|
+
font-size: var(--yc-text-body-2-font-size);
|
50
50
|
font-weight: 500;
|
51
|
-
line-height: var(--yc-text-
|
51
|
+
line-height: var(--yc-text-body-2-line-height);
|
52
52
|
text-transform: uppercase;
|
53
53
|
}
|
54
54
|
|
@@ -84,9 +84,9 @@
|
|
84
84
|
&__top-label {
|
85
85
|
margin-right: 16px;
|
86
86
|
|
87
|
-
font-size: var(--yc-text-
|
87
|
+
font-size: var(--yc-text-body-2-font-size);
|
88
88
|
font-weight: 500;
|
89
|
-
line-height: var(--yc-text-
|
89
|
+
line-height: var(--yc-text-body-2-line-height);
|
90
90
|
text-transform: uppercase;
|
91
91
|
}
|
92
92
|
}
|
@@ -12,8 +12,7 @@ import {
|
|
12
12
|
import {showTooltip, hideTooltip} from '../../store/reducers/tooltip';
|
13
13
|
|
14
14
|
import Tablet from '../../components/Tablet/Tablet';
|
15
|
-
import {Loader} from '@yandex-cloud/uikit';
|
16
|
-
import {Select} from '@yandex-cloud/uikit/build/esm/components/unstable/Select';
|
15
|
+
import {Loader, Select} from '@yandex-cloud/uikit';
|
17
16
|
import ReactList from 'react-list';
|
18
17
|
import {AutoFetcher} from '../../utils/autofetcher';
|
19
18
|
|
@@ -5,8 +5,7 @@ import cn from 'bem-cn-lite';
|
|
5
5
|
import qs from 'qs';
|
6
6
|
import _ from 'lodash';
|
7
7
|
|
8
|
-
import {Loader} from '@yandex-cloud/uikit';
|
9
|
-
import {Select} from '@yandex-cloud/uikit/build/esm/components/unstable/Select';
|
8
|
+
import {Loader, Select} from '@yandex-cloud/uikit';
|
10
9
|
import ReactList from 'react-list';
|
11
10
|
|
12
11
|
import Tablet from '../../components/Tablet/Tablet';
|
@@ -10,8 +10,8 @@
|
|
10
10
|
display: flex;
|
11
11
|
flex-direction: column;
|
12
12
|
|
13
|
-
font-size: var(--yc-text-body-font-size);
|
14
|
-
line-height: var(--yc-text-body-line-height);
|
13
|
+
font-size: var(--yc-text-body-1-font-size);
|
14
|
+
line-height: var(--yc-text-body-1-line-height);
|
15
15
|
}
|
16
16
|
|
17
17
|
&__node-meta {
|
@@ -38,8 +38,8 @@
|
|
38
38
|
}
|
39
39
|
|
40
40
|
&__text {
|
41
|
-
font-size: var(--yc-text-body-font-size);
|
42
|
-
line-height: var(--yc-text-body-line-height);
|
41
|
+
font-size: var(--yc-text-body-1-font-size);
|
42
|
+
line-height: var(--yc-text-body-1-line-height);
|
43
43
|
|
44
44
|
color: var(--yc-color-text-primary);
|
45
45
|
|
@@ -3,7 +3,7 @@ import qs from 'qs';
|
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
import {Link} from 'react-router-dom';
|
5
5
|
import {useDispatch, useSelector} from 'react-redux';
|
6
|
-
import {
|
6
|
+
import {useLocation} from 'react-router';
|
7
7
|
|
8
8
|
import {Switch, Tabs} from '@yandex-cloud/uikit';
|
9
9
|
|
@@ -34,8 +34,10 @@ import {TenantGeneralTabsIds, TenantTabsGroups} from '../TenantPages';
|
|
34
34
|
import {GeneralPagesIds, DATABASE_PAGES, TABLE_PAGES, DIR_PAGES} from './DiagnosticsPages';
|
35
35
|
//@ts-ignore
|
36
36
|
import {enableAutorefresh, disableAutorefresh} from '../../../store/reducers/schema';
|
37
|
+
import {setTopLevelTab, setDiagnosticsTab} from '../../../store/reducers/tenant';
|
37
38
|
|
38
39
|
import './Diagnostics.scss';
|
40
|
+
|
39
41
|
interface DiagnosticsProps {
|
40
42
|
type: string;
|
41
43
|
additionalTenantInfo?: any;
|
@@ -51,16 +53,17 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
51
53
|
currentSchema: currentItem = {},
|
52
54
|
autorefresh,
|
53
55
|
} = useSelector((state: any) => state.schema);
|
56
|
+
const {
|
57
|
+
diagnosticsTab = GeneralPagesIds.overview,
|
58
|
+
} = useSelector((state: any) => state.tenant);
|
54
59
|
|
55
60
|
const location = useLocation();
|
56
61
|
|
57
|
-
const history = useHistory();
|
58
|
-
|
59
62
|
const queryParams = qs.parse(location.search, {
|
60
63
|
ignoreQueryPrefix: true,
|
61
64
|
});
|
62
65
|
|
63
|
-
const {name: tenantName
|
66
|
+
const {name: tenantName} = queryParams;
|
64
67
|
|
65
68
|
const isDatabase = currentSchemaPath === tenantName;
|
66
69
|
|
@@ -76,25 +79,20 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
76
79
|
pages = TABLE_PAGES;
|
77
80
|
}
|
78
81
|
return pages;
|
79
|
-
}, [props.type]);
|
82
|
+
}, [props.type, isDatabase]);
|
80
83
|
|
81
84
|
const forwardToDiagnosticTab = (tab: GeneralPagesIds) => {
|
82
|
-
|
83
|
-
createHref(routes.tenant, undefined, {
|
84
|
-
...queryParams,
|
85
|
-
[TenantTabsGroups.generalTab]: tab,
|
86
|
-
}),
|
87
|
-
);
|
85
|
+
dispatch(setDiagnosticsTab(tab));
|
88
86
|
};
|
89
87
|
const activeTab = useMemo(() => {
|
90
|
-
if (pages.find((el) => el.id ===
|
91
|
-
return
|
88
|
+
if (pages.find((el) => el.id === diagnosticsTab)) {
|
89
|
+
return diagnosticsTab;
|
92
90
|
} else {
|
93
91
|
const newPage = pages[0].id;
|
94
92
|
forwardToDiagnosticTab(newPage);
|
95
93
|
return newPage;
|
96
94
|
}
|
97
|
-
}, [pages,
|
95
|
+
}, [pages, diagnosticsTab]);
|
98
96
|
|
99
97
|
const onAutorefreshToggle = (value: boolean) => {
|
100
98
|
if (value) {
|
@@ -105,12 +103,7 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
105
103
|
};
|
106
104
|
|
107
105
|
const forwardToGeneralTab = (tab: TenantGeneralTabsIds) => {
|
108
|
-
|
109
|
-
createHref(routes.tenant, undefined, {
|
110
|
-
...queryParams,
|
111
|
-
[TenantTabsGroups.general]: tab,
|
112
|
-
}),
|
113
|
-
);
|
106
|
+
dispatch(setTopLevelTab(tab));
|
114
107
|
};
|
115
108
|
|
116
109
|
const renderTabContent = () => {
|
@@ -118,7 +111,7 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
118
111
|
|
119
112
|
const tenantNameString = tenantName as string;
|
120
113
|
|
121
|
-
switch (
|
114
|
+
switch (diagnosticsTab) {
|
122
115
|
case GeneralPagesIds.overview: {
|
123
116
|
return (
|
124
117
|
<DetailedOverview
|
@@ -171,6 +164,7 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
171
164
|
<div className={b('header-wrapper')}>
|
172
165
|
<div className={b('tabs')}>
|
173
166
|
<Tabs
|
167
|
+
size="l"
|
174
168
|
items={pages}
|
175
169
|
activeTab={activeTab as string}
|
176
170
|
wrapTo={({id}, node) => {
|
@@ -9,8 +9,8 @@
|
|
9
9
|
max-width: 1305px;
|
10
10
|
height: 100%;
|
11
11
|
|
12
|
-
font-size: var(--yc-text-
|
13
|
-
line-height: var(--yc-text-
|
12
|
+
font-size: var(--yc-text-body-2-font-size);
|
13
|
+
line-height: var(--yc-text-body-2-line-height);
|
14
14
|
|
15
15
|
&__nodes-row {
|
16
16
|
display: flex;
|
@@ -74,8 +74,8 @@
|
|
74
74
|
&__nodes-title {
|
75
75
|
margin: 0 0 15px;
|
76
76
|
|
77
|
-
font-size: var(--yc-text-
|
78
|
-
line-height: var(--yc-text-
|
77
|
+
font-size: var(--yc-text-body-2-font-size);
|
78
|
+
line-height: var(--yc-text-body-2-line-height);
|
79
79
|
|
80
80
|
color: var(--yc-color-text-secondary);
|
81
81
|
border-bottom: 1px solid var(--yc-color-base-generic-accent);
|
@@ -90,9 +90,9 @@
|
|
90
90
|
&__title {
|
91
91
|
margin: 20px 0;
|
92
92
|
|
93
|
-
font-size: var(--yc-text-body-font-size);
|
93
|
+
font-size: var(--yc-text-body-1-font-size);
|
94
94
|
font-weight: 500;
|
95
|
-
line-height: var(--yc-text-body-line-height);
|
95
|
+
line-height: var(--yc-text-body-1-line-height);
|
96
96
|
}
|
97
97
|
|
98
98
|
&__checkbox-wrapper {
|
@@ -46,9 +46,9 @@
|
|
46
46
|
}
|
47
47
|
|
48
48
|
&__collapse-title {
|
49
|
-
font-size: var(--yc-text-
|
49
|
+
font-size: var(--yc-text-body-2-font-size);
|
50
50
|
font-weight: 500;
|
51
|
-
line-height: var(--yc-text-
|
51
|
+
line-height: var(--yc-text-body-2-line-height);
|
52
52
|
//text-transform: uppercase;
|
53
53
|
}
|
54
54
|
|
@@ -75,8 +75,8 @@
|
|
75
75
|
&__section-title {
|
76
76
|
margin-bottom: 20px;
|
77
77
|
|
78
|
-
font-size: var(--yc-text-
|
78
|
+
font-size: var(--yc-text-body-2-font-size);
|
79
79
|
font-weight: 500;
|
80
|
-
line-height: var(--yc-text-
|
80
|
+
line-height: var(--yc-text-body-2-line-height);
|
81
81
|
}
|
82
82
|
}
|
@@ -22,8 +22,8 @@
|
|
22
22
|
}
|
23
23
|
|
24
24
|
&__text {
|
25
|
-
font-size: var(--yc-text-body-font-size);
|
26
|
-
line-height: var(--yc-text-body-line-height);
|
25
|
+
font-size: var(--yc-text-body-1-font-size);
|
26
|
+
line-height: var(--yc-text-body-1-line-height);
|
27
27
|
|
28
28
|
color: var(--yc-color-text-primary);
|
29
29
|
|
@@ -16,23 +16,22 @@
|
|
16
16
|
padding: 13px 20px 0;
|
17
17
|
|
18
18
|
box-shadow: inset 0 -1px 0 0 var(--yc-color-line-generic);
|
19
|
-
@include body3-typography();
|
20
19
|
.yc-tabs {
|
21
20
|
box-shadow: unset;
|
22
21
|
}
|
23
22
|
}
|
24
23
|
&__tab {
|
25
24
|
text-decoration: none;
|
26
|
-
}
|
27
25
|
|
28
|
-
|
29
|
-
|
26
|
+
// fix for bug in uikit, gap is set for yc-tabs__item:not(:last-child),
|
27
|
+
// it doesn't work for wrapped items
|
28
|
+
// feel free to remove if the bug is fixed
|
29
|
+
&:not(:last-child) {
|
30
|
+
margin-right: var(--yc-tabs-gap);
|
31
|
+
}
|
30
32
|
}
|
31
33
|
|
32
|
-
&
|
34
|
+
&__loader {
|
33
35
|
display: flex;
|
34
|
-
gap: 5px;
|
35
|
-
|
36
|
-
align-items: center;
|
37
36
|
}
|
38
37
|
}
|
@@ -38,21 +38,11 @@ function ObjectGeneral(props: ObjectGeneralProps) {
|
|
38
38
|
const {name: tenantName, general: generalTab} = queryParams;
|
39
39
|
|
40
40
|
const renderTabs = () => {
|
41
|
-
const pages = TENANT_GENERAL_TABS.map((page) => {
|
42
|
-
return {
|
43
|
-
...page,
|
44
|
-
title: (
|
45
|
-
<div className={b('tab-label')}>
|
46
|
-
{page.icon}
|
47
|
-
{page.title}
|
48
|
-
</div>
|
49
|
-
),
|
50
|
-
};
|
51
|
-
});
|
52
41
|
return (
|
53
42
|
<div className={b('tabs')}>
|
54
43
|
<Tabs
|
55
|
-
|
44
|
+
size="xl"
|
45
|
+
items={TENANT_GENERAL_TABS}
|
56
46
|
activeTab={generalTab as string}
|
57
47
|
wrapTo={({id}, node) => {
|
58
48
|
const path = createHref(routes.tenant, undefined, {
|
@@ -6,7 +6,7 @@ import {useHistory, useLocation} from 'react-router';
|
|
6
6
|
import qs from 'qs';
|
7
7
|
import _ from 'lodash';
|
8
8
|
|
9
|
-
import {Button,
|
9
|
+
import {Button, HelpPopover, Loader, Tabs} from '@yandex-cloud/uikit';
|
10
10
|
|
11
11
|
import SplitPane from '../../../components/SplitPane';
|
12
12
|
import {SchemaTree} from '../Schema/SchemaTree/SchemaTree';
|
@@ -36,6 +36,7 @@ import {
|
|
36
36
|
PaneVisibilityToggleButtons,
|
37
37
|
} from '../utils/paneVisibilityToggleHelpers';
|
38
38
|
import {setShowPreview} from '../../../store/reducers/schema';
|
39
|
+
import {setTopLevelTab} from '../../../store/reducers/tenant';
|
39
40
|
|
40
41
|
import './ObjectSummary.scss';
|
41
42
|
|
@@ -126,6 +127,7 @@ function ObjectSummary(props: ObjectSummaryProps) {
|
|
126
127
|
return (
|
127
128
|
<div className={b('tabs')}>
|
128
129
|
<Tabs
|
130
|
+
size="l"
|
129
131
|
items={tabsItems}
|
130
132
|
activeTab={infoTab as string}
|
131
133
|
wrapTo={({id}, node) => {
|
@@ -222,12 +224,7 @@ function ObjectSummary(props: ObjectSummaryProps) {
|
|
222
224
|
|
223
225
|
const onOpenPreview = () => {
|
224
226
|
dispatch(setShowPreview(true));
|
225
|
-
|
226
|
-
createHref(routes.tenant, undefined, {
|
227
|
-
...queryParams,
|
228
|
-
[TenantTabsGroups.general]: TenantGeneralTabsIds.query,
|
229
|
-
}),
|
230
|
-
);
|
227
|
+
dispatch(setTopLevelTab(TenantGeneralTabsIds.query));
|
231
228
|
};
|
232
229
|
|
233
230
|
const renderCommonInfoControls = () => {
|
@@ -264,7 +261,7 @@ function ObjectSummary(props: ObjectSummaryProps) {
|
|
264
261
|
<div className={b('entity-type')}>{type}</div>
|
265
262
|
) : (
|
266
263
|
<div className={b('entity-type', {error: true})}>
|
267
|
-
<
|
264
|
+
<HelpPopover content={message} offset={{left: 0}} />
|
268
265
|
</div>
|
269
266
|
);
|
270
267
|
};
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import {useDispatch} from 'react-redux';
|
2
|
-
import {useHistory} from 'react-router';
|
3
2
|
|
4
3
|
import {NavigationTree} from 'ydb-ui-components';
|
5
4
|
|
@@ -26,7 +25,6 @@ export function SchemaTree(props: SchemaTreeProps) {
|
|
26
25
|
} = props;
|
27
26
|
|
28
27
|
const dispatch = useDispatch();
|
29
|
-
const history = useHistory();
|
30
28
|
|
31
29
|
const fetchPath = (path: string) => window.api.getSchema(
|
32
30
|
{path},
|
@@ -55,7 +53,7 @@ export function SchemaTree(props: SchemaTreeProps) {
|
|
55
53
|
collapsed: false,
|
56
54
|
}}
|
57
55
|
fetchPath={fetchPath}
|
58
|
-
getActions={getActions(dispatch,
|
56
|
+
getActions={getActions(dispatch, handleActivePathUpdate)}
|
59
57
|
activePath={currentPath}
|
60
58
|
onActivePathUpdate={handleActivePathUpdate}
|
61
59
|
cache={false}
|
@@ -3,8 +3,8 @@
|
|
3
3
|
.tenant-page {
|
4
4
|
overflow: hidden;
|
5
5
|
|
6
|
-
font-size: var(--yc-text-
|
7
|
-
line-height: var(--yc-text-
|
6
|
+
font-size: var(--yc-text-body-2-font-size);
|
7
|
+
line-height: var(--yc-text-body-2-line-height);
|
8
8
|
@include flex-container();
|
9
9
|
|
10
10
|
.yc-tabs {
|
@@ -1,13 +1,11 @@
|
|
1
|
-
import qs from 'qs';
|
2
1
|
import {Dispatch} from 'react';
|
3
|
-
import {History} from 'history';
|
4
2
|
import type {NavigationTreeNodeType} from 'ydb-ui-components';
|
5
3
|
|
6
|
-
import routes, {createHref} from '../../../routes';
|
7
4
|
import {changeUserInput} from '../../../store/reducers/executeQuery';
|
8
5
|
import {setShowPreview} from '../../../store/reducers/schema';
|
6
|
+
import {setTopLevelTab} from '../../../store/reducers/tenant';
|
9
7
|
import createToast from '../../../utils/createToast';
|
10
|
-
import {TenantGeneralTabsIds
|
8
|
+
import {TenantGeneralTabsIds} from '../TenantPages';
|
11
9
|
|
12
10
|
const createTableTemplate = (path: string) => {
|
13
11
|
return `CREATE TABLE \`${path}/my_table\`
|
@@ -36,29 +34,16 @@ VALUES ( );`;
|
|
36
34
|
|
37
35
|
export const getActions = (
|
38
36
|
dispatch: Dispatch<any>,
|
39
|
-
history: History<unknown>,
|
40
37
|
setActivePath: (path: string) => void,
|
41
38
|
) =>
|
42
39
|
(path: string, type: NavigationTreeNodeType) => {
|
43
|
-
const queryParams = qs.parse(location.search, {
|
44
|
-
ignoreQueryPrefix: true,
|
45
|
-
});
|
46
|
-
|
47
40
|
const switchTabToQuery = () => {
|
48
|
-
|
49
|
-
createHref(routes.tenant, undefined, {
|
50
|
-
...queryParams,
|
51
|
-
[TenantTabsGroups.general]: TenantGeneralTabsIds.query,
|
52
|
-
}),
|
53
|
-
);
|
41
|
+
dispatch(setTopLevelTab(TenantGeneralTabsIds.query));
|
54
42
|
};
|
55
43
|
|
56
44
|
const onCreateTableClick = () => {
|
57
45
|
dispatch(changeUserInput({input: createTableTemplate(path)}));
|
58
46
|
switchTabToQuery();
|
59
|
-
// here and in the other handlers this should be called after switching tab:
|
60
|
-
// redux-location-state catches the history.push event from the tab switching
|
61
|
-
// before active path updates in url, preventing its update at all
|
62
47
|
setActivePath(path);
|
63
48
|
};
|
64
49
|
|
@@ -20,9 +20,9 @@
|
|
20
20
|
&__title {
|
21
21
|
margin-right: 16px;
|
22
22
|
|
23
|
-
font-size: var(--yc-text-
|
23
|
+
font-size: var(--yc-text-body-2-font-size);
|
24
24
|
font-weight: 500;
|
25
|
-
line-height: var(--yc-text-
|
25
|
+
line-height: var(--yc-text-body-2-line-height);
|
26
26
|
text-transform: uppercase;
|
27
27
|
}
|
28
28
|
|
@@ -27,9 +27,9 @@
|
|
27
27
|
&__title {
|
28
28
|
margin-right: 16px;
|
29
29
|
|
30
|
-
font-size: var(--yc-text-
|
30
|
+
font-size: var(--yc-text-body-2-font-size);
|
31
31
|
font-weight: 500;
|
32
|
-
line-height: var(--yc-text-
|
32
|
+
line-height: var(--yc-text-body-2-line-height);
|
33
33
|
text-transform: uppercase;
|
34
34
|
}
|
35
35
|
|
@@ -3,6 +3,8 @@ import '../../services/api';
|
|
3
3
|
import _ from 'lodash';
|
4
4
|
|
5
5
|
const FETCH_TENANT = createRequestActionTypes('tenant', 'FETCH_TENANT');
|
6
|
+
const SET_TOP_LEVEL_TAB = 'tenant/SET_TOP_LEVEL_TAB';
|
7
|
+
const SET_DIAGNOSTICS_TAB = 'tenant/SET_DIAGNOSTICS_TAB';
|
6
8
|
|
7
9
|
const tenantReducer = (state = {loading: false, tenant: {}}, action) => {
|
8
10
|
switch (action.type) {
|
@@ -41,6 +43,20 @@ const tenantReducer = (state = {loading: false, tenant: {}}, action) => {
|
|
41
43
|
};
|
42
44
|
}
|
43
45
|
|
46
|
+
case SET_TOP_LEVEL_TAB: {
|
47
|
+
return {
|
48
|
+
...state,
|
49
|
+
topLevelTab: action.data,
|
50
|
+
};
|
51
|
+
}
|
52
|
+
|
53
|
+
case SET_DIAGNOSTICS_TAB: {
|
54
|
+
return {
|
55
|
+
...state,
|
56
|
+
diagnosticsTab: action.data,
|
57
|
+
};
|
58
|
+
}
|
59
|
+
|
44
60
|
default:
|
45
61
|
return state;
|
46
62
|
}
|
@@ -73,4 +89,18 @@ export const getTenantInfo = ({path}) => {
|
|
73
89
|
});
|
74
90
|
};
|
75
91
|
|
92
|
+
export function setTopLevelTab(tab) {
|
93
|
+
return {
|
94
|
+
type: SET_TOP_LEVEL_TAB,
|
95
|
+
data: tab,
|
96
|
+
};
|
97
|
+
}
|
98
|
+
|
99
|
+
export function setDiagnosticsTab(tab) {
|
100
|
+
return {
|
101
|
+
type: SET_DIAGNOSTICS_TAB,
|
102
|
+
data: tab,
|
103
|
+
};
|
104
|
+
}
|
105
|
+
|
76
106
|
export default tenantReducer;
|