@@ -133,6 +133,10 @@ const ApplicationSetList: React.FC<ApplicationSetProps> = ({
133133
134134 const [ searchParams , setSearchParams ] = useSearchParams ( ) ;
135135 const { sortBy, direction, onSort } = useDataViewSort ( { searchParams, setSearchParams } ) ;
136+
137+ // Get search query from URL parameters
138+ const searchQuery = searchParams . get ( 'q' ) || '' ;
139+
136140 const getSortParams = ( columnId : string , columnIndex : number ) => ( {
137141 sortBy : {
138142 index : columnIndex ,
@@ -149,7 +153,22 @@ const ApplicationSetList: React.FC<ApplicationSetProps> = ({
149153 const sortedApplicationSets = React . useMemo ( ( ) => {
150154 return sortData ( applicationSets as ApplicationSetKind [ ] , sortBy , direction , applications , appsLoaded ) ;
151155 } , [ applicationSets , sortBy , direction , applications , appsLoaded ] ) ;
152- const [ data , filteredData , onFilterChange ] = useListPageFilter ( sortedApplicationSets , filters ) ;
156+
157+ // Filter by search query if present
158+ const filteredBySearch = React . useMemo ( ( ) => {
159+ if ( ! searchQuery ) return sortedApplicationSets ;
160+
161+ return sortedApplicationSets . filter ( ( appSet ) => {
162+ const labels = appSet . metadata ?. labels || { } ;
163+ // Check if any label matches the search query
164+ return Object . entries ( labels ) . some ( ( [ key , value ] ) => {
165+ const labelSelector = `${ key } =${ value } ` ;
166+ return labelSelector . includes ( searchQuery ) || key . includes ( searchQuery ) ;
167+ } ) ;
168+ } ) ;
169+ } , [ sortedApplicationSets , searchQuery ] ) ;
170+
171+ const [ data , filteredData , onFilterChange ] = useListPageFilter ( filteredBySearch , filters ) ;
153172 const rows = useApplicationSetRowsDV ( filteredData , namespace , applications , appsLoaded ) ;
154173
155174 const empty = (
@@ -262,24 +281,32 @@ const useApplicationSetRowsDV = (applicationSetsList, namespace, applications, a
262281 : [ ] ) ,
263282 {
264283 id : getAppSetStatus ( appSet ) ,
284+ cell : < ApplicationSetStatusFragment status = { getAppSetStatus ( appSet ) } /> ,
285+ } ,
286+ {
287+ id : 'generated-apps-' + index ,
265288 cell : (
266289 < div >
267- < ApplicationSetStatusFragment status = { getAppSetStatus ( appSet ) } />
290+ { getGeneratedAppsCount ( appSet , applications , appsLoaded ) . toString ( ) }
268291 </ div >
269292 ) ,
270293 } ,
271294 {
272- id : 'generated-apps-' + index ,
273- cell : getGeneratedAppsCount ( appSet , applications , appsLoaded ) . toString ( ) ,
295+ id : 'generators-' + index ,
296+ cell : (
297+ < div >
298+ { getAppSetGeneratorCount ( appSet ) . toString ( ) }
299+ </ div >
300+ ) ,
274301 } ,
275302 {
276- id : 'generators-' + index ,
277- cell : getAppSetGeneratorCount ( appSet ) . toString ( ) ,
303+ id : 'created-at-' + index ,
304+ cell : (
305+ < div >
306+ { formatCreationTimestamp ( appSet . metadata . creationTimestamp ) }
307+ </ div >
308+ ) ,
278309 } ,
279- {
280- id : 'created-at-' + index ,
281- cell : formatCreationTimestamp ( appSet . metadata . creationTimestamp ) ,
282- } ,
283310 {
284311 id : 'actions-' + index ,
285312 cell : < ApplicationSetActionsCell appSet = { appSet } /> ,
@@ -312,7 +339,7 @@ const useColumnsDV = (namespace, getSortParams) => {
312339 props : {
313340 key : 'namespace' ,
314341 'aria-label' : 'namespace' ,
315- className : 'pf-m-width-12 ' ,
342+ className : 'pf-m-width-15 ' ,
316343 sort : getSortParams ( 'namespace' , 1 ) ,
317344 } ,
318345 } ,
@@ -324,7 +351,7 @@ const useColumnsDV = (namespace, getSortParams) => {
324351 props : {
325352 key : 'status' ,
326353 'aria-label' : 'health status' ,
327- className : 'pf-m-width-12 ' ,
354+ className : 'pf-m-width-15 ' ,
328355 sort : getSortParams ( 'status' , 1 + i ) ,
329356 } ,
330357 } ,
@@ -334,7 +361,7 @@ const useColumnsDV = (namespace, getSortParams) => {
334361 props : {
335362 key : 'generated-apps' ,
336363 'aria-label' : 'generated apps' ,
337- className : 'pf-m-width-12 ' ,
364+ className : 'pf-m-width-15 ' ,
338365 sort : getSortParams ( 'generated-apps' , 2 + i ) ,
339366 } ,
340367 } ,
@@ -344,7 +371,7 @@ const useColumnsDV = (namespace, getSortParams) => {
344371 props : {
345372 key : 'generators' ,
346373 'aria-label' : 'generators' ,
347- className : 'pf-m-width-12 ' ,
374+ className : 'pf-m-width-15 ' ,
348375 sort : getSortParams ( 'generators' , 3 + i ) ,
349376 } ,
350377 } ,
0 commit comments