Refonte qualité (shared / back / front) #1

Open
z3n wants to merge 14 commits from chore/quality-refonte into main
Showing only changes of commit 15e05cc46c - Show all commits

View File

@@ -511,6 +511,7 @@ export class UploadComponent implements OnInit {
private destroyRef = inject(DestroyRef); private destroyRef = inject(DestroyRef);
step = signal(1); step = signal(1);
private readonly maxFileSize = 5 * 1024 * 1024; // 5 Mo
selectedFiles = signal<File[]>([]); selectedFiles = signal<File[]>([]);
detectedType = signal<'ASYNCAPI' | 'OPENAPI' | null>(null); detectedType = signal<'ASYNCAPI' | 'OPENAPI' | null>(null);
detectedMainFilename = signal<string | null>(null); detectedMainFilename = signal<string | null>(null);
@@ -717,6 +718,15 @@ export class UploadComponent implements OnInit {
return; return;
} }
const tooLarge = files.find((f) => f.size > this.maxFileSize);
if (tooLarge) {
this.fileError.set(
`Fichier trop volumineux (${tooLarge.name}). Taille max : ${this.maxFileSize / (1024 * 1024)} Mo.`,
);
this.selectedFiles.set([]);
return;
}
this.selectedFiles.set(files); this.selectedFiles.set(files);
/* Détection côté client du fichier principal (pré-remplissage du type) */ /* Détection côté client du fichier principal (pré-remplissage du type) */