Checkpoint: Évolution du système de rappels pour permettre jusqu'à 2 pièces jointes au lieu d'une seule. Migration SQL appliquée en local et sur le VPS de production. Les rappels existants sont préservés.

This commit is contained in:
Manus
2026-01-28 10:13:32 -05:00
parent 8c6dda473a
commit 86d3d437bd
10 changed files with 2445 additions and 17 deletions

View File

@@ -59,6 +59,13 @@ export default function AdminRappels() {
typeFichier: string;
tailleFichier: number;
} | null,
fichier2: null as {
nomFichier: string;
urlFichier: string;
s3Key: string;
typeFichier: string;
tailleFichier: number;
} | null,
});
const { data: rappels, refetch } = trpc.rappels.list.useQuery();
@@ -113,6 +120,7 @@ export default function AdminRappels() {
nom: "",
templateType: "",
fichier: null,
fichier2: null,
timing: "pre_formation",
joursAvant: 7,
heureEnvoi: "09:00",
@@ -146,6 +154,13 @@ export default function AdminRappels() {
typeFichier: rappel.typeFichier,
tailleFichier: rappel.tailleFichier,
} : null,
fichier2: rappel.nomFichier2 ? {
nomFichier: rappel.nomFichier2,
urlFichier: rappel.urlFichier2,
s3Key: rappel.s3Key2,
typeFichier: rappel.typeFichier2,
tailleFichier: rappel.tailleFichier2,
} : null,
});
setIsEditOpen(true);
};
@@ -694,12 +709,25 @@ export default function AdminRappels() {
/>
</div>
<FileUpload
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 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>
<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>
<div className="flex items-center space-x-2">
<Switch
@@ -840,12 +868,25 @@ export default function AdminRappels() {
/>
</div>
<FileUpload
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 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>
<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>
<div className="flex items-center space-x-2">
<Switch