@@ -95,7 +95,7 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
9595 this . pageSize ,
9696 this . currentPage - 1
9797 ) ;
98- this . objects = result . objects ;
98+ this . objects = this . sortObjectsByLastUpdated ( result . objects ) ;
9999
100100 // Update total objects and pages from API response
101101 if ( result . pagination ?. total !== undefined ) {
@@ -166,6 +166,17 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
166166 this . loadData ( ) ;
167167 }
168168
169+ private sortObjectsByLastUpdated ( objects : DrsObject [ ] ) : DrsObject [ ] {
170+ return [ ...objects ] . sort ( ( a , b ) => {
171+ // Use updated_time if available, otherwise fall back to created_time
172+ const aTime = a . updated_time || a . created_time ;
173+ const bTime = b . updated_time || b . created_time ;
174+
175+ // Sort in reverse chronological order (most recent first)
176+ return new Date ( bTime ) . getTime ( ) - new Date ( aTime ) . getTime ( ) ;
177+ } ) ;
178+ }
179+
169180 private renderPagination ( ) {
170181 return html `
171182 < ecc-utils-design-pagination >
@@ -299,7 +310,7 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
299310 . map (
300311 ( ) => html `
301312 < ecc-utils-design-table-row >
302- < ecc-utils-design-table-cell class ="w-6 /12 ">
313+ < ecc-utils-design-table-cell class ="w-5 /12 ">
303314 < div class ="flex flex-col w-full gap-2 ">
304315 < ecc-utils-design-skeleton
305316 class ="part:h-5 part:w-40 "
@@ -317,14 +328,14 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
317328 class ="part:h-4 part:w-20 "
318329 > </ ecc-utils-design-skeleton >
319330 </ ecc-utils-design-table-cell >
320- < ecc-utils-design-table-cell class ="w-2/12 ">
331+ < ecc-utils-design-table-cell class ="w-2.5 /12 ">
321332 < ecc-utils-design-skeleton
322333 class ="part:h-4 part:w-24 "
323334 > </ ecc-utils-design-skeleton >
324335 </ ecc-utils-design-table-cell >
325- < ecc-utils-design-table-cell class ="w-2/12 ">
336+ < ecc-utils-design-table-cell class ="w-2.5 /12 ">
326337 < ecc-utils-design-skeleton
327- class ="part:h-8 part:w-8 part:rounded "
338+ class ="part:h-4 part:w-24 "
328339 > </ ecc-utils-design-skeleton >
329340 </ ecc-utils-design-table-cell >
330341 </ ecc-utils-design-table-row >
@@ -341,9 +352,17 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
341352 return `${ parseFloat ( ( bytes / k ** i ) . toFixed ( 2 ) ) } ${ sizes [ i ] } ` ;
342353 }
343354
344- private static formatDate ( dateString : string ) : string {
355+ private static formatDateTime ( dateString : string ) : string {
345356 try {
346- return new Date ( dateString ) . toLocaleDateString ( ) ;
357+ return new Date ( dateString ) . toLocaleString ( 'en-US' , {
358+ year : 'numeric' ,
359+ month : '2-digit' ,
360+ day : '2-digit' ,
361+ hour : '2-digit' ,
362+ minute : '2-digit' ,
363+ second : '2-digit' ,
364+ hour12 : false
365+ } ) ;
347366 } catch {
348367 return dateString ;
349368 }
@@ -403,18 +422,18 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
403422 < ecc-utils-design-table >
404423 < ecc-utils-design-table-header >
405424 < ecc-utils-design-table-row >
406- < ecc-utils-design-table-head class ="w-6 /12 "
425+ < ecc-utils-design-table-head class ="w-5 /12 "
407426 > Object Info</ ecc-utils-design-table-head
408427 >
409428 < ecc-utils-design-table-head class ="w-2/12 "
410429 > Size</ ecc-utils-design-table-head
411430 >
412- < ecc-utils-design-table-head class ="w-2/12 "
431+ < ecc-utils-design-table-head class ="w-2.5 /12 "
413432 > Created</ ecc-utils-design-table-head
414433 >
415- < ecc-utils-design-table-head
416- class =" w-2/12 "
417- > </ ecc-utils-design-table-head >
434+ < ecc-utils-design-table-head class =" w-2.5/12 "
435+ > Last Updated </ ecc-utils-design-table-head
436+ >
418437 </ ecc-utils-design-table-row >
419438 </ ecc-utils-design-table-header >
420439 < ecc-utils-design-table-body >
@@ -426,7 +445,7 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
426445 return html `
427446 < ecc-utils-design-table-row >
428447 < ecc-utils-design-table-cell
429- colspan ="5 "
448+ colspan ="4 "
430449 class ="part:text-center part:py-8 part:text-muted-foreground "
431450 >
432451 No objects found
@@ -437,7 +456,7 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
437456 return this . objects . map (
438457 ( object ) => html `
439458 < ecc-utils-design-table-row >
440- < ecc-utils-design-table-cell class ="w-6 /12 ">
459+ < ecc-utils-design-table-cell class ="w-5 /12 ">
441460 < div class ="flex flex-col w-full ">
442461 < ecc-utils-design-button
443462 class ="part:font-medium part:text-primary part:w-fit part:cursor-pointer part:p-0 "
@@ -467,22 +486,19 @@ export class ECCClientGa4ghDrsObjects extends LitElement {
467486 ) } </ span
468487 >
469488 </ ecc-utils-design-table-cell >
470- < ecc-utils-design-table-cell class ="w-2/12 ">
489+ < ecc-utils-design-table-cell class ="w-2.5 /12 ">
471490 < span class ="text-sm "
472- > ${ ECCClientGa4ghDrsObjects . formatDate (
491+ > ${ ECCClientGa4ghDrsObjects . formatDateTime (
473492 object . created_time
474493 ) } </ span
475494 >
476495 </ ecc-utils-design-table-cell >
477- < ecc-utils-design-table-cell class ="w-2/12 ">
478- < slot name =${ `actions-${ object . id } ` } >
479- < ecc-utils-design-button
480- size ="sm "
481- @click =${ ( ) => this . handleObjectSelect ( object . id ) }
482- >
483- View Details
484- </ ecc-utils-design-button >
485- </ slot >
496+ < ecc-utils-design-table-cell class ="w-2.5/12 ">
497+ < span class ="text-sm "
498+ > ${ ECCClientGa4ghDrsObjects . formatDateTime (
499+ object . updated_time || object . created_time
500+ ) } </ span
501+ >
486502 </ ecc-utils-design-table-cell >
487503 </ ecc-utils-design-table-row >
488504 `
0 commit comments