ydb-embedded-ui 1.2.0 → 1.2.3

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.2.3](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.2.2...v1.2.3) (2022-05-05)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **node reducer:** should specify concurrentId in getNodeStructure ([103c843](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/103c843524e21af421954444774d68bda540ceae))
9
+
10
+ ### [1.2.2](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.2.1...v1.2.2) (2022-05-04)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * code-review ([288fda3](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/288fda3cd207908e9b5c0486c4d486c6f2e17dd4))
16
+ * reducer clusterInfo should not be used ([1cafcbf](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/1cafcbfb15f668b100cf6628b540b7cd234f6024))
17
+
18
+ ### [1.2.1](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.2.0...v1.2.1) (2022-04-27)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **Vdisk:** should not fail if no node id passed ([d66686d](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/d66686d0cbd9f61c4e106f6775db2fca226c922f))
24
+
3
25
  ## [1.2.0](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.1.3...v1.2.0) (2022-04-26)
4
26
 
5
27
 
@@ -17,6 +17,8 @@ registerLanguages();
17
17
  class App extends React.Component {
18
18
  static propTypes = {
19
19
  isAuthenticated: PropTypes.bool,
20
+ singleClusterMode: PropTypes.bool,
21
+ clusterName: PropTypes.string,
20
22
  children: PropTypes.node,
21
23
  };
22
24
 
@@ -40,9 +42,10 @@ class App extends React.Component {
40
42
  }
41
43
 
42
44
  renderContentWithNavigation() {
45
+ const {singleClusterMode, clusterName} = this.props;
43
46
  return (
44
47
  <AsideNavigation>
45
- <Content singleClusterMode={this.props.singleClusterMode} />
48
+ <Content singleClusterMode={singleClusterMode} clusterName={clusterName} />
46
49
  <div id="fullscreen-root"></div>
47
50
  </AsideNavigation>
48
51
  );
@@ -58,6 +61,7 @@ function mapStateToProps(state) {
58
61
  isAuthenticated: state.authentication.isAuthenticated,
59
62
  internalUser: state.authentication.user,
60
63
  singleClusterMode: state.singleClusterMode,
64
+ clusterName: state.cluster.data?.Name,
61
65
  };
62
66
  }
63
67
 
@@ -59,7 +59,7 @@ export function Content(props) {
59
59
  };
60
60
  return (
61
61
  <React.Fragment>
62
- {!isClustersPage && <Header />}
62
+ {!isClustersPage && <Header clusterName={props.clusterName} />}
63
63
  <main className={b('main')}>{renderRoute()}</main>
64
64
  <ReduxTooltip />
65
65
  <AppIcons />
@@ -70,6 +70,7 @@ export function Content(props) {
70
70
  Content.propTypes = {
71
71
  singleClusterMode: PropTypes.bool,
72
72
  children: PropTypes.node,
73
+ clusterName: PropTypes.string,
73
74
  };
74
75
 
75
76
  function ContentWrapper(props) {
@@ -26,16 +26,16 @@ function ClusterName({name}: {name: string}) {
26
26
  );
27
27
  }
28
28
 
29
- function Header() {
29
+ interface HeaderProps {
30
+ clusterName: string
31
+ }
32
+
33
+ function Header({clusterName}: HeaderProps) {
30
34
  const dispatch = useDispatch();
31
35
  const {data: host}: {data: {ClusterName?: string}} = useSelector((state: any) => state.host);
32
36
  const {singleClusterMode, header}: {singleClusterMode: boolean; header: HeaderItemType[]} =
33
37
  useSelector((state: any) => state);
34
38
 
35
- const clusterName: string = useSelector(
36
- (state: any) => state.cluster.data?.Name || state.clusterInfo.title,
37
- );
38
-
39
39
  const location = useLocation();
40
40
  const history = useHistory();
41
41
 
@@ -235,11 +235,18 @@ function Vdisk(props) {
235
235
  <DiskStateProgressBar
236
236
  diskAllocatedPercent={vdiskAllocatedPercent}
237
237
  severity={severity}
238
- href={createHref(
239
- routes.node,
240
- {id: props.NodeId, activeTab: STRUCTURE},
241
- {pdiskId: props.PDisk?.PDiskId, vdiskId: stringifyVdiskId(props.VDiskId)},
242
- )}
238
+ href={
239
+ props.NodeId
240
+ ? createHref(
241
+ routes.node,
242
+ {id: props.NodeId, activeTab: STRUCTURE},
243
+ {
244
+ pdiskId: props.PDisk?.PDiskId,
245
+ vdiskId: stringifyVdiskId(props.VDiskId),
246
+ },
247
+ )
248
+ : undefined
249
+ }
243
250
  />
244
251
  </div>
245
252
  </React.Fragment>
@@ -20,7 +20,6 @@ import tablet from './tablet';
20
20
  import executeQuery from './executeQuery';
21
21
  import explainQuery from './explainQuery';
22
22
  import tabletsFilters from './tabletsFilters';
23
- import clusterInfo from './clusterInfo';
24
23
  import settings from './settings';
25
24
  import preview from './preview';
26
25
  import nodesList from './clusterNodes';
@@ -63,7 +62,6 @@ export const rootReducer = {
63
62
  explainQuery,
64
63
  tabletsFilters,
65
64
  heatmap,
66
- clusterInfo,
67
65
  settings,
68
66
  preview,
69
67
  nodesList,
@@ -86,7 +86,7 @@ export const getNodeInfo = (id) => {
86
86
 
87
87
  export const getNodeStructure = (nodeId) => {
88
88
  return createApiRequest({
89
- request: window.api.getStorageInfo({nodeId}),
89
+ request: window.api.getStorageInfo({nodeId}, {concurrentId: 'getNodeStructure'}),
90
90
  actions: FETCH_NODE_STRUCTURE,
91
91
  });
92
92
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "1.2.0",
3
+ "version": "1.2.3",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1,48 +0,0 @@
1
- import {createRequestActionTypes, createApiRequest} from '../utils';
2
- import '../../services/api';
3
-
4
- const FETCH_CLUSTER = createRequestActionTypes('cluster', 'FETCH_CLUSTER');
5
-
6
- const initialState = {loading: false};
7
-
8
- const clusterInfo = function (state = initialState, action) {
9
- switch (action.type) {
10
- case FETCH_CLUSTER.REQUEST: {
11
- return {
12
- ...state,
13
- loading: true,
14
- };
15
- }
16
- case FETCH_CLUSTER.SUCCESS: {
17
- const {data = {}} = action;
18
-
19
- return {
20
- ...state,
21
- ...data,
22
- loading: false,
23
- error: undefined,
24
- };
25
- }
26
- case FETCH_CLUSTER.FAILURE: {
27
- return {
28
- ...state,
29
- error: action.error,
30
- loading: false,
31
- };
32
- }
33
- default:
34
- return state;
35
- }
36
- };
37
-
38
- export function getCluster(name) {
39
- return createApiRequest({
40
- request: window.api.getClustersList(),
41
- actions: FETCH_CLUSTER,
42
- dataHandler: ({clusters = []}) => {
43
- return clusters.filter((item) => item.name === name)[0];
44
- },
45
- });
46
- }
47
-
48
- export default clusterInfo;