File tree Expand file tree Collapse file tree
utils/components/LoadingSpinner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as React from 'react';
22import classNames from 'classnames' ;
33
44import { PodKind } from '@gitops/topology/console/types' ;
5+ import { Loading } from '@gitops/utils/components/LoadingSpinner/Loading' ;
56import { useGitOpsTranslation } from '@gitops/utils/hooks/useGitOpsTranslation' ;
67import { resourceAsArray } from '@gitops/utils/utils' ;
78import { K8sResourceCommon , useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk' ;
@@ -54,7 +55,8 @@ const RolloutRevisionsTab: React.FC<RolloutRevisionsTabProps> = ({ obj: rollout
5455 { t ( 'Rollout Revisions' ) }
5556 </ Title >
5657
57- { loadError || ! loaded || ! podsloaded || podsloadError ? (
58+ { /* eslint-disable-next-line no-nested-ternary */ }
59+ { loadError || podsloadError ? (
5860 < div >
5961 < Flex
6062 justifyContent = { { default : 'justifyContentSpaceEvenly' } }
@@ -63,6 +65,8 @@ const RolloutRevisionsTab: React.FC<RolloutRevisionsTabProps> = ({ obj: rollout
6365 < FlexItem fullWidth = { { default : 'fullWidth' } } > { error } </ FlexItem >
6466 </ Flex >
6567 </ div >
68+ ) : ! loaded || ! podsloaded ? (
69+ < Loading />
6670 ) : (
6771 < Revisions
6872 rollout = { rollout }
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import { useTranslation } from 'react-i18next' ;
3- import classNames from 'classnames' ;
43
4+ import { LoadingInline } from '@gitops/utils/components/LoadingSpinner/Loading' ;
55import {
66 K8sKind ,
77 StatusComponent ,
88 useK8sWatchResource ,
99} from '@openshift-console/dynamic-plugin-sdk' ;
1010import { Tooltip } from '@patternfly/react-core' ;
11- import { Spinner } from '@patternfly/react-core' ;
1211import { ConnectedIcon , DisconnectedIcon } from '@patternfly/react-icons' ;
1312
1413import { EndpointSliceKind } from './types' ;
@@ -25,24 +24,6 @@ const EndPointSliceModel: K8sKind = {
2524 namespaced : true ,
2625 plural : 'endpointslices' ,
2726} ;
28- export const LoadingInline : React . FunctionComponent = ( ) => < Loading isInline /> ;
29- LoadingInline . displayName = 'LoadingInline' ;
30-
31- export const Loading : React . FunctionComponent < LoadingProps > = ( { className, isInline } ) => (
32- < div
33- className = { classNames ( 'co-m-loader' , { 'co-m-loader--inline' : isInline } , className ) }
34- data-test = "loading-indicator"
35- >
36- < Spinner aria-live = "polite" aria-busy = "true" isInline = { isInline } size = "lg" />
37- </ div >
38- ) ;
39-
40- Loading . displayName = 'Loading' ;
41-
42- type LoadingProps = {
43- className ?: string ;
44- isInline ?: boolean ;
45- } ;
4627
4728export type PodTrafficProp = {
4829 podName : string ;
Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+ import classNames from 'classnames' ;
3+
4+ import { Spinner } from '@patternfly/react-core' ;
5+
6+ export const Loading : React . FunctionComponent < LoadingProps > = ( { className, isInline } ) => (
7+ < div
8+ className = { classNames ( 'co-m-loader' , { 'co-m-loader--inline' : isInline } , className ) }
9+ data-test = "loading-indicator"
10+ >
11+ < Spinner aria-live = "polite" aria-busy = "true" isInline = { isInline } size = "lg" />
12+ </ div >
13+ ) ;
14+
15+ export const LoadingInline : React . FunctionComponent = ( ) => < Loading isInline /> ;
16+ LoadingInline . displayName = 'LoadingInline' ;
17+
18+ Loading . displayName = 'Loading' ;
19+
20+ type LoadingProps = {
21+ className ?: string ;
22+ isInline ?: boolean ;
23+ } ;
You can’t perform that action at this time.
0 commit comments