From 2c0d401952793a72332ee3e2533cd841b748da9e Mon Sep 17 00:00:00 2001 From: Keith Chong Date: Tue, 7 Jul 2026 08:23:19 -0400 Subject: [PATCH] Error displayed while fetching rollout revisions details (#10132) Signed-off-by: Keith Chong --- .../rollout/RolloutRevisionsTab.tsx | 6 ++++- src/gitops/topology/console/pod-traffic.tsx | 21 +---------------- .../components/LoadingSpinner/Loading.tsx | 23 +++++++++++++++++++ 3 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 src/gitops/utils/components/LoadingSpinner/Loading.tsx diff --git a/src/gitops/components/rollout/RolloutRevisionsTab.tsx b/src/gitops/components/rollout/RolloutRevisionsTab.tsx index b4eb6bcb8..84e65f098 100644 --- a/src/gitops/components/rollout/RolloutRevisionsTab.tsx +++ b/src/gitops/components/rollout/RolloutRevisionsTab.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import classNames from 'classnames'; import { PodKind } from '@gitops/topology/console/types'; +import { Loading } from '@gitops/utils/components/LoadingSpinner/Loading'; import { useGitOpsTranslation } from '@gitops/utils/hooks/useGitOpsTranslation'; import { resourceAsArray } from '@gitops/utils/utils'; import { K8sResourceCommon, useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk'; @@ -54,7 +55,8 @@ const RolloutRevisionsTab: React.FC = ({ obj: rollout {t('Rollout Revisions')} - {loadError || !loaded || !podsloaded || podsloadError ? ( + {/* eslint-disable-next-line no-nested-ternary */} + {loadError || podsloadError ? (
= ({ obj: rollout {error}
+ ) : !loaded || !podsloaded ? ( + ) : ( ; -LoadingInline.displayName = 'LoadingInline'; - -export const Loading: React.FunctionComponent = ({ className, isInline }) => ( -
- -
-); - -Loading.displayName = 'Loading'; - -type LoadingProps = { - className?: string; - isInline?: boolean; -}; export type PodTrafficProp = { podName: string; diff --git a/src/gitops/utils/components/LoadingSpinner/Loading.tsx b/src/gitops/utils/components/LoadingSpinner/Loading.tsx new file mode 100644 index 000000000..cf7d540a2 --- /dev/null +++ b/src/gitops/utils/components/LoadingSpinner/Loading.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; +import classNames from 'classnames'; + +import { Spinner } from '@patternfly/react-core'; + +export const Loading: React.FunctionComponent = ({ className, isInline }) => ( +
+ +
+); + +export const LoadingInline: React.FunctionComponent = () => ; +LoadingInline.displayName = 'LoadingInline'; + +Loading.displayName = 'Loading'; + +type LoadingProps = { + className?: string; + isInline?: boolean; +};