ydb-embedded-ui 4.14.0 → 4.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/containers/App/App.js +1 -1
  3. package/dist/containers/AsideNavigation/AsideNavigation.tsx +1 -1
  4. package/dist/containers/Authentication/Authentication.tsx +1 -1
  5. package/dist/containers/Storage/Storage.tsx +64 -32
  6. package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +56 -73
  7. package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +33 -43
  8. package/dist/containers/Storage/utils/index.ts +3 -3
  9. package/dist/containers/Tenant/i18n/en.json +3 -0
  10. package/dist/containers/Tenant/i18n/ru.json +3 -0
  11. package/dist/containers/Tenant/utils/queryTemplates.ts +89 -0
  12. package/dist/containers/Tenant/utils/schema.ts +1 -1
  13. package/dist/containers/Tenant/utils/schemaActions.ts +27 -44
  14. package/dist/containers/UserSettings/i18n/en.json +1 -1
  15. package/dist/containers/UserSettings/i18n/ru.json +1 -1
  16. package/dist/{reportWebVitals.js → reportWebVitals.ts} +3 -1
  17. package/dist/services/api.ts +6 -4
  18. package/dist/store/reducers/{authentication.js → authentication/authentication.ts} +14 -7
  19. package/dist/store/reducers/authentication/types.ts +15 -0
  20. package/dist/store/reducers/describe.ts +1 -16
  21. package/dist/store/reducers/index.ts +1 -1
  22. package/dist/store/reducers/storage/selectors.ts +50 -150
  23. package/dist/store/reducers/storage/storage.ts +73 -25
  24. package/dist/store/reducers/storage/types.ts +49 -17
  25. package/dist/store/reducers/storage/utils.ts +207 -0
  26. package/dist/store/utils.ts +1 -1
  27. package/dist/types/api/error.ts +4 -0
  28. package/dist/types/api/storage.ts +32 -4
  29. package/dist/types/window.d.ts +1 -0
  30. package/dist/utils/hooks/index.ts +1 -0
  31. package/dist/utils/hooks/useStorageRequestParams.ts +28 -0
  32. package/dist/utils/hooks/useTableSort.ts +1 -1
  33. package/dist/utils/storage.ts +31 -3
  34. package/package.json +1 -5
  35. package/dist/HOCS/WithSearch/WithSearch.js +0 -26
  36. package/dist/HOCS/index.js +0 -1
  37. package/dist/components/Hotkey/Hotkey.js +0 -102
  38. package/dist/components/Pagination/Pagination.js +0 -63
  39. package/dist/components/Pagination/Pagination.scss +0 -28
  40. package/dist/types/store/storage.ts +0 -12
  41. /package/dist/{index.js → index.tsx} +0 -0
  42. /package/dist/utils/{monaco.js → monaco.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "4.14.0",
3
+ "version": "4.15.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -20,7 +20,6 @@
20
20
  "copy-to-clipboard": "^3.3.3",
21
21
  "history": "4.10.1",
22
22
  "js-cookie": "2.2.1",
23
- "keymaster": "1.6.2",
24
23
  "lodash": "4.17.11",
25
24
  "monaco-editor": "0.24.0",
26
25
  "numeral": "2.0.6",
@@ -33,7 +32,6 @@
33
32
  "react-router-dom": "5.3.0",
34
33
  "react-scripts": "5.0.1",
35
34
  "react-split": "2.0.14",
36
- "react-transition-group": "4.4.2",
37
35
  "redux": "4.0.1",
38
36
  "redux-location-state": "2.6.0",
39
37
  "redux-thunk": "2.3.0",
@@ -123,8 +121,6 @@
123
121
  "@types/react-dom": "^17.0.11",
124
122
  "@types/react-router": "^5.1.17",
125
123
  "@types/react-router-dom": "^5.3.2",
126
- "@types/react-transition-group": "^4.4.4",
127
- "@types/react-virtualized-auto-sizer": "^1.0.1",
128
124
  "copyfiles": "^2.4.1",
129
125
  "eslint-config-prettier": "^8.3.0",
130
126
  "husky": "^7.0.4",
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
-
3
- export const withSearch = (Component) => {
4
- class HOC extends React.Component {
5
- state = {
6
- searchQuery: '',
7
- };
8
-
9
- handleSearchQuery = (searchQuery) => {
10
- this.setState({searchQuery});
11
- };
12
-
13
- render() {
14
- const {searchQuery} = this.state;
15
- return (
16
- <Component
17
- {...this.props}
18
- searchQuery={searchQuery}
19
- handleSearchQuery={this.handleSearchQuery}
20
- />
21
- );
22
- }
23
- }
24
-
25
- return HOC;
26
- };
@@ -1 +0,0 @@
1
- export * from './WithSearch/WithSearch';
@@ -1,102 +0,0 @@
1
- import {Component} from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- import key from 'keymaster';
5
-
6
- const propTypes = {
7
- settings: PropTypes.arrayOf(
8
- PropTypes.shape({
9
- keys: PropTypes.string.isRequired,
10
- handler: PropTypes.func.isRequired,
11
- scope: PropTypes.string,
12
- preventDefault: PropTypes.bool,
13
- }),
14
- ).isRequired,
15
- };
16
-
17
- function eventOnInput(evt) {
18
- const tagName = (evt.target || evt.srcElement).tagName;
19
-
20
- return /^(INPUT|TEXTAREA|SELECT)$/.test(tagName);
21
- }
22
-
23
- export default class Hotkey extends Component {
24
- componentDidMount() {
25
- const {settings} = this.props;
26
-
27
- if (!key) {
28
- return;
29
- }
30
-
31
- this.preparedSettings = this.prepareSettings(settings);
32
-
33
- // To use hotkeys inside inputs we need to specify scope, other events are filtered.
34
- key.filter = function (evt) {
35
- const currentScope = key.getScope();
36
-
37
- return !(eventOnInput(evt) && currentScope === 'all');
38
- };
39
-
40
- this.preparedSettings.forEach((setting) => {
41
- this.bindKey(setting.combo, setting.scope, setting.handler, setting.preventDefault);
42
- });
43
- }
44
-
45
- componentWillUnmount() {
46
- if (!key) {
47
- return;
48
- }
49
-
50
- this.preparedSettings.forEach((setting) => {
51
- this.unbindKey(setting.combo, setting.scope);
52
- });
53
- }
54
-
55
- prepareSettings(settings) {
56
- const preparedSettings = [];
57
-
58
- settings.forEach((item) => {
59
- const keyCombinations = item.keys.split(/\s*,\s*/);
60
- const scopes = item.scope.split(/\s*,\s*/);
61
- const preventDefault =
62
- typeof item.preventDefault !== 'undefined' ? item.preventDefault : true;
63
-
64
- keyCombinations.forEach((combo) => {
65
- scopes.forEach((scope) => {
66
- if (typeof item.handler === 'function') {
67
- preparedSettings.push({
68
- combo: combo,
69
- scope: scope,
70
- handler: item.handler,
71
- preventDefault: preventDefault,
72
- });
73
- }
74
- });
75
- });
76
- });
77
-
78
- return preparedSettings;
79
- }
80
-
81
- bindKey(combination, scope, handler, preventDefault) {
82
- key(combination, scope, (evt, shortcut) => {
83
- if (key.getScope() === shortcut.scope) {
84
- handler(evt, shortcut);
85
-
86
- if (preventDefault) {
87
- evt.preventDefault();
88
- }
89
- }
90
- });
91
- }
92
-
93
- unbindKey(combination, scope) {
94
- key.unbind(combination, scope);
95
- }
96
-
97
- render() {
98
- return null;
99
- }
100
- }
101
-
102
- Hotkey.propTypes = propTypes;
@@ -1,63 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import cn from 'bem-cn-lite';
4
- import {Button} from '@gravity-ui/uikit';
5
- import {Icon} from '../Icon';
6
- import Hotkey from '../Hotkey/Hotkey';
7
-
8
- import './Pagination.scss';
9
-
10
- const b = cn('elements-pagination');
11
-
12
- const paginationControlComponent = PropTypes.shape({
13
- handler: PropTypes.func,
14
- disabled: PropTypes.bool,
15
- hotkey: PropTypes.string,
16
- hotkeyScope: PropTypes.string,
17
- hotkeyHandler: PropTypes.func,
18
- tooltip: PropTypes.string,
19
- }).isRequired;
20
-
21
- export default class Pagination extends React.Component {
22
- static propTypes = {
23
- previous: paginationControlComponent,
24
- next: paginationControlComponent,
25
- };
26
-
27
- renderComponent(name, control) {
28
- const hotkeySettings = [
29
- {
30
- keys: control.hotkey,
31
- scope: control.hotkeyScope,
32
- handler: control.hotkeyHandler,
33
- },
34
- ];
35
-
36
- return (
37
- <React.Fragment>
38
- <Button
39
- view="outlined"
40
- onClick={control.handler}
41
- disabled={control.disabled}
42
- title={control.tooltip}
43
- className={b('control')}
44
- >
45
- <Icon name={name} viewBox="0 0 6 11" width="6" height="11" />
46
- </Button>
47
- <Hotkey settings={hotkeySettings} />
48
- </React.Fragment>
49
- );
50
- }
51
-
52
- render() {
53
- const {previous, next} = this.props;
54
-
55
- return (
56
- <div className={b()}>
57
- {this.renderComponent('previous', previous)}
58
- <div className={b('divider')} />
59
- {this.renderComponent('next', next)}
60
- </div>
61
- );
62
- }
63
- }
@@ -1,28 +0,0 @@
1
- .elements-pagination {
2
- display: flex;
3
-
4
- padding-left: 1px;
5
-
6
- &__divider {
7
- border-left: 1px solid var(--yc-color-line-generic);
8
- }
9
-
10
- &__control {
11
- display: flex;
12
- align-items: center;
13
-
14
- margin: 0 -1px;
15
- }
16
-
17
- &__icon {
18
- display: flex;
19
- justify-content: center;
20
- align-items: center;
21
-
22
- color: var(--yc-color-text-primary);
23
- }
24
-
25
- &__control:hover {
26
- z-index: 5;
27
- }
28
- }
@@ -1,12 +0,0 @@
1
- import type {TBSGroupStateInfo} from '../api/storage';
2
-
3
- export interface IStoragePoolGroup extends TBSGroupStateInfo {
4
- Read: number;
5
- Write: number;
6
- PoolName?: string;
7
- Used: number;
8
- Limit: number;
9
- Missing: number;
10
- UsedSpaceFlag: number;
11
- Type: string | null;
12
- }
File without changes
File without changes