@@ -2,6 +2,7 @@ import * as React from 'react';
22import { useTranslation } from 'react-i18next' ;
33import { useLocation } from 'react-router-dom-v5-compat' ;
44import TechPreviewBadge from 'src/plugin/import/badges/TechPreviewBadge' ;
5+ import * as YamlFormatter from 'yaml' ;
56
67import ActionsDropdown from '@gitops/utils/components/ActionDropDown/ActionDropDown' ;
78import { modelToGroupVersionKind } from '@gitops/utils/utils' ;
@@ -34,6 +35,7 @@ import {
3435 useShowOperandsInAllNamespaces ,
3536} from '../shared/AllNamespaces' ;
3637import { GitOpsDataViewTable , useGitOpsDataViewSort } from '../shared/DataView' ;
38+ import MetadataLabels from '../shared/MetadataLabels' ;
3739
3840import { useImageUpdaterActionsProvider } from './hooks/useImageUpdaterActionsProvider' ;
3941
@@ -71,6 +73,7 @@ const ImageUpdaterList: React.FC<ImageUpdaterListTabProps> = ({
7173 'images' ,
7274 'last-checked' ,
7375 'ready' ,
76+ 'labels' ,
7477 'actions' ,
7578 ] . map ( ( key ) => ( { key } ) ) ;
7679 } , [ showNamespaceColumn ] ) ;
@@ -251,6 +254,10 @@ export const sortData = (
251254 aValue = a . status ?. conditions ?. find ( ( c ) => c . type === 'Ready' ) ?. status || '' ;
252255 bValue = b . status ?. conditions ?. find ( ( c ) => c . type === 'Ready' ) ?. status || '' ;
253256 break ;
257+ case 'labels' :
258+ aValue = YamlFormatter . stringify ( a . metadata ?. labels || { } ) ;
259+ bValue = YamlFormatter . stringify ( b . metadata ?. labels || { } ) ;
260+ break ;
254261 default :
255262 return 0 ;
256263 }
@@ -277,7 +284,7 @@ export const useColumnsDV = (
277284 cell : t ( 'Name' ) ,
278285 props : {
279286 'aria-label' : 'name' ,
280- className : 'pf-m-width-20 ' ,
287+ className : 'pf-m-width-30 ' ,
281288 sort : getSortParams ( 0 ) ,
282289 style : { minWidth : '200px' } ,
283290 } ,
@@ -299,23 +306,23 @@ export const useColumnsDV = (
299306 cell : t ( 'Apps' ) ,
300307 props : {
301308 'aria-label' : 'apps' ,
302- className : 'pf-m-width-10 ' ,
309+ className : 'pf-m-width-20 ' ,
303310 sort : getSortParams ( 1 + i ) ,
304311 } ,
305312 } ,
306313 {
307314 cell : t ( 'Images' ) ,
308315 props : {
309316 'aria-label' : 'images' ,
310- className : 'pf-m-width-10 ' ,
317+ className : 'pf-m-width-20 ' ,
311318 sort : getSortParams ( 2 + i ) ,
312319 } ,
313320 } ,
314321 {
315322 cell : t ( 'Last Checked' ) ,
316323 props : {
317324 'aria-label' : 'last checked' ,
318- className : 'pf-m-width-15 ' ,
325+ className : 'pf-m-width-20 ' ,
319326 sort : getSortParams ( 3 + i ) ,
320327 } ,
321328 } ,
@@ -327,6 +334,14 @@ export const useColumnsDV = (
327334 sort : getSortParams ( 4 + i ) ,
328335 } ,
329336 } ,
337+ {
338+ cell : t ( 'Labels' ) ,
339+ props : {
340+ 'aria-label' : 'labels' ,
341+ className : 'pf-m-width-10' ,
342+ sort : getSortParams ( 5 + i ) ,
343+ } ,
344+ } ,
330345 {
331346 cell : '' ,
332347 props : { 'aria-label' : 'actions' } ,
@@ -400,6 +415,25 @@ export const useImageUpdaterRowsDV = (
400415 cell : readyCondition ? String ( isReady ) : '-' ,
401416 dataLabel : 'Ready' ,
402417 } ,
418+ {
419+ id : 'labels' ,
420+ dataLabel : 'Labels' ,
421+ cell : (
422+ < div >
423+ < MetadataLabels
424+ kind = {
425+ ImageUpdaterModel . apiGroup +
426+ '~' +
427+ ImageUpdaterModel . apiVersion +
428+ '~' +
429+ ImageUpdaterModel . kind
430+ }
431+ labels = { obj ?. metadata ?. labels }
432+ numLabels = { 3 }
433+ />
434+ </ div >
435+ ) ,
436+ } ,
403437 {
404438 id : 'actions-' + index ,
405439 cell : < ImageUpdaterActionsCell imageUpdater = { obj } index = { index } /> ,
0 commit comments