diff --git a/.manus/db/db-query-1765832673712.json b/.manus/db/db-query-1765832673712.json new file mode 100644 index 0000000..24902d0 --- /dev/null +++ b/.manus/db/db-query-1765832673712.json @@ -0,0 +1,13 @@ +{ + "query": "SHOW TABLES LIKE 'logsNotifications';", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SHOW TABLES LIKE 'logsNotifications';", + "rows": [ + { + "Tables_in_7PAT67UmWoxv8vwp8Bbcv6 (logsNotifications)": "logsNotifications" + } + ], + "messages": [], + "stdout": "Tables_in_7PAT67UmWoxv8vwp8Bbcv6 (logsNotifications)\nlogsNotifications\n", + "stderr": "", + "execution_time_ms": 76 +} \ No newline at end of file diff --git a/.manus/db/db-query-1765832676914.json b/.manus/db/db-query-1765832676914.json new file mode 100644 index 0000000..36611d9 --- /dev/null +++ b/.manus/db/db-query-1765832676914.json @@ -0,0 +1,106 @@ +{ + "query": "DESCRIBE logsNotifications;", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute DESCRIBE logsNotifications;", + "rows": [ + { + "Field": "id", + "Type": "int(11)", + "Null": "NO", + "Key": "PRI", + "Default": "NULL", + "Extra": "auto_increment" + }, + { + "Field": "type", + "Type": "enum('remerciement','notification_formateur_inscription','notification_formateur_annulation','alerte_capacite','notification_liste_attente')", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "sequenceId", + "Type": "int(11)", + "Null": "YES", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "apprenantId", + "Type": "int(11)", + "Null": "YES", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "formateurId", + "Type": "int(11)", + "Null": "YES", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "emailDestinataire", + "Type": "varchar(320)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "sujet", + "Type": "varchar(500)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "dateEnvoi", + "Type": "timestamp", + "Null": "NO", + "Key": "", + "Default": "CURRENT_TIMESTAMP", + "Extra": "" + }, + { + "Field": "statut", + "Type": "enum('success','failed')", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "messageErreur", + "Type": "text", + "Null": "YES", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "metadata", + "Type": "text", + "Null": "YES", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "createdAt", + "Type": "timestamp", + "Null": "NO", + "Key": "", + "Default": "CURRENT_TIMESTAMP", + "Extra": "" + } + ], + "messages": [], + "stdout": "Field\tType\tNull\tKey\tDefault\tExtra\nid\tint(11)\tNO\tPRI\tNULL\tauto_increment\ntype\tenum('remerciement','notification_formateur_inscription','notification_formateur_annulation','alerte_capacite','notification_liste_attente')\tNO\t\tNULL\t\nsequenceId\tint(11)\tYES\t\tNULL\t\napprenantId\tint(11)\tYES\t\tNULL\t\nformateurId\tint(11)\tYES\t\tNULL\t\nemailDestinataire\tvarchar(320)\tNO\t\tNULL\t\nsujet\tvarchar(500)\tNO\t\tNULL\t\ndateEnvoi\ttimestamp\tNO\t\tCURRENT_TIMESTAMP\t\nstatut\tenum('success','failed')\tNO\t\tNULL\t\nmessageErreur\ttext\tYES\t\tNULL\t\nmetadata\ttext\tYES\t\tNULL\t\ncreatedAt\ttimestamp\tNO\t\tCURRENT_TIMESTAMP\t\n", + "stderr": "", + "execution_time_ms": 51 +} \ No newline at end of file diff --git a/client/src/pages/admin/AdminNotifications.tsx b/client/src/pages/admin/AdminNotifications.tsx index a1cb45d..79d82d1 100644 --- a/client/src/pages/admin/AdminNotifications.tsx +++ b/client/src/pages/admin/AdminNotifications.tsx @@ -63,7 +63,7 @@ export default function AdminNotifications() { const [page, setPage] = useState(0); const limit = 20; - const { data: historiqueData, isLoading: isLoadingHistorique, refetch } = trpc.notifications.historique.useQuery({ + const { data: historiqueData, isLoading: isLoadingHistorique, refetch, error: historiqueError } = trpc.notifications.historique.useQuery({ type: filters.type as any || undefined, statut: filters.statut as any || undefined, email: filters.email || undefined, @@ -73,7 +73,7 @@ export default function AdminNotifications() { offset: page * limit, }); - const { data: statsData, isLoading: isLoadingStats } = trpc.notifications.statistiques.useQuery({ + const { data: statsData, isLoading: isLoadingStats, error: statsError } = trpc.notifications.statistiques.useQuery({ dateDebut: filters.dateDebut || undefined, dateFin: filters.dateFin || undefined, }); @@ -129,6 +129,12 @@ export default function AdminNotifications() { {isLoadingStats ? (
Chargement...
+ ) : statsError ? ( +
+ +

Erreur lors du chargement des statistiques

+

{statsError.message}

+
) : statsData ? ( <> {/* Cartes de statistiques globales */} @@ -378,6 +384,12 @@ export default function AdminNotifications() { {isLoadingHistorique ? (
Chargement...
+ ) : historiqueError ? ( +
+ +

Erreur lors du chargement de l'historique

+

{historiqueError.message}

+
) : historiqueData?.logs.length === 0 ? (
Aucune notification trouvée