diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index 14e6376f..be75b1ac 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -207,7 +207,7 @@ export default class DepositDocument extends React.Component { {this.props.document.document_status === EDocumentStatus.REFUSED && ( - Ce document n’est pas conforme. Veuillez le déposer à nouveau. + Ce document n'est pas conforme. Veuillez le déposer à nouveau. )} diff --git a/src/front/Components/DesignSystem/Header/Navigation/index.tsx b/src/front/Components/DesignSystem/Header/Navigation/index.tsx index 71106d0c..37b9b84c 100644 --- a/src/front/Components/DesignSystem/Header/Navigation/index.tsx +++ b/src/front/Components/DesignSystem/Header/Navigation/index.tsx @@ -24,7 +24,6 @@ export default function Navigation() { redirectUrl: notification.notification.redirection_url, }); }); - console.log(notifications); }, []); useEffect(() => { diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index de5609e4..5e1d82b6 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -24,15 +24,15 @@ export default function ClientDashboard(props: IProps) { const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState(false); const getDocuments = useCallback(async () => { - let jwt: ICustomerJwtPayload | undefined;; + let jwt: ICustomerJwtPayload | undefined; if (typeof document !== "undefined") { jwt = JwtService.getInstance().decodeCustomerJwt(); } const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } }); - console.log(folder) + console.log(folder); const actualCustomer = folder?.customers?.find((customer) => customer.uid === jwt?.customerId); - if(!actualCustomer) throw new Error("Customer not found"); + if (!actualCustomer) throw new Error("Customer not found"); const query: IGetDocumentsparams = { where: { depositor: { uid: actualCustomer.uid }, folder_uid: folderUid as string }, @@ -47,7 +47,7 @@ export default function ClientDashboard(props: IProps) { const documentList = await Documents.getInstance().get(query); //const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } }); - + setFolder(folder); setDocuments(documentList); setCustomer(actualCustomer); @@ -91,12 +91,9 @@ export default function ClientDashboard(props: IProps) { Votre notaire est dans l'attente de documents pour valider votre dossier. Voici la liste des documents.Veuillez glisser / déposez chaque document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le document correspondant. Si un des documents demandés ne vous concernent pas, veuillez contacter votre notaire à - l’aide du bouton ci-dessus. + l'aide du bouton ci-dessus. - - - ); }, [customer, folder?.folder_number, folder?.name, folder?.office?.name]); diff --git a/src/front/Components/Layouts/ClientDashboard/index2.tsx b/src/front/Components/Layouts/ClientDashboard/index2.tsx index 226c45d1..2ee68774 100644 --- a/src/front/Components/Layouts/ClientDashboard/index2.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index2.tsx @@ -97,12 +97,9 @@ export default class ClientDashboard extends Base { Votre notaire est dans l'attente de documents pour valider votre dossier. Voici la liste des documents.Veuillez glisser / déposez chaque document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le document correspondant. Si un des documents demandés ne vous concernent pas, veuillez contacter votre notaire à - l’aide du bouton ci-dessus. + l'aide du bouton ci-dessus. - - - ); } diff --git a/src/front/Components/Layouts/DocumentTypes/DocumentTypesEdit/index.tsx b/src/front/Components/Layouts/DocumentTypes/DocumentTypesEdit/index.tsx index 2f811f0f..42d71e27 100644 --- a/src/front/Components/Layouts/DocumentTypes/DocumentTypesEdit/index.tsx +++ b/src/front/Components/Layouts/DocumentTypes/DocumentTypesEdit/index.tsx @@ -70,7 +70,7 @@ export default function DocumentTypesEdit() { />
diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index 77921a72..7d113588 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -36,6 +36,7 @@ type IState = { isValidateModalVisible: boolean; hasValidateAnchoring: boolean; isVerifDeleteModalVisible: boolean; + isAnchored: boolean | null; }; class FolderInformationClass extends BasePage { public constructor(props: IPropsClass) { @@ -47,6 +48,7 @@ class FolderInformationClass extends BasePage { isValidateModalVisible: false, hasValidateAnchoring: false, isVerifDeleteModalVisible: false, + isAnchored: null, }; this.onSelectedFolder = this.onSelectedFolder.bind(this); this.openArchivedModal = this.openArchivedModal.bind(this); @@ -60,6 +62,7 @@ class FolderInformationClass extends BasePage { this.openValidateModal = this.openValidateModal.bind(this); this.openVerifDeleteFolder = this.openVerifDeleteFolder.bind(this); this.closeVerifDeleteFolder = this.closeVerifDeleteFolder.bind(this); + this.verifyAnchorStatus = this.verifyAnchorStatus.bind(this); } // TODO: Message if the user has not created any folder yet @@ -109,16 +112,20 @@ class FolderInformationClass extends BasePage { Archiver le dossier {this.everyDocumentValidated() && ( - - )} - {this.everyDocumentValidated() && ( - + <> + {this.state.isAnchored === null && ( + + )} + {this.state.isAnchored === true && ( + + )} + )} {!this.doesFolderHaveCustomer() && ( @@ -207,11 +214,30 @@ class FolderInformationClass extends BasePage { ); } public override async componentDidMount() { - this.setState({ - selectedFolder: (await this.getFolder()) as OfficeFolder, - }); + const selectedFolder = await this.getFolder(); + this.setState( + { + selectedFolder, + }, + () => { + this.verifyAnchorStatus(); + }, + ); } + private async verifyAnchorStatus() { + if (!this.state.selectedFolder || !this.state.selectedFolder.uid) return; + try { + const anchorStatus = await OfficeFolderAnchors.getInstance().get(this.state.selectedFolder.uid!); + this.setState({ + isAnchored: anchorStatus.status === "VERIFIED_ON_CHAIN", + }); + } catch (e) { + this.setState({ + isAnchored: null, + }); + } + } public openVerifDeleteFolder() { this.setState({ isVerifDeleteModalVisible: true, @@ -267,15 +293,11 @@ class FolderInformationClass extends BasePage { private async anchorFolder() { if (!this.state.selectedFolder?.uid) return; const anchor = await OfficeFolderAnchors.getInstance().post(this.state.selectedFolder.uid); - console.log(anchor); } private async downloadAnchoringProof(uid?: string) { if (!uid) return; - const anchor = await OfficeFolderAnchors.getInstance().get(uid); - if (anchor.status !== "VERIFIED_ON_CHAIN") return; - try { const file: Blob = await OfficeFolderAnchors.getInstance().download(uid); const url = window.URL.createObjectURL(file); diff --git a/src/front/Components/Layouts/PageNotFound/index.tsx b/src/front/Components/Layouts/PageNotFound/index.tsx index 6c6022dd..7b332088 100644 --- a/src/front/Components/Layouts/PageNotFound/index.tsx +++ b/src/front/Components/Layouts/PageNotFound/index.tsx @@ -19,7 +19,7 @@ export default class PageNotFound extends BasePage { La page que vous recherchez semble introuvable. - +