From 1882fa6b6c70abac3f8bfbe2ba7ef5b89a376115 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 29 Apr 2024 14:42:37 +0200 Subject: [PATCH 1/2] :sparkles: new error messages deposit document --- src/front/Components/DesignSystem/DepositDocument/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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({ From 8e91736c774ab4321f67418d43278a36a5f346fe Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 29 Apr 2024 14:51:29 +0200 Subject: [PATCH 2/2] =?UTF-8?q?:sparkles:=20Document=20non=20trouv=C3=A9?= =?UTF-8?q?=20n'appara=C3=AEt=20plus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Layouts/Folder/ViewDocuments/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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); } }