Skip to content

Commit

Permalink
Hide upgrade paths and show checklist progress during upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamilto committed Jul 16, 2020
1 parent 8002686 commit 281ac2c
Show file tree
Hide file tree
Showing 9 changed files with 435 additions and 99 deletions.
35 changes: 33 additions & 2 deletions frontend/__tests__/components/cluster-settings.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Cluster Settings page', () => {
.find(Firehose)
.at(0)
.props().resources.length,
).toBe(2);
).toBe(4);
expect(
wrapper
.find(Firehose)
Expand All @@ -51,6 +51,18 @@ describe('Cluster Settings page', () => {
.at(0)
.props().resources[1].kind,
).toBe('autoscaling.openshift.io~v1~ClusterAutoscaler');
expect(
wrapper
.find(Firehose)
.at(0)
.props().resources[2].kind,
).toBe('machineconfiguration.openshift.io~v1~MachineConfigPool');
expect(
wrapper
.find(Firehose)
.at(0)
.props().resources[3].kind,
).toBe('config.openshift.io~v1~ClusterOperator');
expect(
wrapper
.find(Firehose)
Expand All @@ -69,6 +81,18 @@ describe('Cluster Settings page', () => {
.at(0)
.props().resources[1].isList,
).toBe(true);
expect(
wrapper
.find(Firehose)
.at(0)
.props().resources[2].isList,
).toBe(true);
expect(
wrapper
.find(Firehose)
.at(0)
.props().resources[3].isList,
).toBe(true);
});
it('should render the HorizontalNav Component with the props', () => {
expect(wrapper.find(HorizontalNav).exists()).toBe(true);
Expand Down Expand Up @@ -123,7 +147,14 @@ describe('Cluster Version Details Table page', () => {

beforeEach(() => {
cv = clusterVersionProps;
wrapper = shallow(<ClusterVersionDetailsTable obj={cv} autoscalers={[]} />);
wrapper = shallow(
<ClusterVersionDetailsTable
autoscalers={[]}
clusterOperators={[]}
machineConfigPools={[]}
obj={cv}
/>,
);
});

it('should render ClusterVersionDetailsTable component', () => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"react-redux": "7.1.0",
"react-router": "5.0.1",
"react-router-dom": "5.0.1",
"react-router-hash-link": "^2.0.0",
"react-tagsinput": "3.19.x",
"react-transition-group": "2.3.x",
"react-virtualized": "9.x",
Expand All @@ -156,11 +157,11 @@
},
"devDependencies": {
"@babel/core": "^7.10.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.3.3",
"@graphql-codegen/cli": "^1.15.1",
"@graphql-codegen/typescript": "^1.15.1",
"@graphql-codegen/typescript-graphql-files-modules": "^1.15.1",
"@graphql-codegen/typescript-operations": "^1.15.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.3.3",
"@types/classnames": "^2.2.7",
"@types/enzyme": "3.10.x",
"@types/glob": "7.x",
Expand Down
17 changes: 17 additions & 0 deletions frontend/public/components/cluster-settings/_cluster-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,23 @@ $co-channel-height: 60px;
display: none;
}
}

&__updates-group {
margin: 0 0 var(--pf-global--spacer--lg) 0;

&--divided {
border-top: 1px solid $color-pf-black-200;
padding-top: var(--pf-global--spacer--lg);
}
}

&__updates-progress {
padding: var(--pf-global--spacer--sm) var(--pf-global--spacer--lg) 0 0;
}

&__updates-type {
margin: 0 0 var(--pf-global--spacer--xs) 0;
}
}

.co-update-status {
Expand Down
16 changes: 12 additions & 4 deletions frontend/public/components/cluster-settings/cluster-operator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
} from '../utils';
import { GreenCheckCircleIcon, YellowExclamationTriangleIcon } from '@console/shared';
import RelatedObjectsPage from './related-objects';
import { ClusterVersionLink, UpdatingMessageText } from './cluster-settings';

export const clusterOperatorReference: K8sResourceKindReference = referenceForModel(
ClusterOperatorModel,
Expand Down Expand Up @@ -144,7 +145,7 @@ const filters = [
},
];

const UpdateInProgressAlert: React.SFC<UpdateInProgressAlertProps> = ({ cv }) => {
const UpdateInProgressAlert: React.SFC<UpdateInProgressAlertProps> = ({ clusterOperators, cv }) => {
const updateCondition = getClusterVersionCondition(
cv,
ClusterVersionConditionType.Progressing,
Expand All @@ -154,8 +155,13 @@ const UpdateInProgressAlert: React.SFC<UpdateInProgressAlertProps> = ({ cv }) =>
<>
{updateCondition && (
<div className="co-m-pane__body co-m-pane__body--section-heading">
<Alert isInline className="co-alert" variant="info" title="Cluster update in progress.">
{updateCondition.message}
<Alert
isInline
className="co-alert"
variant="info"
title={<UpdatingMessageText clusterOperators={clusterOperators} cv={cv} />}
>
<ClusterVersionLink cv={cv} />
</Alert>
</div>
)}
Expand All @@ -165,7 +171,7 @@ const UpdateInProgressAlert: React.SFC<UpdateInProgressAlertProps> = ({ cv }) =>

export const ClusterOperatorPage: React.SFC<ClusterOperatorPageProps> = (props) => (
<>
<UpdateInProgressAlert cv={props.cv} />
<UpdateInProgressAlert cv={props.cv} clusterOperators={props.clusterOperators} />
<ListPage
{...props}
title="Cluster Operators"
Expand Down Expand Up @@ -272,6 +278,7 @@ type OperatorStatusIconAndLabelProps = {
};

type ClusterOperatorPageProps = {
clusterOperators: ClusterOperator[];
cv: ClusterVersionKind;
autoFocus?: boolean;
showTitle?: boolean;
Expand All @@ -290,5 +297,6 @@ type ClusterOperatorDetailsPageProps = {
};

type UpdateInProgressAlertProps = {
clusterOperators: ClusterOperator[];
cv: ClusterVersionKind;
};

0 comments on commit 281ac2c

Please sign in to comment.