ydb-embedded-ui 4.10.1 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/components/QueryResultTable/Cell/Cell.tsx +8 -8
- package/dist/components/QueryResultTable/i18n/en.json +1 -1
- package/dist/components/QueryResultTable/i18n/ru.json +1 -1
- package/dist/components/ShortyString/ShortyString.tsx +3 -6
- package/dist/components/ShortyString/i18n/en.json +8 -8
- package/dist/components/ShortyString/i18n/ru.json +8 -8
- package/dist/components/SpeedMultiMeter/i18n/index.ts +0 -2
- package/dist/components/Stack/Stack.tsx +16 -16
- package/dist/components/TableSkeleton/TableSkeleton.tsx +3 -3
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +7 -3
- package/dist/containers/Header/Header.tsx +2 -2
- package/dist/containers/Header/breadcrumbs.ts +2 -1
- package/dist/containers/Heatmap/Heatmap.tsx +4 -3
- package/dist/containers/Node/NodeStructure/PDiskTitleBadge.tsx +2 -8
- package/dist/containers/Nodes/Nodes.tsx +1 -1
- package/dist/containers/Storage/EmptyFilter/i18n/en.json +2 -2
- package/dist/containers/Storage/EmptyFilter/i18n/ru.json +2 -2
- package/dist/containers/Storage/StorageGroups/i18n/en.json +5 -5
- package/dist/containers/Storage/StorageGroups/i18n/ru.json +5 -5
- package/dist/containers/Storage/UsageFilter/i18n/en.json +3 -8
- package/dist/containers/Storage/UsageFilter/i18n/ru.json +3 -8
- package/dist/containers/Tablet/Tablet.tsx +2 -2
- package/dist/containers/Tenant/Acl/Acl.scss +1 -9
- package/dist/containers/Tenant/Acl/Acl.tsx +137 -0
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.tsx +2 -2
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +6 -0
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +3 -3
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +2 -0
- package/dist/containers/Tenant/Diagnostics/Overview/utils/prepareTopicSchemaInfo.ts +2 -3
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +0 -6
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +95 -83
- package/dist/containers/Tenant/Query/Issues/Issues.tsx +27 -23
- package/dist/containers/Tenant/Query/Issues/models.ts +0 -11
- package/dist/containers/Tenant/Query/Preview/Preview.tsx +3 -3
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +2 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.tsx +99 -0
- package/dist/containers/Tenant/Tenant.tsx +1 -5
- package/dist/containers/Tenant/TenantPages.tsx +9 -14
- package/dist/containers/Tenant/i18n/en.json +11 -0
- package/dist/containers/Tenant/i18n/index.ts +11 -0
- package/dist/containers/Tenant/i18n/ru.json +11 -0
- package/dist/containers/Tenant/utils/schema.ts +24 -0
- package/dist/containers/Tenant/utils/schemaActions.ts +28 -24
- package/dist/containers/Tenants/Tenants.tsx +1 -4
- package/dist/services/api.ts +6 -7
- package/dist/store/index.js +1 -1
- package/dist/store/reducers/nodes/nodes.ts +14 -5
- package/dist/store/reducers/nodes/types.ts +22 -3
- package/dist/store/reducers/nodes/utils.ts +23 -10
- package/dist/store/reducers/preview.ts +6 -4
- package/dist/store/reducers/schemaAcl/schemaAcl.ts +17 -0
- package/dist/store/reducers/schemaAcl/types.ts +9 -7
- package/dist/store/reducers/tenant/constants.ts +6 -0
- package/dist/store/reducers/tenant/tenant.ts +15 -0
- package/dist/store/reducers/tenant/types.ts +18 -3
- package/dist/store/state-url-mapping.js +3 -0
- package/dist/types/api/cluster.ts +1 -1
- package/dist/types/api/compute.ts +11 -11
- package/dist/types/api/error.ts +2 -2
- package/dist/types/api/netInfo.ts +3 -3
- package/dist/types/api/nodes.ts +9 -8
- package/dist/types/api/query.ts +1 -1
- package/dist/types/api/schema/schema.ts +3 -0
- package/dist/types/api/schema/shared.ts +3 -3
- package/dist/types/api/schema/table.ts +22 -22
- package/dist/types/api/storage.ts +1 -1
- package/dist/types/assets.d.ts +1 -2
- package/dist/types/store/executeQuery.ts +2 -3
- package/dist/types/store/executeTopQueries.ts +8 -5
- package/dist/types/store/explainQuery.ts +4 -4
- package/dist/types/store/query.ts +4 -3
- package/dist/types/store/shardsWorkload.ts +8 -5
- package/dist/utils/constants.ts +4 -1
- package/dist/utils/error.ts +2 -3
- package/dist/utils/query.ts +3 -9
- package/dist/utils/tests/providers.tsx +6 -9
- package/package.json +6 -2
- package/dist/containers/Tenant/Acl/Acl.js +0 -153
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +0 -94
@@ -1,153 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
import _ from 'lodash';
|
5
|
-
import {connect} from 'react-redux';
|
6
|
-
import {Loader} from '@gravity-ui/uikit';
|
7
|
-
import DataTable from '@gravity-ui/react-data-table';
|
8
|
-
import {DEFAULT_TABLE_SETTINGS} from '../../../utils/constants';
|
9
|
-
|
10
|
-
import './Acl.scss';
|
11
|
-
|
12
|
-
const b = cn('kv-acl');
|
13
|
-
|
14
|
-
const COLUMN_WIDTH = 140;
|
15
|
-
|
16
|
-
const TABLE_SETTINGS = {
|
17
|
-
...DEFAULT_TABLE_SETTINGS,
|
18
|
-
dynamicRender: false,
|
19
|
-
stickyTop: 36,
|
20
|
-
};
|
21
|
-
|
22
|
-
class Acl extends React.Component {
|
23
|
-
static propTypes = {
|
24
|
-
error: PropTypes.string,
|
25
|
-
acl: PropTypes.array,
|
26
|
-
loading: PropTypes.bool,
|
27
|
-
additionalTenantInfo: PropTypes.object,
|
28
|
-
};
|
29
|
-
|
30
|
-
COLUMNS = [
|
31
|
-
{
|
32
|
-
name: 'AccessType',
|
33
|
-
header: 'Access Type',
|
34
|
-
sortable: false,
|
35
|
-
},
|
36
|
-
{
|
37
|
-
name: 'AccessRights',
|
38
|
-
header: 'Access Rights',
|
39
|
-
render: ({value}) => {
|
40
|
-
return _.map(value, (item, index) => {
|
41
|
-
return <div key={index}>{item}</div>;
|
42
|
-
});
|
43
|
-
},
|
44
|
-
sortable: false,
|
45
|
-
},
|
46
|
-
{
|
47
|
-
name: 'Subject',
|
48
|
-
sortable: false,
|
49
|
-
// eslint-disable-next-line react/display-name
|
50
|
-
render: ({value}) => {
|
51
|
-
return this.prepareLogin(value);
|
52
|
-
},
|
53
|
-
width: COLUMN_WIDTH,
|
54
|
-
},
|
55
|
-
{
|
56
|
-
name: 'InheritanceType',
|
57
|
-
header: 'Inheritance Type',
|
58
|
-
render: ({value}) => {
|
59
|
-
return _.map(value, (item, index) => {
|
60
|
-
return <div key={index}>{item}</div>;
|
61
|
-
});
|
62
|
-
},
|
63
|
-
sortable: false,
|
64
|
-
},
|
65
|
-
];
|
66
|
-
|
67
|
-
prepareLogin = (value) => {
|
68
|
-
if (this.props.prepareLogin) {
|
69
|
-
return this.props.additionalTenantInfo?.prepareLogin(value);
|
70
|
-
}
|
71
|
-
if (value && value.endsWith('@staff') && !value.startsWith('svc_')) {
|
72
|
-
const login = value.split('@')[0];
|
73
|
-
return login;
|
74
|
-
}
|
75
|
-
|
76
|
-
return value;
|
77
|
-
};
|
78
|
-
|
79
|
-
renderTable = () => {
|
80
|
-
const {acl} = this.props;
|
81
|
-
|
82
|
-
if (!acl) {
|
83
|
-
return null;
|
84
|
-
}
|
85
|
-
|
86
|
-
return <DataTable columns={this.COLUMNS} data={acl} settings={TABLE_SETTINGS} />;
|
87
|
-
};
|
88
|
-
|
89
|
-
renderOwner = () => {
|
90
|
-
const {owner} = this.props;
|
91
|
-
|
92
|
-
if (!owner) {
|
93
|
-
return null;
|
94
|
-
}
|
95
|
-
|
96
|
-
return (
|
97
|
-
<div className={b('owner-container')}>
|
98
|
-
<span className={b('owner-label')}>Owner: </span>
|
99
|
-
{this.prepareLogin(owner)}
|
100
|
-
</div>
|
101
|
-
);
|
102
|
-
};
|
103
|
-
renderResult = () => {
|
104
|
-
return (
|
105
|
-
<React.Fragment>
|
106
|
-
{this.renderOwner()}
|
107
|
-
{this.renderTable()}
|
108
|
-
</React.Fragment>
|
109
|
-
);
|
110
|
-
};
|
111
|
-
|
112
|
-
render() {
|
113
|
-
const {error, loading, acl, owner, wasLoaded} = this.props;
|
114
|
-
|
115
|
-
if (loading && !wasLoaded) {
|
116
|
-
return (
|
117
|
-
<div className={b('loader-container')}>
|
118
|
-
<Loader size="m" />
|
119
|
-
</div>
|
120
|
-
);
|
121
|
-
}
|
122
|
-
|
123
|
-
if (error && !error.isCancelled) {
|
124
|
-
const message = (error.data || error).slice(0, 100);
|
125
|
-
|
126
|
-
return <div className={b('message-container')}>{message}</div>;
|
127
|
-
}
|
128
|
-
|
129
|
-
if (!loading && !acl && !owner) {
|
130
|
-
return <div className={b('message-container')}>Empty</div>;
|
131
|
-
}
|
132
|
-
|
133
|
-
return (
|
134
|
-
<div className={b()}>
|
135
|
-
<div className={b('result')}>{this.renderResult()}</div>
|
136
|
-
</div>
|
137
|
-
);
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
const mapStateToProps = (state) => {
|
142
|
-
const {loading, error, acl, owner, wasLoaded} = state.schemaAcl;
|
143
|
-
|
144
|
-
return {
|
145
|
-
acl,
|
146
|
-
owner,
|
147
|
-
loading,
|
148
|
-
error,
|
149
|
-
wasLoaded,
|
150
|
-
};
|
151
|
-
};
|
152
|
-
|
153
|
-
export default connect(mapStateToProps)(Acl);
|
@@ -1,94 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import cn from 'bem-cn-lite';
|
4
|
-
|
5
|
-
import find from 'lodash/find';
|
6
|
-
|
7
|
-
import {Icon} from '../../../../components/Icon';
|
8
|
-
import DataTable from '@gravity-ui/react-data-table';
|
9
|
-
import {DEFAULT_TABLE_SETTINGS} from '../../../../utils/constants';
|
10
|
-
import './SchemaViewer.scss';
|
11
|
-
|
12
|
-
const b = cn('schema-viewer');
|
13
|
-
|
14
|
-
const SchemaViewerColumns = {
|
15
|
-
id: 'Id',
|
16
|
-
name: 'Name',
|
17
|
-
key: 'Key',
|
18
|
-
type: 'Type',
|
19
|
-
notNull: 'NotNull',
|
20
|
-
};
|
21
|
-
|
22
|
-
class SchemaViewer extends React.Component {
|
23
|
-
static propTypes = {
|
24
|
-
data: PropTypes.arrayOf(PropTypes.object),
|
25
|
-
};
|
26
|
-
|
27
|
-
renderTable() {
|
28
|
-
const {data = {}} = this.props;
|
29
|
-
const keyColumnsIds = data.KeyColumnIds ?? [];
|
30
|
-
const keyColumns = keyColumnsIds.map((key) => {
|
31
|
-
const keyColumn = find(data.Columns, {Id: key});
|
32
|
-
return keyColumn;
|
33
|
-
});
|
34
|
-
const restColumns = data.Columns?.filter((item) => !keyColumnsIds.includes(item.Id)) ?? [];
|
35
|
-
|
36
|
-
const columns = [
|
37
|
-
{
|
38
|
-
name: SchemaViewerColumns.id,
|
39
|
-
width: 40,
|
40
|
-
},
|
41
|
-
{
|
42
|
-
name: SchemaViewerColumns.key,
|
43
|
-
width: 40,
|
44
|
-
sortAccessor: (row) => {
|
45
|
-
return keyColumnsIds.includes(row.Id) ? 1 : 0;
|
46
|
-
},
|
47
|
-
render: ({row}) => {
|
48
|
-
return keyColumnsIds.includes(row.Id) ? (
|
49
|
-
<div className={b('key-icon')}>
|
50
|
-
<Icon name="key" viewBox="0 0 12 7" width={12} height={7} />
|
51
|
-
</div>
|
52
|
-
) : null;
|
53
|
-
},
|
54
|
-
},
|
55
|
-
{
|
56
|
-
name: SchemaViewerColumns.name,
|
57
|
-
width: 100,
|
58
|
-
},
|
59
|
-
{
|
60
|
-
name: SchemaViewerColumns.type,
|
61
|
-
width: 100,
|
62
|
-
},
|
63
|
-
{
|
64
|
-
name: SchemaViewerColumns.notNull,
|
65
|
-
width: 100,
|
66
|
-
render: ({row}) => {
|
67
|
-
if (row.NotNull) {
|
68
|
-
return '\u2713';
|
69
|
-
}
|
70
|
-
|
71
|
-
return undefined;
|
72
|
-
},
|
73
|
-
},
|
74
|
-
];
|
75
|
-
|
76
|
-
const tableData = [...keyColumns, ...restColumns];
|
77
|
-
return (
|
78
|
-
<DataTable
|
79
|
-
theme="yandex-cloud"
|
80
|
-
data={tableData}
|
81
|
-
columns={columns}
|
82
|
-
settings={DEFAULT_TABLE_SETTINGS}
|
83
|
-
dynamicRender={true}
|
84
|
-
initialSortOrder={{columnId: SchemaViewerColumns.key, order: DataTable.DESCENDING}}
|
85
|
-
/>
|
86
|
-
);
|
87
|
-
}
|
88
|
-
|
89
|
-
render() {
|
90
|
-
return <div className={b()}>{this.renderTable()}</div>;
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
export default SchemaViewer;
|