Skip to content

Commit

Permalink
Merge branch 'bugfix/retrieve-version-in-node-list-componnet' into q/…
Browse files Browse the repository at this point in the history
…2.11
  • Loading branch information
bert-e committed Jun 16, 2022
2 parents e9c25ec + 39452cf commit f94b4a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 8 additions & 3 deletions ui/src/components/NodePageOverviewTab.js
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { FormattedDate, FormattedTime } from 'react-intl';
import styled from 'styled-components';
Expand All @@ -11,7 +11,7 @@ import ActiveAlertsCounter from './ActiveAlertsCounter';
import { Steppers, Loader } from '@scality/core-ui';
import { Button } from '@scality/core-ui/dist/next';
import isEmpty from 'lodash.isempty';
import { deployNodeAction } from '../ducks/app/nodes';
import { deployNodeAction, fetchClusterVersionAction } from '../ducks/app/nodes';
import {
NodeTab,
OverviewInformationLabel,
Expand Down Expand Up @@ -90,6 +90,11 @@ const NodePageOverviewTab = (props) => {
const intl = useIntl();
const dispatch = useDispatch();

//Node deployment rely on the cluster version hence we need to ensure to have fetch it here
useEffect(() => {
dispatch(fetchClusterVersionAction());
}, [dispatch]);

const jobs = useSelector((state) =>
state.app.salt.jobs.filter(
(job) => job.type === 'deploy-node' && job.node === nodeName,
Expand Down Expand Up @@ -173,7 +178,7 @@ const NodePageOverviewTab = (props) => {
label={intl.formatMessage({ id: 'deploy' })}
variant="secondary"
onClick={() => {
dispatch(deployNodeAction({ nodeName }));
dispatch(deployNodeAction({ name: nodeName }));
}}
/>
) : (
Expand Down
8 changes: 7 additions & 1 deletion ui/src/containers/NodeList.js
@@ -1,6 +1,6 @@
//@flow

import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { useHistory } from 'react-router';
import styled from 'styled-components';
Expand All @@ -9,6 +9,7 @@ import { Button } from '@scality/core-ui/dist/next';
import { padding } from '@scality/core-ui/dist/style/theme';
import {
deployNodeAction,
fetchClusterVersionAction,
refreshNodesAction,
stopRefreshNodesAction,
} from '../ducks/app/nodes';
Expand Down Expand Up @@ -62,6 +63,11 @@ const NodeList = () => {
const intl = useIntl();
useRefreshEffect(refreshNodesAction, stopRefreshNodesAction);

//Node deployment rely on the cluster version hence we need to ensure to have fetch it here
useEffect(() => {
dispatch(fetchClusterVersionAction());
}, [dispatch]);

const [sortBy, setSortBy] = useState('name');
const [sortDirection, setSortDirection] = useState('ASC');
const history = useHistory();
Expand Down

0 comments on commit f94b4a7

Please sign in to comment.