diff --git a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx index 5d64c569..6131e875 100644 --- a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx @@ -1,4 +1,7 @@ import PlusIcon from "@Assets/Icons/plus.svg"; +import Deeds from "@Front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds"; +import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; +import DocumentTypes from "@Front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes"; import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import CheckBox from "@Front/Components/DesignSystem/CheckBox"; @@ -9,16 +12,13 @@ import { IOption } from "@Front/Components/DesignSystem/Select"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; import BackArrow from "@Front/Components/Elements/BackArrow"; import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; +import Module from "@Front/Config/Module"; +import { OfficeFolder } from "le-coffre-resources/dist/Customer"; import { NextRouter, useRouter } from "next/router"; import React from "react"; import BasePage from "../../Base"; import classes from "./classes.module.scss"; -import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; -import Module from "@Front/Config/Module"; -import { OfficeFolder } from "le-coffre-resources/dist/Customer"; -import Deeds from "@Front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds"; -import DocumentTypes from "@Front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes"; type IProps = {}; type IPropsClass = IProps & { @@ -57,10 +57,13 @@ class AskDocumentsClass extends BasePage { } public override render(): JSX.Element { + const backUrl = Module.getInstance() + .get() + .modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid); return ( {}}>
- + Demander des documents @@ -87,9 +90,11 @@ class AskDocumentsClass extends BasePage {
- + + +
@@ -146,8 +151,8 @@ class AskDocumentsClass extends BasePage { include: { depositor: true, document_type: true, - } - } + }, + }, }, }); if (!folder) return; @@ -161,25 +166,29 @@ class AskDocumentsClass extends BasePage { } private async getAvailableDocuments(folder: OfficeFolder): Promise { - const userDocumentTypesUids = folder.documents!.filter((document) => document.depositor!.uid! === this.props.customerUid!).map((document) => { - return document.document_type!.uid!; - }); + const userDocumentTypesUids = folder + .documents!.filter((document) => document.depositor!.uid! === this.props.customerUid!) + .map((document) => { + return document.document_type!.uid!; + }); const documentTypes = folder.deed!.deed_has_document_types!.filter((documentType) => { - if(userDocumentTypesUids.includes(documentType.document_type!.uid!)) return false; + if (userDocumentTypesUids.includes(documentType.document_type!.uid!)) return false; return true; }); if (!documentTypes) return []; - const documentTypesOptions: IOption[] = documentTypes.filter((documentType) => { - return true; - }).map((documentType) => { - return { - label: documentType.document_type!.name!, - value: documentType.document_type!.uid!, - description: documentType.document_type!.private_description!, - }; - }); + const documentTypesOptions: IOption[] = documentTypes + .filter((documentType) => { + return true; + }) + .map((documentType) => { + return { + label: documentType.document_type!.name!, + value: documentType.document_type!.uid!, + description: documentType.document_type!.private_description!, + }; + }); return documentTypesOptions; }