ydb-embedded-ui 4.25.0 → 4.27.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/README.md +39 -0
- package/dist/components/BasicNodeViewer/BasicNodeViewer.scss +3 -11
- package/dist/components/CircularProgressBar/CircularProgressBar.scss +4 -4
- package/dist/components/DateRange/DateRange.scss +3 -3
- package/dist/components/DiagnosticCard/DiagnosticCard.scss +4 -4
- package/dist/components/Divider/Divider.scss +1 -1
- package/dist/components/EmptyState/EmptyState.scss +8 -9
- package/dist/components/EntityStatus/EntityStatus.scss +19 -29
- package/dist/components/ExternalLinkWithIcon/ExternalLinkWithIcon.tsx +2 -2
- package/dist/components/FullNodeViewer/FullNodeViewer.scss +1 -4
- package/dist/components/Fullscreen/Fullscreen.scss +2 -9
- package/dist/components/Icon/Icon.tsx +1 -5
- package/dist/components/InfoViewer/InfoViewer.scss +6 -6
- package/dist/components/LabelWithPopover/LabelWithPopover.tsx +3 -2
- package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +2 -2
- package/dist/components/PoolBar/PoolBar.scss +6 -6
- package/dist/components/PoolUsage/PoolUsage.scss +15 -17
- package/dist/components/ProgressViewer/ProgressViewer.scss +17 -16
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.scss +3 -3
- package/dist/components/SpeedMultiMeter/SpeedMultiMeter.scss +5 -5
- package/dist/components/SpeedMultiMeter/SpeedMultiMeter.tsx +12 -13
- package/dist/components/SplitPane/SplitPane.scss +5 -5
- package/dist/components/TableSkeleton/TableSkeleton.scss +1 -1
- package/dist/components/Tablet/Tablet.scss +10 -10
- package/dist/components/TabletsStatistic/TabletsStatistic.scss +13 -13
- package/dist/components/Tag/Tag.scss +3 -3
- package/dist/components/TruncatedQuery/TruncatedQuery.scss +1 -1
- package/dist/components/UsageLabel/UsageLabel.scss +2 -2
- package/dist/components/UsageLabel/UsageLabel.tsx +1 -1
- package/dist/components/VirtualTable/VirtualTable.scss +3 -3
- package/dist/containers/App/App.scss +20 -24
- package/dist/containers/App/Content.js +5 -4
- package/dist/containers/AsideNavigation/AsideNavigation.scss +1 -4
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +12 -27
- package/dist/containers/Authentication/Authentication.scss +4 -4
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +4 -6
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +1 -1
- package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.scss +3 -3
- package/dist/containers/Cluster/VersionsBar/VersionsBar.tsx +1 -1
- package/dist/containers/Header/Header.scss +1 -1
- package/dist/containers/Heatmap/Heatmap.scss +3 -5
- package/dist/containers/Heatmap/Histogram/Histogram.scss +6 -6
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +10 -13
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +1 -1
- package/dist/containers/ReduxTooltip/ReduxTooltip.js +1 -1
- package/dist/containers/ReduxTooltip/ReduxTooltip.scss +1 -18
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.scss +23 -23
- package/dist/containers/Storage/PDisk/PDisk.scss +4 -4
- package/dist/containers/Storage/PDiskPopup/PDiskPopup.tsx +1 -1
- package/dist/containers/Storage/Storage.scss +1 -1
- package/dist/containers/Storage/StorageGroups/StorageGroups.scss +1 -1
- package/dist/containers/Storage/UsageFilter/UsageFilter.scss +7 -6
- package/dist/containers/Storage/VDiskPopup/VDiskPopup.scss +1 -1
- package/dist/containers/Storage/VDiskPopup/VDiskPopup.tsx +1 -1
- package/dist/containers/Tablet/Tablet.scss +5 -5
- package/dist/containers/TabletsFilters/TabletsFilters.scss +2 -3
- package/dist/containers/Tenant/Acl/Acl.scss +1 -15
- package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.scss +0 -4
- package/dist/containers/Tenant/Diagnostics/Consumers/TopicStats/ConsumersTopicStats.scss +5 -4
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +0 -6
- package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +2 -2
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +2 -2
- package/dist/containers/Tenant/Diagnostics/Network/Network.scss +8 -10
- package/dist/containers/Tenant/Diagnostics/Network/NodeNetwork/NodeNetwork.scss +8 -8
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.scss +1 -5
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.tsx +1 -4
- package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.tsx +0 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss +12 -12
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/IssuesViewer/IssueTree.scss +1 -36
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/IssuesViewer/IssueTreeItem/IssueTreeItem.scss +3 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricCard/MetricCard.scss +7 -7
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +2 -2
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.scss +1 -1
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +4 -8
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +2 -1
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.scss +3 -6
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.scss +2 -5
- package/dist/containers/Tenant/Query/Issues/Issues.scss +11 -14
- package/dist/containers/Tenant/Query/Preview/Preview.scss +3 -7
- package/dist/containers/Tenant/Query/QueryDuration/QueryDuration.scss +1 -1
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +4 -8
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.scss +3 -9
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.scss +0 -9
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.tsx +11 -13
- package/dist/containers/Tenant/Query/SaveQuery/SaveQuery.scss +5 -5
- package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.tsx +3 -3
- package/dist/containers/Tenant/Tenant.scss +1 -2
- package/dist/containers/Tenant/utils/schemaControls.tsx +2 -2
- package/dist/containers/UserSettings/Setting.tsx +5 -1
- package/dist/containers/Versions/GroupedNodesTree/GroupedNodesTree.scss +2 -3
- package/dist/containers/Versions/NodesTreeTitle/NodesTreeTitle.scss +1 -1
- package/dist/containers/Versions/NodesTreeTitle/NodesTreeTitle.tsx +1 -1
- package/dist/index.tsx +1 -0
- package/dist/services/api.ts +4 -3
- package/dist/services/settings.ts +113 -0
- package/dist/store/reducers/executeQuery.ts +6 -3
- package/dist/store/reducers/settings/settings.ts +7 -74
- package/dist/store/reducers/settings/types.ts +4 -3
- package/dist/styles/mixins.scss +37 -35
- package/dist/styles/themes/dark-hc.scss +296 -0
- package/dist/styles/themes/dark.scss +297 -0
- package/dist/styles/themes/light-hc.scss +289 -0
- package/dist/styles/themes/light.scss +291 -0
- package/dist/styles/themes.scss +73 -0
- package/dist/types/window.d.ts +2 -2
- package/dist/utils/hooks/useSetting.ts +6 -7
- package/dist/utils/i18n/i18n.ts +2 -2
- package/package.json +7 -6
- package/dist/containers/App/TipPopup/TipPopup.js +0 -66
- package/dist/containers/App/TipPopup/TipPopup.scss +0 -46
- package/dist/utils/settings.ts +0 -13
@@ -1,22 +1,21 @@
|
|
1
1
|
import {useCallback} from 'react';
|
2
2
|
import {useDispatch} from 'react-redux';
|
3
3
|
|
4
|
-
import {
|
4
|
+
import {getSettingValue, setSettingValue} from '../../store/reducers/settings/settings';
|
5
5
|
|
6
6
|
import {useTypedSelector} from './useTypedSelector';
|
7
7
|
|
8
8
|
export const useSetting = <T>(key: string, defaultValue?: T): [T, (value: T) => void] => {
|
9
9
|
const dispatch = useDispatch();
|
10
10
|
|
11
|
-
const settingValue
|
12
|
-
|
13
|
-
|
11
|
+
const settingValue = useTypedSelector((state) => {
|
12
|
+
// Since we type setter value as T, we assume that received value is also T
|
13
|
+
return (getSettingValue(state, key) ?? defaultValue) as T;
|
14
|
+
});
|
14
15
|
|
15
16
|
const setValue = useCallback(
|
16
17
|
(value: T) => {
|
17
|
-
|
18
|
-
|
19
|
-
dispatch(setSettingValue(key, preparedValue));
|
18
|
+
dispatch(setSettingValue(key, value));
|
20
19
|
},
|
21
20
|
[dispatch, key],
|
22
21
|
);
|
package/dist/utils/i18n/i18n.ts
CHANGED
@@ -3,7 +3,7 @@ import {configure as configureUiKit} from '@gravity-ui/uikit';
|
|
3
3
|
import {configure as configureYdbUiComponents} from 'ydb-ui-components';
|
4
4
|
|
5
5
|
import {LANGUAGE_KEY} from '../constants';
|
6
|
-
import {
|
6
|
+
import {settingsManager} from '../../services/settings';
|
7
7
|
|
8
8
|
enum Lang {
|
9
9
|
En = 'en',
|
@@ -11,7 +11,7 @@ enum Lang {
|
|
11
11
|
}
|
12
12
|
|
13
13
|
const defaultLang = Lang.En;
|
14
|
-
const currentLang =
|
14
|
+
const currentLang = settingsManager.readUserSettingsValue(LANGUAGE_KEY, defaultLang) as Lang;
|
15
15
|
|
16
16
|
const i18n = new I18N();
|
17
17
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ydb-embedded-ui",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.27.0",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -10,9 +10,10 @@
|
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"@gravity-ui/axios-wrapper": "^1.3.0",
|
13
|
+
"@gravity-ui/components": "^2.9.1",
|
13
14
|
"@gravity-ui/date-utils": "^1.1.1",
|
14
15
|
"@gravity-ui/i18n": "^1.0.0",
|
15
|
-
"@gravity-ui/navigation": "^
|
16
|
+
"@gravity-ui/navigation": "^1.8.0",
|
16
17
|
"@gravity-ui/paranoid": "^1.4.0",
|
17
18
|
"@gravity-ui/react-data-table": "^1.0.3",
|
18
19
|
"@types/react": "^17.0.58",
|
@@ -40,7 +41,7 @@
|
|
40
41
|
"reselect": "4.1.6",
|
41
42
|
"sass": "1.32.8",
|
42
43
|
"web-vitals": "1.1.2",
|
43
|
-
"ydb-ui-components": "^3.
|
44
|
+
"ydb-ui-components": "^3.5.0"
|
44
45
|
},
|
45
46
|
"scripts": {
|
46
47
|
"start": "react-app-rewired start",
|
@@ -107,11 +108,11 @@
|
|
107
108
|
"@commitlint/cli": "^15.0.0",
|
108
109
|
"@commitlint/config-conventional": "^15.0.0",
|
109
110
|
"@gravity-ui/eslint-config": "^1.0.2",
|
110
|
-
"@gravity-ui/icons": "^2.
|
111
|
+
"@gravity-ui/icons": "^2.8.1",
|
111
112
|
"@gravity-ui/prettier-config": "^1.0.1",
|
112
113
|
"@gravity-ui/stylelint-config": "^1.0.1",
|
113
114
|
"@gravity-ui/tsconfig": "^1.0.0",
|
114
|
-
"@gravity-ui/uikit": "^
|
115
|
+
"@gravity-ui/uikit": "^5.24.0",
|
115
116
|
"@playwright/test": "^1.31.1",
|
116
117
|
"@testing-library/jest-dom": "^5.15.0",
|
117
118
|
"@testing-library/react": "^11.2.7",
|
@@ -139,6 +140,6 @@
|
|
139
140
|
"url": "^0.11.0"
|
140
141
|
},
|
141
142
|
"peerDependencies": {
|
142
|
-
"@gravity-ui/uikit": "^
|
143
|
+
"@gravity-ui/uikit": "^5.24.0"
|
143
144
|
}
|
144
145
|
}
|
@@ -1,66 +0,0 @@
|
|
1
|
-
import {useState, useEffect} from 'react';
|
2
|
-
import cn from 'bem-cn-lite';
|
3
|
-
|
4
|
-
import {Button, Icon, Popup} from '@gravity-ui/uikit';
|
5
|
-
import closeIcon from '../../../assets/icons/close.svg';
|
6
|
-
|
7
|
-
import {DATA_QA_TUNE_COLUMNS_POPUP} from '../../../utils/constants';
|
8
|
-
|
9
|
-
import './TipPopup.scss';
|
10
|
-
|
11
|
-
const b = cn('km-tip-popup');
|
12
|
-
|
13
|
-
const DATA = {
|
14
|
-
[DATA_QA_TUNE_COLUMNS_POPUP]: {
|
15
|
-
id: 1,
|
16
|
-
title: 'New feature: column selector',
|
17
|
-
description: 'Now you can easily tune columns visibility! 🚀',
|
18
|
-
},
|
19
|
-
};
|
20
|
-
|
21
|
-
function TipPopup({dbChangePopupVisibility, dataAttribute, initialIsPopupVisible}) {
|
22
|
-
const [isPopupVisible, setIsPopupVisible] = useState(initialIsPopupVisible ?? true);
|
23
|
-
const [anchor, setAnchor] = useState(null);
|
24
|
-
|
25
|
-
useEffect(() => {
|
26
|
-
const interval = setInterval(() => {
|
27
|
-
const anchor = document.querySelector(`[data-qa='${dataAttribute}']`);
|
28
|
-
if (anchor) {
|
29
|
-
setAnchor(anchor);
|
30
|
-
clearInterval(interval);
|
31
|
-
}
|
32
|
-
}, 200);
|
33
|
-
return () => {
|
34
|
-
clearInterval(interval);
|
35
|
-
};
|
36
|
-
}, []);
|
37
|
-
|
38
|
-
const onClosePopupClick = () => {
|
39
|
-
dbChangePopupVisibility(false);
|
40
|
-
setIsPopupVisible(false);
|
41
|
-
};
|
42
|
-
|
43
|
-
const tipData = DATA[dataAttribute];
|
44
|
-
|
45
|
-
return tipData && anchor ? (
|
46
|
-
<Popup
|
47
|
-
className={b('wrapper')}
|
48
|
-
anchorRef={{current: anchor}}
|
49
|
-
open={isPopupVisible}
|
50
|
-
placement={['bottom-end']}
|
51
|
-
hasArrow
|
52
|
-
>
|
53
|
-
<div className={b()}>
|
54
|
-
<div className={b('title')}>{tipData.title}</div>
|
55
|
-
<div className={b('content')}>{tipData.description}</div>
|
56
|
-
<div className={b('cross-icon-wrapper')}>
|
57
|
-
<Button view="flat-secondary" onClick={onClosePopupClick}>
|
58
|
-
<Icon data={closeIcon} size={10} className={b('cross-icon')} />
|
59
|
-
</Button>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
</Popup>
|
63
|
-
) : null;
|
64
|
-
}
|
65
|
-
|
66
|
-
export default TipPopup;
|
@@ -1,46 +0,0 @@
|
|
1
|
-
.km-tip-popup {
|
2
|
-
position: relative;
|
3
|
-
z-index: 1;
|
4
|
-
|
5
|
-
max-width: 250px;
|
6
|
-
padding: 16px 20px 20px 16px;
|
7
|
-
|
8
|
-
font-size: 13px;
|
9
|
-
line-height: 18px;
|
10
|
-
|
11
|
-
color: var(--yc-color-text-primary);
|
12
|
-
border-radius: 4px;
|
13
|
-
background-color: var(--yc-color-base-background);
|
14
|
-
|
15
|
-
&__wrapper {
|
16
|
-
border: 1px solid var(--yc-color-text-info) !important;
|
17
|
-
border-radius: 4px;
|
18
|
-
|
19
|
-
.popup2__tail {
|
20
|
-
border: 1px solid var(--yc-color-text-info) !important;
|
21
|
-
background-color: var(--yc-color-base-background);
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
&__cross-icon-wrapper {
|
26
|
-
position: absolute;
|
27
|
-
top: 16px;
|
28
|
-
right: 12px;
|
29
|
-
}
|
30
|
-
|
31
|
-
&__cross-icon {
|
32
|
-
color: var(--yc-color-text-secondary);
|
33
|
-
}
|
34
|
-
|
35
|
-
&__title {
|
36
|
-
margin-bottom: 8px;
|
37
|
-
padding-right: 36px;
|
38
|
-
|
39
|
-
font-size: 17px;
|
40
|
-
line-height: 24px;
|
41
|
-
}
|
42
|
-
|
43
|
-
&__content {
|
44
|
-
color: var(--yc-color-text-complementary);
|
45
|
-
}
|
46
|
-
}
|
package/dist/utils/settings.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import {getValueFromLS} from './utils';
|
2
|
-
|
3
|
-
export const userSettings = window.userSettings || {};
|
4
|
-
export const systemSettings = window.systemSettings || {};
|
5
|
-
|
6
|
-
export const settingsApi = window.web_version ? systemSettings.settingsApi : undefined;
|
7
|
-
|
8
|
-
export function readSavedSettingsValue(key: string, defaultValue?: string) {
|
9
|
-
// If there is no settingsApi, use localStorage
|
10
|
-
const savedValue = settingsApi ? userSettings[key] : getValueFromLS(key);
|
11
|
-
|
12
|
-
return savedValue ?? defaultValue;
|
13
|
-
}
|