diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index 21d47e1c..1551137f 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -340,11 +340,11 @@ export default class DepositDocument extends React.Component { private async addFile(file: File) { const fileAccepted = filesAccepted[file.type]; if (!fileAccepted) { - alert("Ce type de fichier n'est pas accepté"); + alert("Le fichier déposé doit être au format .jpg .pdf .jpeg ou .png"); return false; } if (file.size > fileAccepted.size) { - alert("Ce fichier est trop volumineux"); + alert("Le fichier est trop volumineux et ne doit pas dépasser 32mo"); return false; } this.setState({ diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 9469d218..d6d36e58 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -34,6 +34,7 @@ type IState = { validatedPercentage: number; document: Document | null; fileBlob: Blob | null; + isLoading: boolean; }; class ViewDocumentsClass extends BasePage { @@ -49,6 +50,7 @@ class ViewDocumentsClass extends BasePage { validatedPercentage: this.getRandomPercentageForOcr(), document: null, fileBlob: null, + isLoading: true, }; this.closeModals = this.closeModals.bind(this); @@ -68,7 +70,7 @@ class ViewDocumentsClass extends BasePage { public override render(): JSX.Element | null { return ( - {this.state.document && this.state.document.files && this.state.selectedFile && ( + {this.state.document && this.state.document.files && this.state.selectedFile && !this.state.isLoading && (
{this.state.document.folder?.name} @@ -156,7 +158,7 @@ class ViewDocumentsClass extends BasePage {
)} - {(!this.state.selectedFile || !this.state.document) && ( + {(!this.state.selectedFile || !this.state.document) && !this.state.isLoading && (
Document non trouvé @@ -182,12 +184,16 @@ class ViewDocumentsClass extends BasePage { document, selectedFileIndex: 0, selectedFile: document.files![0]!, + isLoading: false, }, () => { this.getFilePreview(); }, ); } catch (e) { + this.setState({ + isLoading: false, + }); console.error(e); } }