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)} +