From 41f9f480fbc7dc525aed80c53ef3bff794b1acb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Pailharey?= <rpailharey@grandlyon.com>
Date: Tue, 10 May 2022 14:19:05 +0200
Subject: [PATCH] feat(admin): display updated_at field

---
 src/app/admin/admin-pannel.scss               |  8 ++++++++
 .../admin-structures-list.component.html      | 20 +++++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/app/admin/admin-pannel.scss b/src/app/admin/admin-pannel.scss
index ff8626de1..5ced4166a 100644
--- a/src/app/admin/admin-pannel.scss
+++ b/src/app/admin/admin-pannel.scss
@@ -18,3 +18,11 @@
 .incomplete {
   color: $red;
 }
+
+.isOutdated {
+  color: $red;
+}
+
+.structure-updated-at {
+  text-align: right;
+}
diff --git a/src/app/admin/components/structures-list/admin-structures-list.component.html b/src/app/admin/components/structures-list/admin-structures-list.component.html
index aef303893..e483cbb35 100644
--- a/src/app/admin/components/structures-list/admin-structures-list.component.html
+++ b/src/app/admin/components/structures-list/admin-structures-list.component.html
@@ -4,7 +4,7 @@
 <div *ngIf="!isLoading" fxLayout="column" fxLayoutAlign="center center">
   <table aria-describedby="demands attachment results" class="results-tab results-column">
     <thead>
-      <th scope="col">
+      <th colspan="2" scope="colgroup">
         Structures avec des données manquantes ({{ structuresIncomplete ? structuresIncomplete.length : 0 }})
       </th>
     </thead>
@@ -15,6 +15,9 @@
             {{ structure.structureName }}</a
           >
         </td>
+        <td class="structure-updated-at">
+          <span [ngClass]="{ isOutdated: structure.isOutdated }">{{ structure.updatedAt | date: 'mediumDate' }}</span>
+        </td>
       </tr>
       <tr *ngIf="!structuresIncomplete?.length">
         <td colspan="3">Aucune structure</td>
@@ -23,13 +26,16 @@
   </table>
   <table aria-describedby="demands attachment results" class="results-tab results-column">
     <thead>
-      <th scope="col">Structures en cours de revendication ({{ structuresInClaim.length }})</th>
+      <th colspan="2" scope="colgroup">Structures en cours de revendication ({{ structuresInClaim.length }})</th>
     </thead>
     <tbody>
       <tr *ngFor="let structure of structuresInClaim">
         <td>
           <a href="/acteurs?id={{ structure.structureId }}" target="_blank"> {{ structure.structureName }}</a>
         </td>
+        <td class="structure-updated-at">
+          <span [ngClass]="{ isOutdated: structure.isOutdated }">{{ structure.updatedAt | date: 'mediumDate' }}</span>
+        </td>
       </tr>
       <tr *ngIf="!structuresInClaim?.length">
         <td colspan="3">Aucune structure</td>
@@ -38,13 +44,16 @@
   </table>
   <table aria-describedby="demands attachment results" class="results-tab results-column">
     <thead>
-      <th scope="col">Structures à revendiquer ({{ structuresToClaim.length }})</th>
+      <th colspan="2" scope="colgroup">Structures à revendiquer ({{ structuresToClaim.length }})</th>
     </thead>
     <tbody>
       <tr *ngFor="let structure of structuresToClaim">
         <td>
           <a href="/acteurs?id={{ structure.structureId }}" target="_blank"> {{ structure.structureName }}</a>
         </td>
+        <td class="structure-updated-at">
+          <span [ngClass]="{ isOutdated: structure.isOutdated }">{{ structure.updatedAt | date: 'mediumDate' }}</span>
+        </td>
       </tr>
       <tr *ngIf="!structuresToClaim?.length">
         <td colspan="3">Aucune structure</td>
@@ -53,13 +62,16 @@
   </table>
   <table aria-describedby="demands attachment results" class="results-tab results-column">
     <thead>
-      <th scope="col">Structures revendiquées ({{ structuresClaimed.length }})</th>
+      <th colspan="2" scope="colgroup">Structures revendiquées ({{ structuresClaimed.length }})</th>
     </thead>
     <tbody>
       <tr *ngFor="let structure of structuresClaimed">
         <td>
           <a href="/acteurs?id={{ structure.structureId }}" target="_blank"> {{ structure.structureName }}</a>
         </td>
+        <td class="structure-updated-at">
+          <span [ngClass]="{ isOutdated: structure.isOutdated }">{{ structure.updatedAt | date: 'mediumDate' }}</span>
+        </td>
       </tr>
       <tr *ngIf="!structuresClaimed?.length">
         <td colspan="3">Aucune structure</td>
-- 
GitLab