Checkpoint: Ajout de la fonctionnalité "Détail par apprenant"
✅ Nouvelle procédure tRPC `apprenants.getInscriptions` pour récupérer toutes les inscriptions d'un apprenant avec les détails de formation et séquence ✅ Nouvelle page AdminApprenantDetail (/admin/apprenants/:id) affichant : - Informations personnelles de l'apprenant (nom, prénom, email, code établissement, fonction) - Tableau complet de toutes ses inscriptions avec : * Nom de la formation * Nom de la séquence * Toutes les dates de la séquence * Lieu * Public cible * Date d'inscription * Statut (avec badge coloré : vert pour confirmée, gris pour en attente, rouge pour annulée) ✅ Bouton "Détail" (icône œil) ajouté dans la colonne Actions de la page AdminApprenants ✅ Route /admin/apprenants/:id configurée dans App.tsx ✅ Bouton "Retour aux apprenants" pour navigation facile Correction appliquée : La procédure getInscriptions extrait maintenant correctement l'objet inscription du résultat retourné par getInscriptionsByApprenant. Tests réussis : Affichage correct des inscriptions pour l'apprenant "Nouveau Apprenant" (1 inscription à la séquence "Groupe A" avec statut confirmée).
This commit is contained in:
@@ -7,12 +7,14 @@ import { Label } from "@/components/ui/label";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { trpc } from "@/lib/trpc";
|
||||
import { Plus, Pencil, Trash2, Search, SlidersHorizontal } from "lucide-react";
|
||||
import { Plus, Pencil, Trash2, Search, SlidersHorizontal, Eye } from "lucide-react";
|
||||
import { useState, useMemo } from "react";
|
||||
import { useLocation } from "wouter";
|
||||
import { toast } from "sonner";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
export default function AdminApprenants() {
|
||||
const [, setLocation] = useLocation();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [editingId, setEditingId] = useState<number | null>(null);
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
@@ -298,6 +300,14 @@ export default function AdminApprenants() {
|
||||
</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<div className="flex justify-end gap-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => setLocation(`/admin/apprenants/${apprenant.id}`)}
|
||||
title="Voir les détails et inscriptions"
|
||||
>
|
||||
<Eye className="w-4 h-4" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
|
||||
Reference in New Issue
Block a user