From 7fae87353c3d7e33c6fdb98bad848b3c4fb2d8ef Mon Sep 17 00:00:00 2001 From: odentas Date: Fri, 28 Nov 2025 11:25:28 +0100 Subject: [PATCH] refactor: Restructurer la page staff/contrats/[id] en sous-cards logiques MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Diviser la grande card 'Contrat' en 6 sous-cards organisées par importance - Card 1: États et statuts (demande, paie, DPAE, signatures) - Card 2: Informations du contrat (spectacle, analytique, dates) - Card 3: Salarié et profession (avec catégorie professionnelle) - Card 4: Rémunération (type salaire, montant, brut, panier repas) - Card 5: Temps de travail (répétitions, représentations, heures) - Card 6: Informations complémentaires (S3, notes, précisions) Modifications spécifiques: - Retirer le champ 'Référence' (non modifiable) - Déplacer 'Analytique' dans 'Informations du contrat' - Déplacer 'Catégorie professionnelle' dans 'Salarié et profession' - Supprimer les doublons de champs (signatures, début/fin/brut) - Ajouter les icônes Euro et StickyNote aux imports lucide-react --- components/staff/contracts/ContractEditor.tsx | 346 +++++++++--------- 1 file changed, 183 insertions(+), 163 deletions(-) diff --git a/components/staff/contracts/ContractEditor.tsx b/components/staff/contracts/ContractEditor.tsx index e0a2a9c..3f9aafd 100644 --- a/components/staff/contracts/ContractEditor.tsx +++ b/components/staff/contracts/ContractEditor.tsx @@ -10,7 +10,7 @@ import { Textarea } from "@/components/ui/textarea"; import { Separator } from "@/components/ui/separator"; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"; import { toast } from "sonner"; -import { CalendarRange, FilePlus2, FileText, Save, Search, FileDown, PenTool, RefreshCw, Mail, Clock, CheckCircle2, XCircle, Users, Send, Check, Upload, Ban } from "lucide-react"; +import { CalendarRange, FilePlus2, FileText, Save, Search, FileDown, PenTool, RefreshCw, Mail, Clock, CheckCircle2, XCircle, Users, Send, Check, Upload, Ban, Euro, StickyNote } from "lucide-react"; import PayslipForm from "./PayslipForm"; import { api } from "@/lib/fetcher"; import { PROFESSIONS_ARTISTE } from "@/components/constants/ProfessionsArtiste"; @@ -1911,17 +1911,16 @@ export default function ContractEditor({
- - - - Contrat - - - - {/* États du contrat en haut */} -
-
États du contrat
-
+
+ {/* Card 1: États et Statuts - Le plus important */} + + + + États et statuts + + + +
+
+ + +
+
+ + +
-
+ + - {/* Section CDDU modifiable avec recherche */} -
-
Informations CDDU
-
- - {/* Spectacle avec recherche */} + {/* Card 2: Informations principales du contrat */} + + + + Informations du contrat + + + +
+ {/* Spectacle et Référence */} +
{spectaclePick ? ( @@ -2036,16 +2065,57 @@ export default function ContractEditor({ )}
- {/* Référence */} + {/* Analytique */}
- + setReference(e.target.value)} - placeholder="Référence du contrat" + value={analytique} + onChange={(e) => setAnalytique(e.target.value)} + placeholder="Code analytique" />
+
+ {/* Période du contrat */} +
+
+ + handleContractChange("start_date", e.target.value)} + /> +
+
+ + handleContractChange("end_date", e.target.value)} + /> +
+
+ + setDateSignature(e.target.value)} + /> +
+
+
+
+
+ + {/* Card 3: Salarié et Profession */} + + + + Salarié et profession + + + +
{/* Salarié avec recherche */}
@@ -2105,26 +2175,7 @@ export default function ContractEditor({ )}
- {/* Catégorie professionnelle */} -
- - -
- - {/* Profession, Profession féminin, Analytique - 3 colonnes */} + {/* Profession, Profession féminin, Catégorie professionnelle - 3 colonnes */}
{/* Profession avec recherche conditionnelle */} @@ -2256,18 +2307,40 @@ export default function ContractEditor({ )}
- {/* Analytique */} + {/* Catégorie professionnelle */}
- - setAnalytique(e.target.value)} - placeholder="Code analytique" - /> + +
+
+ + + {/* Card 4: Rémunération */} + + + + Rémunération + + + +
+
{/* Champs CDDU modifiables */}
@@ -2360,6 +2433,13 @@ export default function ContractEditor({
)}
+
+ + handleContractChange("gross_pay", e.target.value)} + /> +
+
+
- - setDateSignature(e.target.value)} + +