ydb-embedded-ui 4.8.1 → 4.8.2

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.8.2](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.8.1...v4.8.2) (2023-06-27)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **breadcrumbs:** update tenant and tablet params ([#443](https://github.com/ydb-platform/ydb-embedded-ui/issues/443)) ([b0d31ac](https://github.com/ydb-platform/ydb-embedded-ui/commit/b0d31acce6d6e97d759180c885e6aea3b762a91c))
9
+
3
10
  ## [4.8.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.8.0...v4.8.1) (2023-06-26)
4
11
 
5
12
 
@@ -18,21 +18,10 @@ interface TabletProps {
18
18
  }
19
19
 
20
20
  export const Tablet = ({tablet = {}, tenantName}: TabletProps) => {
21
- const {TabletId: id, NodeId, Type, State} = tablet;
21
+ const {TabletId: id, NodeId} = tablet;
22
22
  const status = tablet.Overall?.toLowerCase();
23
23
 
24
- const tabletPath =
25
- id &&
26
- createHref(
27
- routes.tablet,
28
- {id},
29
- {
30
- nodeId: NodeId,
31
- type: Type,
32
- state: State,
33
- tenantName,
34
- },
35
- );
24
+ const tabletPath = id && createHref(routes.tablet, {id}, {nodeId: NodeId, tenantName});
36
25
 
37
26
  return (
38
27
  <ContentWithPopup
@@ -10,10 +10,15 @@ import type {
10
10
  TabletsBreadcrumbsOptions,
11
11
  TenantBreadcrumbsOptions,
12
12
  } from '../../store/reducers/header/types';
13
+ import {
14
+ TENANT_DIAGNOSTICS_TABS_IDS,
15
+ TENANT_PAGE,
16
+ TENANT_PAGES_IDS,
17
+ } from '../../store/reducers/tenant/constants';
13
18
  import routes, {createHref} from '../../routes';
14
19
 
15
20
  import {getClusterPath} from '../Cluster/utils';
16
- import {getTenantPath} from '../Tenant/TenantPages';
21
+ import {TenantTabsGroups, getTenantPath} from '../Tenant/TenantPages';
17
22
  import {getDefaultNodePath} from '../Node/NodePages';
18
23
 
19
24
  const prepareTenantName = (tenantName: string) => {
@@ -61,10 +66,16 @@ const getNodeBreadcrumbs = (options: NodeBreadcrumbsOptions, query = {}): RawBre
61
66
  // Compute nodes have tenantName, storage nodes doesn't
62
67
  const isStorageNode = !tenantName;
63
68
 
69
+ const newQuery = {
70
+ ...query,
71
+ [TENANT_PAGE]: TENANT_PAGES_IDS.diagnostics,
72
+ [TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.nodes,
73
+ };
74
+
64
75
  if (isStorageNode) {
65
76
  breadcrumbs = getClusterBreadcrumbs(options, query);
66
77
  } else {
67
- breadcrumbs = getTenantBreadcrumbs(options, query);
78
+ breadcrumbs = getTenantBreadcrumbs(options, newQuery);
68
79
  }
69
80
 
70
81
  const text = nodeId ? `Node ${nodeId}` : 'Node';
@@ -79,21 +90,26 @@ const getTabletsBreadcrubms = (
79
90
  options: TabletsBreadcrumbsOptions,
80
91
  query = {},
81
92
  ): RawBreadcrumbItem[] => {
82
- const {tenantName, nodeIds, state, type} = options;
93
+ const {tenantName, nodeIds} = options;
94
+
95
+ const newQuery = {
96
+ ...query,
97
+ [TENANT_PAGE]: TENANT_PAGES_IDS.diagnostics,
98
+ [TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.tablets,
99
+ };
83
100
 
84
101
  let breadcrumbs: RawBreadcrumbItem[];
85
102
 
86
103
  // Cluster system tablets don't have tenantName
87
104
  if (tenantName) {
88
- breadcrumbs = getTenantBreadcrumbs(options, query);
105
+ breadcrumbs = getTenantBreadcrumbs(options, newQuery);
89
106
  } else {
90
107
  breadcrumbs = getClusterBreadcrumbs(options, query);
91
108
  }
92
109
 
93
110
  const link = createHref(routes.tabletsFilters, undefined, {
111
+ ...query,
94
112
  nodeIds,
95
- state,
96
- type,
97
113
  path: tenantName,
98
114
  });
99
115
 
@@ -48,16 +48,9 @@ export const Tablet = () => {
48
48
  error,
49
49
  } = useTypedSelector((state) => state.tablet);
50
50
 
51
- const {
52
- nodeId: queryNodeId,
53
- type: queryType,
54
- state: queryState,
55
- tenantName: queryTenantName,
56
- } = parseQuery(location);
51
+ const {nodeId: queryNodeId, tenantName: queryTenantName} = parseQuery(location);
57
52
 
58
53
  const nodeId = tablet.NodeId?.toString() || queryNodeId?.toString();
59
- const tabletState = tablet.State || queryState?.toString();
60
- const tabletType = tablet.Type || queryType?.toString();
61
54
  const tenantName = tenantPath || queryTenantName?.toString();
62
55
 
63
56
  // NOTE: should be reviewed when migrating to React 18
@@ -84,13 +77,11 @@ export const Tablet = () => {
84
77
  dispatch(
85
78
  setHeaderBreadcrumbs('tablet', {
86
79
  nodeIds: nodeId ? [nodeId] : [],
87
- state: tabletState,
88
- type: tabletType,
89
80
  tenantName,
90
81
  tabletId: id,
91
82
  }),
92
83
  );
93
- }, [dispatch, tenantName, id, nodeId, tabletState, tabletType]);
84
+ }, [dispatch, tenantName, id, nodeId]);
94
85
 
95
86
  const renderExternalLinks = (link: {name: string; path: string}, index: number) => {
96
87
  return (
@@ -81,10 +81,15 @@ class TabletsFilters extends React.Component {
81
81
  });
82
82
  const {nodeIds, type, path, state} = queryParams;
83
83
  const nodes = TabletsFilters.parseNodes(nodeIds);
84
- const stateFilter = TabletsFilters.getStateFiltersFromColor(state);
85
84
 
86
- setStateFilter(stateFilter);
87
- setTypeFilter([type]);
85
+ if (state) {
86
+ const stateFilter = TabletsFilters.getStateFiltersFromColor(state);
87
+ setStateFilter(stateFilter);
88
+ }
89
+
90
+ if (type) {
91
+ setTypeFilter([type]);
92
+ }
88
93
 
89
94
  this.setState({nodeFilter: nodes, tenantPath: path}, () => {
90
95
  this.makeRequest();
@@ -19,8 +19,6 @@ export interface NodeBreadcrumbsOptions extends TenantBreadcrumbsOptions {
19
19
 
20
20
  export interface TabletsBreadcrumbsOptions extends TenantBreadcrumbsOptions {
21
21
  nodeIds?: string[] | number[];
22
- state?: string;
23
- type?: string;
24
22
  }
25
23
 
26
24
  export interface TabletBreadcrumbsOptions extends TabletsBreadcrumbsOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "4.8.1",
3
+ "version": "4.8.2",
4
4
  "files": [
5
5
  "dist"
6
6
  ],