ydb-embedded-ui 1.6.1 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +21 -0
- package/dist/components/EntityStatus/EntityStatus.js +5 -5
- package/dist/components/EntityStatus/EntityStatus.scss +7 -2
- package/dist/containers/App/App.js +1 -1
- package/dist/containers/App/App.scss +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +1 -1
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +4 -4
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +6 -5
- package/dist/containers/Tenant/Tenant.tsx +2 -2
- package/dist/containers/Tenant/utils/schema.ts +17 -14
- package/dist/services/api.d.ts +7 -1
- package/dist/types/api/schema.ts +118 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.6.4](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.6.3...v1.6.4) (2022-06-24)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* **Tenant:** properly display ColumnTables ([14d1e07](https://github.com/ydb-platform/ydb-embedded-ui/commit/14d1e074bf615be50f4f466d25e605b418f22b47))
|
9
|
+
|
10
|
+
## [1.6.3](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.6.2...v1.6.3) (2022-06-22)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* **ClipboardButton:** clickable area now matches visual area ([8c0b5ef](https://github.com/ydb-platform/ydb-embedded-ui/commit/8c0b5ef27d5d31b28a29455b3019de23bdbf8f68))
|
16
|
+
|
17
|
+
## [1.6.2](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.6.1...v1.6.2) (2022-06-07)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* shouls always select result tab ([98d4bcb](https://github.com/ydb-platform/ydb-embedded-ui/commit/98d4bcbc94bc2b9db9fb9b9cd5aced9f079ecdae))
|
23
|
+
|
3
24
|
## [1.6.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.6.0...v1.6.1) (2022-06-07)
|
4
25
|
|
5
26
|
|
@@ -80,15 +80,15 @@ class EntityStatus extends React.Component {
|
|
80
80
|
)}
|
81
81
|
{this.renderLink()}
|
82
82
|
{hasClipboardButton && (
|
83
|
-
<
|
83
|
+
<Button
|
84
|
+
component="span"
|
85
|
+
size="s"
|
84
86
|
className={b('clipboard-button', {
|
85
87
|
visible: false,
|
86
88
|
})}
|
87
89
|
>
|
88
|
-
<
|
89
|
-
|
90
|
-
</Button>
|
91
|
-
</span>
|
90
|
+
<ClipboardButton text={name} size={16} />
|
91
|
+
</Button>
|
92
92
|
)}
|
93
93
|
</div>
|
94
94
|
);
|
@@ -17,11 +17,16 @@
|
|
17
17
|
color: var(--yc-color-text-secondary);
|
18
18
|
|
19
19
|
.yc-button__text {
|
20
|
-
margin: 0
|
20
|
+
margin: 0;
|
21
|
+
}
|
22
|
+
|
23
|
+
.yc-clipboard-button {
|
24
|
+
width: 24px;
|
25
|
+
height: 24px;
|
21
26
|
}
|
22
27
|
|
23
28
|
&_visible {
|
24
|
-
display: flex;
|
29
|
+
display: inline-flex;
|
25
30
|
}
|
26
31
|
}
|
27
32
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import {connect} from 'react-redux';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
|
5
|
-
import {i18n as YDBComponentsI18N} from 'ydb-ui-components
|
5
|
+
import {i18n as YDBComponentsI18N} from 'ydb-ui-components';
|
6
6
|
import {I18N, i18n} from '../../utils/i18n';
|
7
7
|
|
8
8
|
import ContentWrapper, {Content} from './Content';
|
@@ -95,7 +95,7 @@ function Overview(props: OverviewProps) {
|
|
95
95
|
}, [autorefresh]);
|
96
96
|
|
97
97
|
const tableSchema =
|
98
|
-
currentItem?.PathDescription?.Table || currentItem?.PathDescription?.
|
98
|
+
currentItem?.PathDescription?.Table || currentItem?.PathDescription?.ColumnTableDescription;
|
99
99
|
|
100
100
|
const schemaData = useMemo(() => {
|
101
101
|
return props.type === OLAP_TABLE_TYPE
|
@@ -102,7 +102,7 @@ function ObjectSummary(props: ObjectSummaryProps) {
|
|
102
102
|
const currentSchemaData = _.get(data[currentSchemaPath], 'PathDescription.Self');
|
103
103
|
|
104
104
|
const tableSchema =
|
105
|
-
currentItem?.PathDescription?.Table || currentItem?.PathDescription?.
|
105
|
+
currentItem?.PathDescription?.Table || currentItem?.PathDescription?.ColumnTableDescription;
|
106
106
|
|
107
107
|
const schema =
|
108
108
|
props.type === OLAP_TABLE_TYPE ? prepareOlapTableSchema(tableSchema) : tableSchema;
|
@@ -28,9 +28,7 @@ const resultOptions = [
|
|
28
28
|
];
|
29
29
|
|
30
30
|
function QueryResult(props) {
|
31
|
-
const [activeSection, setActiveSection] = useState(
|
32
|
-
props.result ? resultOptionsIds.result : resultOptionsIds.stats,
|
33
|
-
);
|
31
|
+
const [activeSection, setActiveSection] = useState(resultOptionsIds.result);
|
34
32
|
const isFullscreen = useSelector((state) => state.fullscreen);
|
35
33
|
const dispatch = useDispatch();
|
36
34
|
|
@@ -111,7 +109,9 @@ function QueryResult(props) {
|
|
111
109
|
</Fullscreen>
|
112
110
|
)}
|
113
111
|
</React.Fragment>
|
114
|
-
) :
|
112
|
+
) : (
|
113
|
+
<span>{error?.data ?? error}</span>
|
114
|
+
);
|
115
115
|
};
|
116
116
|
|
117
117
|
return (
|
@@ -5,14 +5,15 @@ import {NavigationTree} from 'ydb-ui-components';
|
|
5
5
|
import {setCurrentSchemaPath, getSchema} from '../../../../store/reducers/schema';
|
6
6
|
import {getDescribe} from '../../../../store/reducers/describe';
|
7
7
|
import {getSchemaAcl} from '../../../../store/reducers/schemaAcl';
|
8
|
+
import type {EPathType} from '../../../../types/api/schema';
|
8
9
|
|
9
|
-
import {
|
10
|
+
import {mapPathTypeToNavigationTreeType} from '../../utils/schema';
|
10
11
|
import {getActions} from '../../utils/schemaActions';
|
11
12
|
|
12
13
|
interface SchemaTreeProps {
|
13
14
|
rootPath: string;
|
14
15
|
rootName: string;
|
15
|
-
rootType:
|
16
|
+
rootType: EPathType;
|
16
17
|
currentPath: string;
|
17
18
|
}
|
18
19
|
|
@@ -31,9 +32,9 @@ export function SchemaTree(props: SchemaTreeProps) {
|
|
31
32
|
{concurrentId: `NavigationTree.getSchema|${path}`},
|
32
33
|
)
|
33
34
|
.then(({PathDescription: {Children = []} = {}}) => {
|
34
|
-
return Children.map(({Name, PathType}) => ({
|
35
|
+
return Children.map(({Name = '', PathType}) => ({
|
35
36
|
name: Name,
|
36
|
-
type:
|
37
|
+
type: mapPathTypeToNavigationTreeType(PathType),
|
37
38
|
}));
|
38
39
|
});
|
39
40
|
|
@@ -49,7 +50,7 @@ export function SchemaTree(props: SchemaTreeProps) {
|
|
49
50
|
rootState={{
|
50
51
|
path: rootPath,
|
51
52
|
name: rootName,
|
52
|
-
type:
|
53
|
+
type: mapPathTypeToNavigationTreeType(rootType),
|
53
54
|
collapsed: false,
|
54
55
|
}}
|
55
56
|
fetchPath={fetchPath}
|
@@ -28,8 +28,8 @@ import './Tenant.scss';
|
|
28
28
|
const b = cn('tenant-page');
|
29
29
|
|
30
30
|
export const TABLE_TYPE = 'Table';
|
31
|
-
export const OLAP_TABLE_TYPE = '
|
32
|
-
export const OLAP_STORE_TYPE = '
|
31
|
+
export const OLAP_TABLE_TYPE = 'ColumnTable';
|
32
|
+
export const OLAP_STORE_TYPE = 'ColumnStore';
|
33
33
|
|
34
34
|
export function calcEntityType(currentPathType?: string) {
|
35
35
|
return currentPathType && currentPathType.replace('EPathType', '');
|
@@ -1,17 +1,20 @@
|
|
1
|
-
import type {NavigationTreeNodeType} from
|
1
|
+
import type {NavigationTreeNodeType} from 'ydb-ui-components';
|
2
|
+
import {EPathType} from '../../../types/api/schema';
|
2
3
|
|
3
|
-
const
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
export const mapPathTypeToNavigationTreeType = (
|
5
|
+
type: EPathType = EPathType.EPathTypeDir,
|
6
|
+
defaultType: NavigationTreeNodeType = 'directory'
|
7
|
+
): NavigationTreeNodeType => {
|
8
|
+
switch (type) {
|
9
|
+
case EPathType.EPathTypeSubDomain:
|
10
|
+
return 'database';
|
11
|
+
case EPathType.EPathTypeTable:
|
12
|
+
case EPathType.EPathTypeColumnTable:
|
13
|
+
return 'table';
|
14
|
+
case EPathType.EPathTypeDir:
|
15
|
+
case EPathType.EPathTypeColumnStore:
|
16
|
+
return 'directory';
|
17
|
+
default:
|
18
|
+
return defaultType;
|
14
19
|
}
|
15
|
-
|
16
|
-
return 'directory';
|
17
20
|
};
|
package/dist/services/api.d.ts
CHANGED
@@ -0,0 +1,118 @@
|
|
1
|
+
export interface TEvDescribeSchemeResult {
|
2
|
+
Status?: EStatus;
|
3
|
+
Reason?: string;
|
4
|
+
Path?: string;
|
5
|
+
PathDescription?: TPathDescription;
|
6
|
+
/** fixed64 */
|
7
|
+
PathOwner?: string;
|
8
|
+
/** fixed64 */
|
9
|
+
PathId?: string;
|
10
|
+
|
11
|
+
LastExistedPrefixPath?: string;
|
12
|
+
/** fixed64 */
|
13
|
+
LastExistedPrefixPathId?: string;
|
14
|
+
LastExistedPrefixDescription?: TPathDescription;
|
15
|
+
/** fixed64 */
|
16
|
+
PathOwnerId?: string;
|
17
|
+
}
|
18
|
+
|
19
|
+
enum EStatus {
|
20
|
+
StatusSuccess = 'StatusSuccess',
|
21
|
+
StatusAccepted = 'StatusAccepted',
|
22
|
+
StatusPathDoesNotExist = 'StatusPathDoesNotExist',
|
23
|
+
StatusPathIsNotDirectory = 'StatusPathIsNotDirectory',
|
24
|
+
StatusAlreadyExists = 'StatusAlreadyExists',
|
25
|
+
StatusSchemeError = 'StatusSchemeError',
|
26
|
+
StatusNameConflict = 'StatusNameConflict',
|
27
|
+
StatusInvalidParameter = 'StatusInvalidParameter',
|
28
|
+
StatusMultipleModifications = 'StatusMultipleModifications',
|
29
|
+
StatusReadOnly = 'StatusReadOnly',
|
30
|
+
StatusTxIdNotExists = 'StatusTxIdNotExists',
|
31
|
+
StatusTxIsNotCancellable = 'StatusTxIsNotCancellable',
|
32
|
+
StatusAccessDenied = 'StatusAccessDenied',
|
33
|
+
StatusNotAvailable = 'StatusNotAvailable',
|
34
|
+
StatusPreconditionFailed = 'StatusPreconditionFailed',
|
35
|
+
StatusRedirectDomain = 'StatusRedirectDomain',
|
36
|
+
StatusQuotaExceeded = 'StatusQuotaExceeded',
|
37
|
+
StatusResourceExhausted = 'StatusResourceExhausted',
|
38
|
+
}
|
39
|
+
|
40
|
+
// incomplete interface, only currently used fields are covered
|
41
|
+
interface TPathDescription {
|
42
|
+
/** info about the path itself */
|
43
|
+
Self?: TDirEntry;
|
44
|
+
DomainDescription?: unknown;
|
45
|
+
|
46
|
+
// for directory
|
47
|
+
Children?: TDirEntry[];
|
48
|
+
|
49
|
+
// for table
|
50
|
+
Table?: unknown;
|
51
|
+
TableStats?: unknown;
|
52
|
+
TabletMetrics?: unknown;
|
53
|
+
TablePartitions?: unknown[];
|
54
|
+
|
55
|
+
ColumnStoreDescription?: unknown;
|
56
|
+
ColumnTableDescription?: unknown;
|
57
|
+
}
|
58
|
+
|
59
|
+
interface TDirEntry {
|
60
|
+
Name?: string;
|
61
|
+
/** uint64 */
|
62
|
+
PathId?: string;
|
63
|
+
/** uint64 */
|
64
|
+
SchemeshardId?: string;
|
65
|
+
PathType?: EPathType;
|
66
|
+
CreateFinished?: boolean;
|
67
|
+
/** uint64 */
|
68
|
+
CreateTxId?: string;
|
69
|
+
/** uint64 */
|
70
|
+
CreateStep?: string;
|
71
|
+
/** uint64 */
|
72
|
+
ParentPathId?: string;
|
73
|
+
PathState?: EPathState;
|
74
|
+
Owner?: string;
|
75
|
+
ACL?: string;
|
76
|
+
EffectiveACL?: string;
|
77
|
+
/** uint64 */
|
78
|
+
PathVersion?: string;
|
79
|
+
PathSubType?: EPathSubType;
|
80
|
+
Version?: TPathVersion;
|
81
|
+
}
|
82
|
+
|
83
|
+
// incomplete
|
84
|
+
export enum EPathType {
|
85
|
+
EPathTypeInvalid = 'EPathTypeInvalid',
|
86
|
+
EPathTypeDir = 'EPathTypeDir',
|
87
|
+
EPathTypeTable = 'EPathTypeTable',
|
88
|
+
EPathTypeSubDomain = 'EPathTypeSubDomain',
|
89
|
+
EPathTypeColumnStore = 'EPathTypeColumnStore',
|
90
|
+
EPathTypeColumnTable = 'EPathTypeColumnTable',
|
91
|
+
}
|
92
|
+
|
93
|
+
enum EPathSubType {
|
94
|
+
EPathSubTypeEmpty = 'EPathSubTypeEmpty',
|
95
|
+
EPathSubTypeSyncIndexImplTable = 'EPathSubTypeSyncIndexImplTable',
|
96
|
+
EPathSubTypeAsyncIndexImplTable = 'EPathSubTypeAsyncIndexImplTable',
|
97
|
+
EPathSubTypeStreamImpl = 'EPathSubTypeStreamImpl',
|
98
|
+
}
|
99
|
+
|
100
|
+
enum EPathState {
|
101
|
+
EPathStateNotExist = 'EPathStateNotExist',
|
102
|
+
EPathStateNoChanges = 'EPathStateNoChanges',
|
103
|
+
EPathStateCreate = 'EPathStateCreate',
|
104
|
+
EPathStateAlter = 'EPathStateAlter',
|
105
|
+
EPathStateDrop = 'EPathStateDrop',
|
106
|
+
EPathStateCopying = 'EPathStateCopying',
|
107
|
+
EPathStateBackup = 'EPathStateBackup',
|
108
|
+
EPathStateUpgrade = 'EPathStateUpgrade',
|
109
|
+
EPathStateMigrated = 'EPathStateMigrated',
|
110
|
+
EPathStateRestore = 'EPathStateRestore',
|
111
|
+
EPathStateMoving = 'EPathStateMoving',
|
112
|
+
}
|
113
|
+
|
114
|
+
// incomplete
|
115
|
+
interface TPathVersion {
|
116
|
+
/** uint64 */
|
117
|
+
GeneralVersion?: string;
|
118
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ydb-embedded-ui",
|
3
|
-
"version": "1.6.
|
3
|
+
"version": "1.6.4",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"reselect": "4.0.0",
|
41
41
|
"sass": "1.32.8",
|
42
42
|
"web-vitals": "1.1.2",
|
43
|
-
"ydb-ui-components": "2.0.
|
43
|
+
"ydb-ui-components": "2.0.2"
|
44
44
|
},
|
45
45
|
"scripts": {
|
46
46
|
"start": "react-app-rewired start",
|