Checkpoint: Correction de l'affichage des labels des pièces jointes qui apparaissaient en double. Ajout d'un prop label au composant FileUpload pour personnaliser le texte. Déployé sur le VPS.
This commit is contained in:
@@ -21,9 +21,10 @@ interface FileUploadProps {
|
||||
} | null) => void;
|
||||
accept?: string;
|
||||
maxSize?: number; // en Mo
|
||||
label?: string; // Label personnalisé
|
||||
}
|
||||
|
||||
export function FileUpload({ value, onChange, accept, maxSize = 10 }: FileUploadProps) {
|
||||
export function FileUpload({ value, onChange, accept, maxSize = 10, label = "Pièce jointe (optionnel)" }: FileUploadProps) {
|
||||
const [uploading, setUploading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
@@ -84,7 +85,7 @@ export function FileUpload({ value, onChange, accept, maxSize = 10 }: FileUpload
|
||||
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe (optionnel)</Label>
|
||||
<Label>{label}</Label>
|
||||
|
||||
{!value ? (
|
||||
<div className="space-y-2">
|
||||
|
||||
@@ -709,25 +709,21 @@ export default function AdminRappels() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe 1 (optionnel)</Label>
|
||||
<FileUpload
|
||||
value={formData.fichier}
|
||||
onChange={(fichier) => setFormData({ ...formData, fichier })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
</div>
|
||||
<FileUpload
|
||||
label="Pièce jointe 1 (optionnel)"
|
||||
value={formData.fichier}
|
||||
onChange={(fichier) => setFormData({ ...formData, fichier })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe 2 (optionnel)</Label>
|
||||
<FileUpload
|
||||
value={formData.fichier2}
|
||||
onChange={(fichier2) => setFormData({ ...formData, fichier2 })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
</div>
|
||||
<FileUpload
|
||||
label="Pièce jointe 2 (optionnel)"
|
||||
value={formData.fichier2}
|
||||
onChange={(fichier2) => setFormData({ ...formData, fichier2 })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch
|
||||
@@ -868,25 +864,21 @@ export default function AdminRappels() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe 1 (optionnel)</Label>
|
||||
<FileUpload
|
||||
value={formData.fichier}
|
||||
onChange={(fichier) => setFormData({ ...formData, fichier })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
</div>
|
||||
<FileUpload
|
||||
label="Pièce jointe 1 (optionnel)"
|
||||
value={formData.fichier}
|
||||
onChange={(fichier) => setFormData({ ...formData, fichier })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe 2 (optionnel)</Label>
|
||||
<FileUpload
|
||||
value={formData.fichier2}
|
||||
onChange={(fichier2) => setFormData({ ...formData, fichier2 })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
</div>
|
||||
<FileUpload
|
||||
label="Pièce jointe 2 (optionnel)"
|
||||
value={formData.fichier2}
|
||||
onChange={(fichier2) => setFormData({ ...formData, fichier2 })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch
|
||||
|
||||
8
todo.md
8
todo.md
@@ -1407,3 +1407,11 @@
|
||||
- [x] Déployer sur VPS avec migration
|
||||
- [x] Vérifier que les rappels existants sont préservés (migration additive)
|
||||
- [x] Créer un checkpoint
|
||||
|
||||
## Bug - Labels pièces jointes dupliqués
|
||||
|
||||
- [x] Identifier pourquoi les labels apparaissent en double (FileUpload affiche déjà un label)
|
||||
- [x] Ajouter un prop label au composant FileUpload
|
||||
- [x] Corriger l'affichage dans AdminRappels.tsx
|
||||
- [x] Déployer sur VPS
|
||||
- [x] Créer un checkpoint
|
||||
|
||||
Reference in New Issue
Block a user