VSN-2325/ fix(incident-documents): fix crash, stale data, download, owner name and import UX
This MR includes the following changes :
- Fixe multiple bugs in the Documents tab of the incident form (Client-side crash, Old documents flash when switching incidents, Owner name shows fallback instead of real value, Download opens blank tab, Import triggers upload immediately on file select)
- Align incident document types with the backend DocumentType enum
Code quality (MR review feedback)
- Replace
catch (error: any)withcatch (err: unknown)acrossfleet-document-store,driver-absence-document-storeanddocuments-form - Type the raw API response in
driver-absence-document-storewithDriverAbsenceDocumentRawinstead ofany - Type
documentToRenameasIDocument | null,handleDownloadDocumentandhandleRenameDocumentparameters asIDocument, and the store document mapping as(FleetDocument | DriverAbsenceDocument)[] - Fix typo
secoundButtonText→secondButtonTextinActionButtonsand all call sites (9 files) - Translate
ConfirmDialoglabels to French for UI consistency - Add JSDoc to
_INCIDENT_DOCUMENT_TYPESandmainIncidentFormFields