Skip to content

Commit 53267b7

Browse files
committed
Atif's review comments
Signed-off-by: Keith Chong <[email protected]>
1 parent 10e3e23 commit 53267b7

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/gitops/components/rollout/RolloutNavPage.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22

33
import { useGitOpsTranslation } from '@gitops/utils/hooks/useGitOpsTranslation';
44
import { HorizontalNav, useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
5+
import { ErrorState } from '@patternfly/react-component-groups';
56
import { Bullseye, Spinner } from '@patternfly/react-core';
67

78
import DetailsPageHeader from '../shared/DetailsPageHeader/DetailsPageHeader';
@@ -20,7 +21,7 @@ type RolloutPageProps = {
2021

2122
const RolloutNavPage: React.FC<RolloutPageProps> = ({ name, namespace, kind }) => {
2223
const { t } = useGitOpsTranslation();
23-
const [rollout, loaded] = useK8sWatchResource<RolloutKind>({
24+
const [rollout, loaded, loadError] = useK8sWatchResource<RolloutKind>({
2425
groupVersionKind: {
2526
group: 'argoproj.io',
2627
kind: 'Rollout',
@@ -65,10 +66,18 @@ const RolloutNavPage: React.FC<RolloutPageProps> = ({ name, namespace, kind }) =
6566
iconText="AR"
6667
iconTitle="Argo Rollout"
6768
/>
68-
{loaded ? (
69+
{/* eslint-disable-next-line no-nested-ternary */}
70+
{loaded && !loadError ? (
6971
<div>
7072
<HorizontalNav pages={pages} resource={rollout} />
7173
</div>
74+
) : loadError ? (
75+
<ErrorState
76+
titleText={t('Unable to load data')}
77+
bodyText={t(
78+
'There was an error retrieving the rollout. Check your connection and reload the page.',
79+
)}
80+
/>
7281
) : (
7382
<Bullseye>
7483
<Spinner size="xl" />

src/gitops/components/rollout/model/RolloutModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ export type AnalysisTemplates = {
2626
};
2727

2828
export type Steps = {
29+
setWeight: number;
30+
experiment?: string;
2931
analysis?: {
30-
setWeight: number;
3132
templates?: AnalysisTemplates[];
32-
experiment?: string;
3333
};
3434
};
3535

0 commit comments

Comments
 (0)