From f756e12c5f956a4f722fbb0a1e7c2ff371197a42 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 2 Oct 2023 11:41:31 +0200 Subject: [PATCH] :sparkles: Preventing anchoring if not validated --- .../Folder/FolderInformation/index.tsx | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index f122a976..4afac6fa 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -37,6 +37,7 @@ type IState = { hasValidateAnchoring: boolean; isVerifDeleteModalVisible: boolean; isAnchored: boolean | null; + isPreventArchiveModalOpen: boolean; }; class FolderInformationClass extends BasePage { public constructor(props: IPropsClass) { @@ -49,6 +50,7 @@ class FolderInformationClass extends BasePage { hasValidateAnchoring: false, isVerifDeleteModalVisible: false, isAnchored: null, + isPreventArchiveModalOpen: false, }; this.onSelectedFolder = this.onSelectedFolder.bind(this); this.openArchivedModal = this.openArchivedModal.bind(this); @@ -63,6 +65,7 @@ class FolderInformationClass extends BasePage { this.openVerifDeleteFolder = this.openVerifDeleteFolder.bind(this); this.closeVerifDeleteFolder = this.closeVerifDeleteFolder.bind(this); this.verifyAnchorStatus = this.verifyAnchorStatus.bind(this); + this.closePreventArchiveModal = this.closePreventArchiveModal.bind(this); } // TODO: Message if the user has not created any folder yet @@ -174,6 +177,22 @@ class FolderInformationClass extends BasePage { )} + +
+ + Pour valider un dossier, toutes les pièces envoyées par vos clients doivent être validées (vert). Si certains + documents sont en attente (orange), alors, veuillez les valider ou les refuser et veillez à ce qu'aucun document + ne soit encore en demandé au client (gris) + +
+
{ ); } + private closePreventArchiveModal() { + this.setState({ + isPreventArchiveModalOpen: false, + }); + } + private async verifyAnchorStatus() { if (!this.state.selectedFolder || !this.state.selectedFolder.uid) return; try { @@ -352,7 +377,11 @@ class FolderInformationClass extends BasePage { } private openArchivedModal(): void { - this.setState({ isArchivedModalOpen: true }); + if (this.everyDocumentValidated() && this.state.isAnchored) { + this.setState({ isArchivedModalOpen: true }); + } else { + this.setState({ isPreventArchiveModalOpen: true }); + } } private closeArchivedModal(): void {