@@ -34,6 +34,10 @@ import { DataViewTh, DataViewTr } from '@patternfly/react-data-view/dist/esm/Dat
3434import { CubesIcon , SearchIcon } from '@patternfly/react-icons' ;
3535import { Tbody , Td , ThProps , Tr } from '@patternfly/react-table' ;
3636
37+ import {
38+ ShowOperandsInAllNamespacesRadioGroup ,
39+ useShowOperandsInAllNamespaces ,
40+ } from '../shared/AllNamespaces' ;
3741import { GitOpsDataViewTable , useGitOpsDataViewSort } from '../shared/DataView' ;
3842
3943import { useRolloutActionsProvider } from './hooks/useRolloutActionsProvider' ;
@@ -73,29 +77,35 @@ const RolloutList: React.FC<RolloutListTabProps> = ({
7377 hideNameLabelFilters,
7478 showTitle,
7579} ) => {
80+ const [ showOperandsInAllNamespaces ] = useShowOperandsInAllNamespaces ( ) ;
81+ const listAllNamespaces =
82+ location . pathname ?. includes ( 'openshift-gitops-operator' ) && showOperandsInAllNamespaces ;
83+ if ( listAllNamespaces ) {
84+ namespace = null ;
85+ }
7686 const [ rollouts , loaded , loadError ] = useK8sWatchResource < K8sResourceCommon [ ] > ( {
7787 isList : true ,
7888 groupVersionKind : {
7989 group : 'argoproj.io' ,
8090 kind : 'Rollout' ,
8191 version : 'v1alpha1' ,
8292 } ,
83- namespaced : true ,
93+ namespaced : ! listAllNamespaces ,
8494 namespace,
8595 } ) ;
8696 const columnSortConfig = React . useMemo (
8797 ( ) =>
8898 [
8999 'name' ,
90- ...( ! namespace ? [ 'namespace' ] : [ ] ) ,
100+ ...( ! listAllNamespaces || ! namespace ? [ 'namespace' ] : [ ] ) ,
91101 'status' ,
92102 'pods' ,
93103 'labels' ,
94104 'selector' ,
95105 'last-updated' ,
96106 'actions' ,
97107 ] . map ( ( key ) => ( { key } ) ) ,
98- [ namespace ] ,
108+ [ listAllNamespaces , namespace ] ,
99109 ) ;
100110
101111 const { searchParams, sortBy, direction, getSortParams } =
@@ -153,7 +163,7 @@ const RolloutList: React.FC<RolloutListTabProps> = ({
153163 < ErrorState
154164 titleText = { t ( 'Unable to load data' ) }
155165 bodyText = { t (
156- 'There was an error retrieving applications . Check your connection and reload the page.' ,
166+ 'There was an error retrieving rollouts . Check your connection and reload the page.' ,
157167 ) }
158168 />
159169 </ Td >
@@ -164,6 +174,7 @@ const RolloutList: React.FC<RolloutListTabProps> = ({
164174 const topologyUrl = namespace
165175 ? '/topology/ns/' + namespace + '?view=graph'
166176 : '/topology/all-namespaces?view=graph' ;
177+
167178 return (
168179 < >
169180 { showTitle == undefined && (
@@ -172,6 +183,11 @@ const RolloutList: React.FC<RolloutListTabProps> = ({
172183 badge = {
173184 location . pathname ?. includes ( 'openshift-gitops-operator' ) ? null : < DevPreviewBadge />
174185 }
186+ helpText = {
187+ location . pathname ?. includes ( 'openshift-gitops-operator' ) ? (
188+ < ShowOperandsInAllNamespacesRadioGroup />
189+ ) : null
190+ }
175191 >
176192 < ListPageCreate groupVersionKind = { modelToRef ( RolloutModel ) } >
177193 { t ( 'Create Rollout' ) }
0 commit comments