ydb-embedded-ui 1.8.1 → 1.8.4

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.8.4](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.8.3...v1.8.4) (2022-07-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **Nodes:** add /internal for nodes external link ([a649dd2](https://github.com/ydb-platform/ydb-embedded-ui/commit/a649dd209bae4abd6916f23d0894df893602aaf7))
9
+
10
+ ## [1.8.3](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.8.2...v1.8.3) (2022-07-08)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * timeout 600 sec for requests /viewer/json/query ([cf65122](https://github.com/ydb-platform/ydb-embedded-ui/commit/cf651221f866e5f56ecf6c900b3778dedc31eb95))
16
+
17
+ ## [1.8.2](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.8.1...v1.8.2) (2022-07-07)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **Tenant:** 3 tabs for indexes ([9280384](https://github.com/ydb-platform/ydb-embedded-ui/commit/9280384733938c4bd269bf6f9adf23efb552c6e8))
23
+ * **Tenant:** hide preview button for index tables ([a25e0ea](https://github.com/ydb-platform/ydb-embedded-ui/commit/a25e0ea0413277e27c54d123e2be7a15b8a2aaa4))
24
+
3
25
  ## [1.8.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.8.0...v1.8.1) (2022-07-06)
4
26
 
5
27
 
@@ -1,11 +1,11 @@
1
- import {i18n, I18N} from '../../../../utils/i18n';
1
+ import {i18n, Lang} from '../../../../utils/i18n';
2
2
 
3
3
  import en from './en.json';
4
4
  import ru from './ru.json';
5
5
 
6
6
  const COMPONENT = 'nv-settings';
7
7
 
8
- i18n.registerKeyset(I18N.LANGS.en, COMPONENT, en);
9
- i18n.registerKeyset(I18N.LANGS.ru, COMPONENT, ru);
8
+ i18n.registerKeyset(Lang.En, COMPONENT, en);
9
+ i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
10
10
 
11
11
  export default i18n.keyset(COMPONENT);
@@ -1,11 +1,11 @@
1
- import {i18n, I18N} from '../../../utils/i18n';
1
+ import {i18n, Lang} from '../../../utils/i18n';
2
2
 
3
3
  import en from './en.json';
4
4
  import ru from './ru.json';
5
5
 
6
6
  const COMPONENT = 'ydb-embedded-ui';
7
7
 
8
- i18n.registerKeyset(I18N.LANGS.en, COMPONENT, en);
9
- i18n.registerKeyset(I18N.LANGS.ru, COMPONENT, ru);
8
+ i18n.registerKeyset(Lang.En, COMPONENT, en);
9
+ i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
10
10
 
11
11
  export default i18n.keyset(COMPONENT);
@@ -2,8 +2,9 @@ import React from 'react';
2
2
  import {connect} from 'react-redux';
3
3
  import PropTypes from 'prop-types';
4
4
 
5
+ import {configure as configureUiKit} from '@yandex-cloud/uikit';
5
6
  import {i18n as YDBComponentsI18N} from 'ydb-ui-components';
6
- import {I18N, i18n} from '../../utils/i18n';
7
+ import {i18n, Lang} from '../../utils/i18n';
7
8
 
8
9
  import ContentWrapper, {Content} from './Content';
9
10
  import AsideNavigation from '../AsideNavigation/AsideNavigation';
@@ -25,8 +26,11 @@ class App extends React.Component {
25
26
 
26
27
  constructor(props) {
27
28
  super(props);
28
- i18n.setLang(I18N.LANGS.en);
29
- YDBComponentsI18N.setLang(I18N.LANGS.en);
29
+ i18n.setLang(Lang.En);
30
+ YDBComponentsI18N.setLang(Lang.En);
31
+ configureUiKit({
32
+ lang: Lang.En,
33
+ });
30
34
  }
31
35
 
32
36
  componentDidMount() {
@@ -76,8 +76,6 @@ export const TABLE_PAGES = [overview, topShards, graph, tablets, hotKeys, descri
76
76
 
77
77
  export const DIR_PAGES = [overview, topShards, describe];
78
78
 
79
- export const INDEX_PAGES = [overview];
80
-
81
79
  export const getPagesByType = (type?: EPathType) => {
82
80
  switch (type) {
83
81
  case EPathType.EPathTypeColumnStore:
@@ -86,9 +84,8 @@ export const getPagesByType = (type?: EPathType) => {
86
84
  case EPathType.EPathTypeColumnTable:
87
85
  case EPathType.EPathTypeTable:
88
86
  return TABLE_PAGES;
89
- case EPathType.EPathTypeTableIndex:
90
- return INDEX_PAGES;
91
87
  case EPathType.EPathTypeDir:
88
+ case EPathType.EPathTypeTableIndex:
92
89
  default:
93
90
  return DIR_PAGES;
94
91
  }
@@ -16,8 +16,8 @@ import CopyToClipboard from '../../../components/CopyToClipboard/CopyToClipboard
16
16
  import InfoViewer from '../../../components/InfoViewer/InfoViewer';
17
17
  import Icon from '../../../components/Icon/Icon';
18
18
 
19
- import type {EPathType} from '../../../types/api/schema';
20
- import {isColumnEntityType, isTableType} from '../utils/schema';
19
+ import type {EPathSubType, EPathType} from '../../../types/api/schema';
20
+ import {isColumnEntityType, isIndexTable, isTableType} from '../utils/schema';
21
21
 
22
22
  import {
23
23
  DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED,
@@ -71,6 +71,7 @@ function prepareOlapTableSchema(tableSchema: any) {
71
71
 
72
72
  interface ObjectSummaryProps {
73
73
  type?: EPathType;
74
+ subType?: EPathSubType;
74
75
  onCollapseSummary: VoidFunction;
75
76
  onExpandSummary: VoidFunction;
76
77
  isCollapsed: boolean;
@@ -229,10 +230,10 @@ function ObjectSummary(props: ObjectSummaryProps) {
229
230
  };
230
231
 
231
232
  const renderCommonInfoControls = () => {
232
- const isTable = isTableType(props.type);
233
+ const showPreview = isTableType(props.type) && !isIndexTable(props.subType);
233
234
  return (
234
235
  <React.Fragment>
235
- {isTable && (
236
+ {showPreview && (
236
237
  <Button view="flat-secondary" onClick={onOpenPreview} title="Show preview">
237
238
  <Icon name="tablePreview" viewBox={'0 0 16 16'} height={16} width={16} />
238
239
  </Button>
@@ -104,7 +104,10 @@ function Tenant(props: TenantProps) {
104
104
  };
105
105
  }, [tenantName, dispatch]);
106
106
 
107
- const currentPathType = (currentItem as TEvDescribeSchemeResult).PathDescription?.Self?.PathType;
107
+ const {
108
+ PathType: currentPathType,
109
+ PathSubType: currentPathSubType,
110
+ } = (currentItem as TEvDescribeSchemeResult).PathDescription?.Self || {};
108
111
 
109
112
  const onCollapseSummaryHandler = () => {
110
113
  dispatchSummaryVisibilityAction(PaneVisibilityActionTypes.triggerCollapse);
@@ -138,6 +141,7 @@ function Tenant(props: TenantProps) {
138
141
  >
139
142
  <ObjectSummary
140
143
  type={currentPathType}
144
+ subType={currentPathSubType}
141
145
  onCollapseSummary={onCollapseSummaryHandler}
142
146
  onExpandSummary={onExpandSummaryHandler}
143
147
  isCollapsed={summaryVisibilityState.collapsed}
@@ -35,6 +35,9 @@ export const mapPathTypeToNavigationTreeType = (
35
35
  export const isTableType = (type?: EPathType) =>
36
36
  mapPathTypeToNavigationTreeType(type) === 'table';
37
37
 
38
+ export const isIndexTable = (subType?: EPathSubType) =>
39
+ mapTablePathSubTypeToNavigationTreeType(subType) === 'index_table';
40
+
38
41
  export const isColumnEntityType = (type?: EPathType) =>
39
42
  type === EPathType.EPathTypeColumnStore ||
40
43
  type === EPathType.EPathTypeColumnTable;
@@ -153,6 +153,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
153
153
  database,
154
154
  action,
155
155
  stats,
156
+ timeout: 600000,
156
157
  });
157
158
  }
158
159
  getExplainQuery(query, database) {
@@ -160,6 +161,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
160
161
  query,
161
162
  database,
162
163
  action: 'explain',
164
+ timeout: 600000,
163
165
  });
164
166
  }
165
167
  getExplainQueryAst(query, database) {
@@ -167,6 +169,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
167
169
  query,
168
170
  database,
169
171
  action: 'explain-ast',
172
+ timeout: 600000,
170
173
  });
171
174
  }
172
175
  getHotKeys(path, enableSampling) {
@@ -24,7 +24,7 @@ export function getNodesColumns({showTooltip, hideTooltip, tabletsPath, getNodeR
24
24
  {
25
25
  name: 'Host',
26
26
  render: ({row, value}) => {
27
- const nodeRef = getNodeRef ? getNodeRef(row) : undefined;
27
+ const nodeRef = getNodeRef ? getNodeRef(row) + 'internal' : undefined;
28
28
 
29
29
  if (typeof value === 'undefined') {
30
30
  return <span>—</span>;
@@ -1,7 +1,8 @@
1
1
  import {I18N} from '@yandex-cloud/i18n';
2
2
 
3
- export type Lang = keyof typeof I18N.LANGS;
3
+ export enum Lang {
4
+ En = 'en',
5
+ Ru = 'ru',
6
+ }
4
7
 
5
8
  export const i18n = new I18N();
6
-
7
- export {I18N} from '@yandex-cloud/i18n';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "1.8.1",
3
+ "version": "1.8.4",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -13,7 +13,7 @@
13
13
  "@testing-library/react": "11.2.7",
14
14
  "@testing-library/user-event": "12.8.3",
15
15
  "@types/qs": "6.9.7",
16
- "@yandex-cloud/i18n": "0.4.0",
16
+ "@yandex-cloud/i18n": "0.6.0",
17
17
  "@yandex-cloud/paranoid": "1.0.0",
18
18
  "@yandex-cloud/react-data-table": "0.2.1",
19
19
  "axios": "0.19.2",
@@ -91,7 +91,7 @@
91
91
  "@yandex-cloud/prettier-config": "^1.0.0",
92
92
  "@yandex-cloud/stylelint-config": "^1.1.0",
93
93
  "@yandex-cloud/tsconfig": "^1.0.0",
94
- "@yandex-cloud/uikit": "^2.4.0",
94
+ "@yandex-cloud/uikit": "^2.8.0",
95
95
  "copyfiles": "^2.4.1",
96
96
  "eslint-config-prettier": "^8.3.0",
97
97
  "husky": "^7.0.4",
@@ -106,6 +106,6 @@
106
106
  },
107
107
  "peerDependencies": {
108
108
  "@yandex-cloud/browserslist-config": "^1.0.1",
109
- "@yandex-cloud/uikit": "^2.4.0"
109
+ "@yandex-cloud/uikit": "^2.8.0"
110
110
  }
111
111
  }