ydb-embedded-ui 4.10.1 → 4.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/QueryResultTable/Cell/Cell.tsx +8 -8
  3. package/dist/components/QueryResultTable/i18n/en.json +1 -1
  4. package/dist/components/QueryResultTable/i18n/ru.json +1 -1
  5. package/dist/components/ShortyString/ShortyString.tsx +3 -6
  6. package/dist/components/ShortyString/i18n/en.json +8 -8
  7. package/dist/components/ShortyString/i18n/ru.json +8 -8
  8. package/dist/components/SpeedMultiMeter/i18n/index.ts +0 -2
  9. package/dist/components/Stack/Stack.tsx +16 -16
  10. package/dist/components/TableSkeleton/TableSkeleton.tsx +3 -3
  11. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +7 -3
  12. package/dist/containers/Header/Header.tsx +2 -2
  13. package/dist/containers/Header/breadcrumbs.ts +2 -1
  14. package/dist/containers/Heatmap/Heatmap.tsx +4 -3
  15. package/dist/containers/Node/NodeStructure/PDiskTitleBadge.tsx +2 -8
  16. package/dist/containers/Nodes/Nodes.tsx +1 -1
  17. package/dist/containers/Storage/EmptyFilter/i18n/en.json +2 -2
  18. package/dist/containers/Storage/EmptyFilter/i18n/ru.json +2 -2
  19. package/dist/containers/Storage/StorageGroups/i18n/en.json +5 -5
  20. package/dist/containers/Storage/StorageGroups/i18n/ru.json +5 -5
  21. package/dist/containers/Storage/UsageFilter/i18n/en.json +3 -8
  22. package/dist/containers/Storage/UsageFilter/i18n/ru.json +3 -8
  23. package/dist/containers/Tablet/Tablet.tsx +2 -2
  24. package/dist/containers/Tenant/Acl/Acl.scss +1 -9
  25. package/dist/containers/Tenant/Acl/Acl.tsx +137 -0
  26. package/dist/containers/Tenant/Diagnostics/Describe/Describe.tsx +2 -2
  27. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +6 -0
  28. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +3 -3
  29. package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +2 -0
  30. package/dist/containers/Tenant/Diagnostics/Overview/utils/prepareTopicSchemaInfo.ts +2 -3
  31. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +0 -6
  32. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +95 -83
  33. package/dist/containers/Tenant/Query/Issues/Issues.tsx +27 -23
  34. package/dist/containers/Tenant/Query/Issues/models.ts +0 -11
  35. package/dist/containers/Tenant/Query/Preview/Preview.tsx +3 -3
  36. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +2 -2
  37. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.tsx +99 -0
  38. package/dist/containers/Tenant/Tenant.tsx +1 -5
  39. package/dist/containers/Tenant/TenantPages.tsx +9 -14
  40. package/dist/containers/Tenant/i18n/en.json +11 -0
  41. package/dist/containers/Tenant/i18n/index.ts +11 -0
  42. package/dist/containers/Tenant/i18n/ru.json +11 -0
  43. package/dist/containers/Tenant/utils/schema.ts +24 -0
  44. package/dist/containers/Tenant/utils/schemaActions.ts +28 -24
  45. package/dist/containers/Tenants/Tenants.tsx +1 -4
  46. package/dist/services/api.ts +6 -7
  47. package/dist/store/index.js +1 -1
  48. package/dist/store/reducers/nodes/nodes.ts +14 -5
  49. package/dist/store/reducers/nodes/types.ts +22 -3
  50. package/dist/store/reducers/nodes/utils.ts +23 -10
  51. package/dist/store/reducers/preview.ts +6 -4
  52. package/dist/store/reducers/schemaAcl/schemaAcl.ts +17 -0
  53. package/dist/store/reducers/schemaAcl/types.ts +9 -7
  54. package/dist/store/reducers/tenant/constants.ts +6 -0
  55. package/dist/store/reducers/tenant/tenant.ts +15 -0
  56. package/dist/store/reducers/tenant/types.ts +18 -3
  57. package/dist/store/state-url-mapping.js +3 -0
  58. package/dist/types/api/cluster.ts +1 -1
  59. package/dist/types/api/compute.ts +11 -11
  60. package/dist/types/api/error.ts +2 -2
  61. package/dist/types/api/netInfo.ts +3 -3
  62. package/dist/types/api/nodes.ts +9 -8
  63. package/dist/types/api/query.ts +1 -1
  64. package/dist/types/api/schema/schema.ts +3 -0
  65. package/dist/types/api/schema/shared.ts +3 -3
  66. package/dist/types/api/schema/table.ts +22 -22
  67. package/dist/types/api/storage.ts +1 -1
  68. package/dist/types/assets.d.ts +1 -2
  69. package/dist/types/store/executeQuery.ts +2 -3
  70. package/dist/types/store/executeTopQueries.ts +8 -5
  71. package/dist/types/store/explainQuery.ts +4 -4
  72. package/dist/types/store/query.ts +4 -3
  73. package/dist/types/store/shardsWorkload.ts +8 -5
  74. package/dist/utils/constants.ts +4 -1
  75. package/dist/utils/error.ts +2 -3
  76. package/dist/utils/query.ts +3 -9
  77. package/dist/utils/tests/providers.tsx +6 -9
  78. package/package.json +6 -2
  79. package/dist/containers/Tenant/Acl/Acl.js +0 -153
  80. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +0 -94
@@ -7,6 +7,7 @@ import type {
7
7
  TenantPage,
8
8
  TenantQueryTab,
9
9
  TenantState,
10
+ TenantSummaryTab,
10
11
  } from './types';
11
12
 
12
13
  import '../../../services/api';
@@ -17,6 +18,7 @@ export const FETCH_TENANT = createRequestActionTypes('tenant', 'FETCH_TENANT');
17
18
  const SET_TOP_LEVEL_TAB = 'tenant/SET_TOP_LEVEL_TAB';
18
19
  const SET_QUERY_TAB = 'tenant/SET_QUERY_TAB';
19
20
  const SET_DIAGNOSTICS_TAB = 'tenant/SET_DIAGNOSTICS_TAB';
21
+ const SET_SUMMARY_TAB = 'tenant/SET_SUMMARY_TAB';
20
22
  const CLEAR_TENANT = 'tenant/CLEAR_TENANT';
21
23
 
22
24
  const initialState = {loading: false, wasLoaded: false};
@@ -75,6 +77,12 @@ const tenantReducer: Reducer<TenantState, TenantAction> = (state = initialState,
75
77
  diagnosticsTab: action.data,
76
78
  };
77
79
  }
80
+ case SET_SUMMARY_TAB: {
81
+ return {
82
+ ...state,
83
+ summaryTab: action.data,
84
+ };
85
+ }
78
86
 
79
87
  default:
80
88
  return state;
@@ -116,4 +124,11 @@ export function setDiagnosticsTab(tab: TenantDiagnosticsTab) {
116
124
  } as const;
117
125
  }
118
126
 
127
+ export function setSummaryTab(tab: TenantSummaryTab) {
128
+ return {
129
+ type: SET_SUMMARY_TAB,
130
+ data: tab,
131
+ } as const;
132
+ }
133
+
119
134
  export default tenantReducer;
@@ -3,13 +3,26 @@ import type {TTenant} from '../../../types/api/tenant';
3
3
  import type {ValueOf} from '../../../types/common';
4
4
  import type {ApiRequestAction} from '../../utils';
5
5
 
6
- import {TENANT_QUERY_TABS_ID, TENANT_DIAGNOSTICS_TABS_IDS, TENANT_PAGES_IDS} from './constants';
7
- import {FETCH_TENANT, clearTenant, setDiagnosticsTab, setQueryTab, setTenantPage} from './tenant';
6
+ import {
7
+ TENANT_QUERY_TABS_ID,
8
+ TENANT_DIAGNOSTICS_TABS_IDS,
9
+ TENANT_PAGES_IDS,
10
+ TENANT_SUMMARY_TABS_IDS,
11
+ } from './constants';
12
+ import {
13
+ FETCH_TENANT,
14
+ clearTenant,
15
+ setDiagnosticsTab,
16
+ setQueryTab,
17
+ setSummaryTab,
18
+ setTenantPage,
19
+ } from './tenant';
8
20
 
9
21
  export type TenantPage = ValueOf<typeof TENANT_PAGES_IDS>;
10
22
 
11
23
  export type TenantQueryTab = ValueOf<typeof TENANT_QUERY_TABS_ID>;
12
24
  export type TenantDiagnosticsTab = ValueOf<typeof TENANT_DIAGNOSTICS_TABS_IDS>;
25
+ export type TenantSummaryTab = ValueOf<typeof TENANT_SUMMARY_TABS_IDS>;
13
26
 
14
27
  export interface TenantState {
15
28
  loading: boolean;
@@ -17,6 +30,7 @@ export interface TenantState {
17
30
  tenantPage?: TenantPage;
18
31
  queryTab?: TenantQueryTab;
19
32
  diagnosticsTab?: TenantDiagnosticsTab;
33
+ summaryTab?: TenantSummaryTab;
20
34
  tenant?: TTenant;
21
35
  error?: IResponseError;
22
36
  }
@@ -26,4 +40,5 @@ export type TenantAction =
26
40
  | ReturnType<typeof clearTenant>
27
41
  | ReturnType<typeof setTenantPage>
28
42
  | ReturnType<typeof setQueryTab>
29
- | ReturnType<typeof setDiagnosticsTab>;
43
+ | ReturnType<typeof setDiagnosticsTab>
44
+ | ReturnType<typeof setSummaryTab>;
@@ -51,6 +51,9 @@ const paramSetup = {
51
51
  diagnosticsTab: {
52
52
  stateKey: 'tenant.diagnosticsTab',
53
53
  },
54
+ summaryTab: {
55
+ stateKey: 'tenant.summaryTab',
56
+ },
54
57
  shardsMode: {
55
58
  stateKey: 'shardsWorkload.filters.mode',
56
59
  },
@@ -31,7 +31,7 @@ export interface TClusterInfo {
31
31
  Tenants?: string;
32
32
  /** uint64 */
33
33
  Tablets?: string;
34
-
34
+
35
35
  Balancer?: string; // additional
36
36
  Solomon?: string; // additional
37
37
  }
@@ -62,18 +62,18 @@ export interface TTabletStateInfo {
62
62
  }
63
63
 
64
64
  export enum EVersion {
65
- v1,
66
- v2, // only this versions works with sorting
65
+ v1 = 'v1',
66
+ v2 = 'v2', // only this versions works with sorting
67
67
  }
68
68
 
69
69
  export enum ESort {
70
- NodeId,
71
- Host,
72
- DC,
73
- Rack,
74
- Version,
75
- Uptime,
76
- Memory,
77
- CPU,
78
- LoadAverage,
70
+ NodeId = 'NodeId',
71
+ Host = 'Host',
72
+ DC = 'DC',
73
+ Rack = 'Rack',
74
+ Version = 'Version',
75
+ Uptime = 'Uptime',
76
+ Memory = 'Memory',
77
+ CPU = 'CPU',
78
+ LoadAverage = 'LoadAverage',
79
79
  }
@@ -1,5 +1,5 @@
1
- export interface IResponseError {
2
- data?: unknown;
1
+ export interface IResponseError<T = unknown> {
2
+ data?: T;
3
3
  status?: number;
4
4
  statusText?: string;
5
5
  isCancelled?: boolean;
@@ -42,7 +42,7 @@ interface TNetNodePeerInfo {
42
42
  }
43
43
 
44
44
  enum ENodeType {
45
- UnknownNodeType,
46
- Static,
47
- Dynamic,
45
+ UnknownNodeType = 'UnknownNodeType',
46
+ Static = 'Static',
47
+ Dynamic = 'Dynamic',
48
48
  }
@@ -103,12 +103,13 @@ enum EConfigState {
103
103
  }
104
104
 
105
105
  export enum ESort {
106
- NodeId,
107
- Host,
108
- DC,
109
- Version,
110
- Uptime,
111
- Memory,
112
- CPU,
113
- LoadAverage,
106
+ NodeId = 'NodeId',
107
+ Host = 'Host',
108
+ DC = 'DC',
109
+ Rack = 'Rack',
110
+ Version = 'Version',
111
+ Uptime = 'Uptime',
112
+ Memory = 'Memory',
113
+ CPU = 'CPU',
114
+ LoadAverage = 'LoadAverage',
114
115
  }
@@ -205,7 +205,7 @@ export type Actions = ExecuteActions | ExplainActions;
205
205
 
206
206
  export interface ErrorResponse {
207
207
  error?: IssueMessage;
208
- issues?: IssueMessage[];
208
+ issues?: IssueMessage[] | null;
209
209
  }
210
210
 
211
211
  // ==== Explain Responses ====
@@ -260,6 +260,9 @@ export enum EPathType {
260
260
  EPathTypeColumnStore = 'EPathTypeColumnStore',
261
261
  EPathTypeColumnTable = 'EPathTypeColumnTable',
262
262
  EPathTypeCdcStream = 'EPathTypeCdcStream',
263
+
264
+ EPathTypeExternalDataSource = 'EPathTypeExternalDataSource',
265
+ EPathTypeExternalTable = 'EPathTypeExternalTable',
263
266
  }
264
267
 
265
268
  export enum EPathSubType {
@@ -28,9 +28,9 @@ export interface TColumnDescription {
28
28
  }
29
29
 
30
30
  export enum EColumnCodec {
31
- ColumnCodecPlain,
32
- ColumnCodecLZ4,
33
- ColumnCodecZSTD,
31
+ ColumnCodecPlain = 'ColumnCodecPlain',
32
+ ColumnCodecLZ4 = 'ColumnCodecLZ4',
33
+ ColumnCodecZSTD = 'ColumnCodecZSTD',
34
34
  }
35
35
 
36
36
  export enum EUnit {
@@ -579,38 +579,38 @@ interface TBackgroundPolicy {
579
579
  }
580
580
 
581
581
  enum EPurpose {
582
- SysLog,
583
- Log,
584
- Data,
585
- External,
582
+ SysLog = 'SysLog',
583
+ Log = 'Log',
584
+ Data = 'Data',
585
+ External = 'External',
586
586
  }
587
587
 
588
588
  enum EFreezeState {
589
- Unspecified,
590
- Freeze,
591
- Unfreeze,
589
+ Unspecified = 'Unspecified',
590
+ Freeze = 'Freeze',
591
+ Unfreeze = 'Unfreeze',
592
592
  }
593
593
 
594
594
  enum EColumnCache {
595
- ColumnCacheNone,
596
- ColumnCacheOnce,
597
- ColumnCacheEver,
595
+ ColumnCacheNone = 'ColumnCacheNone',
596
+ ColumnCacheOnce = 'ColumnCacheOnce',
597
+ ColumnCacheEver = 'ColumnCacheEver',
598
598
  }
599
599
 
600
600
  enum EColumnStorage {
601
- ColumnStorage1,
602
- ColumnStorage2,
603
- ColumnStorage1Ext1,
604
- ColumnStorage1Ext2,
605
- ColumnStorage2Ext1,
606
- ColumnStorage2Ext2,
607
- ColumnStorage1Med2Ext2,
608
- ColumnStorage2Med2Ext2,
609
- ColumnStorageTest_1_2_1k,
601
+ ColumnStorage1 = 'ColumnStorage1',
602
+ ColumnStorage2 = 'ColumnStorage2',
603
+ ColumnStorage1Ext1 = 'ColumnStorage1Ext1',
604
+ ColumnStorage1Ext2 = 'ColumnStorage1Ext2',
605
+ ColumnStorage2Ext1 = 'ColumnStorage2Ext1',
606
+ ColumnStorage2Ext2 = 'ColumnStorage2Ext2',
607
+ ColumnStorage1Med2Ext2 = 'ColumnStorage1Med2Ext2',
608
+ ColumnStorage2Med2Ext2 = 'ColumnStorage2Med2Ext2',
609
+ ColumnStorageTest_1_2_1k = 'ColumnStorageTest_1_2_1k',
610
610
  }
611
611
 
612
612
  enum ECompactionStrategy {
613
- CompactionStrategyUnset,
614
- CompactionStrategyGenerational,
615
- CompactionStrategySharded,
613
+ CompactionStrategyUnset = 'CompactionStrategyUnset',
614
+ CompactionStrategyGenerational = 'CompactionStrategyGenerational',
615
+ CompactionStrategySharded = 'CompactionStrategySharded',
616
616
  }
@@ -3,7 +3,7 @@ import {TVDiskStateInfo} from './vdisk';
3
3
 
4
4
  /**
5
5
  * endpoint: /viewer/json/storage
6
- *
6
+ *
7
7
  * source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/viewer/protos/viewer.proto
8
8
  */
9
9
  export interface TStorageInfo {
@@ -8,5 +8,4 @@ declare module '*.jpg';
8
8
  declare module '*.jpeg';
9
9
  declare module '*.ico';
10
10
 
11
- declare type SVGIconData =
12
- import('@gravity-ui/uikit/build/esm/components/Icon/types').SVGIconData;
11
+ declare type SVGIconData = import('@gravity-ui/uikit/build/esm/components/Icon/types').SVGIconData;
@@ -9,9 +9,8 @@ import {
9
9
  MONACO_HOT_KEY_ACTIONS,
10
10
  } from '../../store/reducers/executeQuery';
11
11
  import type {ApiRequestAction} from '../../store/utils';
12
- import type {ErrorResponse} from '../api/query';
13
12
  import type {ValueOf} from '../common';
14
- import type {IQueryResult, QueryError} from './query';
13
+ import type {IQueryResult, QueryError, QueryErrorResponse} from './query';
15
14
 
16
15
  export type MonacoHotKeyAction = ValueOf<typeof MONACO_HOT_KEY_ACTIONS>;
17
16
 
@@ -26,7 +25,7 @@ export interface ExecuteQueryState {
26
25
  tenantPath?: string;
27
26
  data?: IQueryResult;
28
27
  stats?: IQueryResult['stats'];
29
- error?: string | ErrorResponse;
28
+ error?: string | QueryErrorResponse;
30
29
  }
31
30
 
32
31
  type SendQueryAction = ApiRequestAction<typeof SEND_QUERY, IQueryResult, QueryError>;
@@ -1,7 +1,10 @@
1
- import {FETCH_TOP_QUERIES, setTopQueriesState, setTopQueriesFilters} from '../../store/reducers/executeTopQueries';
1
+ import {
2
+ FETCH_TOP_QUERIES,
3
+ setTopQueriesState,
4
+ setTopQueriesFilters,
5
+ } from '../../store/reducers/executeTopQueries';
2
6
  import type {ApiRequestAction} from '../../store/utils';
3
- import type {IResponseError} from '../api/error';
4
- import type {IQueryResult} from './query';
7
+ import type {IQueryResult, QueryErrorResponse} from './query';
5
8
 
6
9
  export interface ITopQueriesFilters {
7
10
  /** ms from epoch */
@@ -15,12 +18,12 @@ export interface ITopQueriesState {
15
18
  loading: boolean;
16
19
  wasLoaded: boolean;
17
20
  data?: IQueryResult;
18
- error?: IResponseError;
21
+ error?: QueryErrorResponse;
19
22
  filters: ITopQueriesFilters;
20
23
  }
21
24
 
22
25
  export type ITopQueriesAction =
23
- | ApiRequestAction<typeof FETCH_TOP_QUERIES, IQueryResult, IResponseError>
26
+ | ApiRequestAction<typeof FETCH_TOP_QUERIES, IQueryResult, QueryErrorResponse>
24
27
  | ReturnType<typeof setTopQueriesState>
25
28
  | ReturnType<typeof setTopQueriesFilters>;
26
29
 
@@ -2,8 +2,8 @@ import type {ExplainPlanNodeData, GraphNode, Link} from '@gravity-ui/paranoid';
2
2
 
3
3
  import {GET_EXPLAIN_QUERY, GET_EXPLAIN_QUERY_AST} from '../../store/reducers/explainQuery';
4
4
  import type {ApiRequestAction} from '../../store/utils';
5
- import type {PlanTable, ErrorResponse, QueryPlan, ScriptPlan} from '../api/query';
6
- import type {IQueryResult, QueryError} from './query';
5
+ import type {PlanTable, QueryPlan, ScriptPlan} from '../api/query';
6
+ import type {IQueryResult, QueryError, QueryErrorResponse} from './query';
7
7
 
8
8
  export interface PreparedExplainResponse {
9
9
  plan?: {
@@ -20,8 +20,8 @@ export interface ExplainQueryState {
20
20
  loading: boolean;
21
21
  data?: PreparedExplainResponse['plan'];
22
22
  dataAst?: PreparedExplainResponse['ast'];
23
- error?: string | ErrorResponse;
24
- errorAst?: string | ErrorResponse;
23
+ error?: string | QueryErrorResponse;
24
+ errorAst?: string | QueryErrorResponse;
25
25
  }
26
26
 
27
27
  type GetExplainQueryAstAction = ApiRequestAction<
@@ -1,10 +1,10 @@
1
1
  import {QUERY_ACTIONS, QUERY_MODES} from '../../utils/query';
2
2
 
3
- import type {NetworkError} from '../api/error';
3
+ import type {IResponseError, NetworkError} from '../api/error';
4
4
  import type {
5
5
  KeyValueRow,
6
6
  ColumnType,
7
- ErrorResponse,
7
+ ErrorResponse as QueryErrorResponseData,
8
8
  ScriptPlan,
9
9
  QueryPlan,
10
10
  TKqpStatsQuery,
@@ -24,7 +24,8 @@ export interface QueryRequestParams {
24
24
  query: string;
25
25
  }
26
26
 
27
- export type QueryError = NetworkError | ErrorResponse;
27
+ export type QueryErrorResponse = IResponseError<QueryErrorResponseData>;
28
+ export type QueryError = NetworkError | QueryErrorResponse;
28
29
 
29
30
  export type QueryAction = ValueOf<typeof QUERY_ACTIONS>;
30
31
  export type QueryMode = ValueOf<typeof QUERY_MODES>;
@@ -1,7 +1,10 @@
1
- import {SEND_SHARD_QUERY, setShardsState, setShardsQueryFilters} from '../../store/reducers/shardsWorkload';
1
+ import {
2
+ SEND_SHARD_QUERY,
3
+ setShardsState,
4
+ setShardsQueryFilters,
5
+ } from '../../store/reducers/shardsWorkload';
2
6
  import type {ApiRequestAction} from '../../store/utils';
3
- import type {IResponseError} from '../api/error';
4
- import type {IQueryResult} from './query';
7
+ import type {IQueryResult, QueryErrorResponse} from './query';
5
8
 
6
9
  export enum EShardsWorkloadMode {
7
10
  Immediate = 'immediate',
@@ -20,12 +23,12 @@ export interface IShardsWorkloadState {
20
23
  loading: boolean;
21
24
  wasLoaded: boolean;
22
25
  data?: IQueryResult;
23
- error?: IResponseError;
26
+ error?: QueryErrorResponse;
24
27
  filters: IShardsWorkloadFilters;
25
28
  }
26
29
 
27
30
  export type IShardsWorkloadAction =
28
- | ApiRequestAction<typeof SEND_SHARD_QUERY, IQueryResult, IResponseError>
31
+ | ApiRequestAction<typeof SEND_SHARD_QUERY, IQueryResult, QueryErrorResponse>
29
32
  | ReturnType<typeof setShardsState>
30
33
  | ReturnType<typeof setShardsQueryFilters>;
31
34
 
@@ -75,8 +75,11 @@ export const COLORS_PRIORITY = {
75
75
  grey: 1,
76
76
  };
77
77
 
78
- export const DEVELOPER_UI = 'Developer UI';
78
+ // ==== Titles ====
79
+ export const DEVELOPER_UI_TITLE = 'Developer UI';
80
+ export const CLUSTER_DEFAULT_TITLE = 'Cluster';
79
81
 
82
+ // ==== Settings ====
80
83
  export const THEME_KEY = 'theme';
81
84
  export const INVERTED_DISKS_KEY = 'invertedDisks';
82
85
  export const USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY = 'useNodesEndpointInDiagnostics';
@@ -1,10 +1,9 @@
1
1
  import type {AxiosError} from 'axios';
2
2
 
3
3
  import type {IResponseError, NetworkError} from '../types/api/error';
4
- import type {ErrorResponse as QueryErrorResponse} from '../types/api/query';
5
- import type {QueryError} from '../types/store/query';
4
+ import type {QueryError, QueryErrorResponse} from '../types/store/query';
6
5
 
7
- type RequestError = NetworkError | IResponseError | AxiosError | QueryErrorResponse | unknown;
6
+ type RequestError = NetworkError | IResponseError | AxiosError | unknown;
8
7
 
9
8
  const isNetworkError = (error: RequestError): error is NetworkError => {
10
9
  return Boolean(
@@ -7,7 +7,7 @@ import type {
7
7
  QueryPlan,
8
8
  ScriptPlan,
9
9
  } from '../types/api/query';
10
- import type {IQueryResult} from '../types/store/query';
10
+ import type {IQueryResult, QueryErrorResponse} from '../types/store/query';
11
11
 
12
12
  export const QUERY_ACTIONS = {
13
13
  execute: 'execute',
@@ -169,12 +169,6 @@ export const prepareQueryResponse = (data?: KeyValueRow[]) => {
169
169
  });
170
170
  };
171
171
 
172
- export function prepareQueryError(error: any) {
173
- return (
174
- error.data?.error?.message ||
175
- error.message ||
176
- error.data ||
177
- error.statusText ||
178
- JSON.stringify(error)
179
- );
172
+ export function prepareQueryError(error: QueryErrorResponse) {
173
+ return error.data?.error?.message || error.statusText;
180
174
  }
@@ -1,7 +1,7 @@
1
1
  import React, {PropsWithChildren} from 'react';
2
- import {Provider} from 'react-redux'
3
- import {render} from '@testing-library/react'
4
- import type {RenderOptions} from '@testing-library/react'
2
+ import {Provider} from 'react-redux';
3
+ import {render} from '@testing-library/react';
4
+ import type {RenderOptions} from '@testing-library/react';
5
5
 
6
6
  import configureStore from '../../store';
7
7
 
@@ -14,16 +14,13 @@ interface ExtendedRenderOptions extends Omit<RenderOptions, 'queries'> {
14
14
 
15
15
  export const renderWithStore = (
16
16
  ui: React.ReactElement,
17
- {
18
- storeConfiguration = configureStore(),
19
- ...renderOptions
20
- }: ExtendedRenderOptions = {}
17
+ {storeConfiguration = configureStore(), ...renderOptions}: ExtendedRenderOptions = {},
21
18
  ) => {
22
19
  const {store} = storeConfiguration;
23
20
 
24
21
  function Wrapper({children}: PropsWithChildren<{}>) {
25
- return <Provider store={store}>{children}</Provider>
22
+ return <Provider store={store}>{children}</Provider>;
26
23
  }
27
24
 
28
- return {store, ...render(ui, {wrapper: Wrapper, ...renderOptions})}
25
+ return {store, ...render(ui, {wrapper: Wrapper, ...renderOptions})};
29
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "4.10.1",
3
+ "version": "4.11.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -17,6 +17,7 @@
17
17
  "@gravity-ui/react-data-table": "^1.0.3",
18
18
  "axios": "0.19.2",
19
19
  "bem-cn-lite": "4.0.0",
20
+ "copy-to-clipboard": "^3.3.3",
20
21
  "history": "4.10.1",
21
22
  "js-cookie": "2.2.1",
22
23
  "keymaster": "1.6.2",
@@ -39,7 +40,7 @@
39
40
  "reselect": "4.1.6",
40
41
  "sass": "1.32.8",
41
42
  "web-vitals": "1.1.2",
42
- "ydb-ui-components": "^3.1.0"
43
+ "ydb-ui-components": "^3.2.1"
43
44
  },
44
45
  "scripts": {
45
46
  "start": "react-app-rewired start",
@@ -64,6 +65,9 @@
64
65
  ],
65
66
  "*.{js,jsx,ts,tsx}": [
66
67
  "eslint --fix --quiet"
68
+ ],
69
+ "*.{json}": [
70
+ "prettier --write"
67
71
  ]
68
72
  },
69
73
  "jest": {