From 2b319002551ef4cccd53c8a1a8ae532e80dcc8eb Mon Sep 17 00:00:00 2001 From: Manus Date: Thu, 8 Jan 2026 09:08:27 -0500 Subject: [PATCH] =?UTF-8?q?Checkpoint:=20Am=C3=A9liorations=20du=20tableau?= =?UTF-8?q?=20des=20rappels=20:=20renommage=20de=20la=20colonne=20"Templat?= =?UTF-8?q?e"=20en=20"Template=20d'email"=20et=20ajout=20d'une=20colonne?= =?UTF-8?q?=20"Dates=20concern=C3=A9es"=20affichant=20les=20formations,=20?= =?UTF-8?q?s=C3=A9quences=20et=20dates=20sp=C3=A9cifiques=20associ=C3=A9es?= =?UTF-8?q?=20=C3=A0=20chaque=20rappel.=20La=20fonction=20getRappels=20a?= =?UTF-8?q?=20=C3=A9t=C3=A9=20enrichie=20pour=20r=C3=A9cup=C3=A9rer=20auto?= =?UTF-8?q?matiquement=20les=20d=C3=A9tails=20des=20dates=20de=20formation?= =?UTF-8?q?=20(formation,=20s=C3=A9quence,=20ordre).=20L'affichage=20group?= =?UTF-8?q?=C3=A9=20permet=20de=20voir=20en=20un=20coup=20d'=C5=93il=20si?= =?UTF-8?q?=20un=20rappel=20s'applique=20=C3=A0=20toutes=20les=20dates=20o?= =?UTF-8?q?u=20seulement=20=C3=A0=20des=20dates=20sp=C3=A9cifiques.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/pages/AdminRappels.tsx | 42 +++++++++++++++++++++++++++++-- server/db.ts | 33 +++++++++++++++++++++++- todo.md | 6 +++++ 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/client/src/pages/AdminRappels.tsx b/client/src/pages/AdminRappels.tsx index 8d4baea..1398e72 100644 --- a/client/src/pages/AdminRappels.tsx +++ b/client/src/pages/AdminRappels.tsx @@ -183,6 +183,40 @@ export default function AdminRappels() { return TEMPLATE_TYPES.find(t => t.value === type)?.label || type; }; + const formatDatesInfo = (rappel: any) => { + if (!rappel.datesDetails || rappel.datesDetails.length === 0) { + return Toutes les dates; + } + + // Grouper par formation et séquence + const grouped = rappel.datesDetails.reduce((acc: any, date: any) => { + const key = `${date.formationNom} - ${date.sequenceNom}`; + if (!acc[key]) { + acc[key] = []; + } + acc[key].push(date); + return acc; + }, {}); + + return ( +
+ {Object.entries(grouped).map(([key, dates]: [string, any]) => ( +
+
{key}
+
+ {dates.map((d: any, idx: number) => ( + + Date {d.ordre} + {idx < dates.length - 1 && ", "} + + ))} +
+
+ ))} +
+ ); + }; + return (
@@ -214,9 +248,10 @@ export default function AdminRappels() { Nom - Template + Template d'email Délai Heure + Dates concernées Statut Actions @@ -231,6 +266,9 @@ export default function AdminRappels() { {rappel.timing === "post_formation" ? `J+${rappel.joursAvant}` : `J-${rappel.joursAvant}`} {rappel.heureEnvoi} + + {formatDatesInfo(rappel)} +