From 31b5fed9b3f9f06413ae6fb7610e381ea03d8f7c Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 17:09:28 +0200 Subject: [PATCH 1/4] :art: fix archived folders --- .../DesignSystem/Document/DocumentNotary/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx b/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx index 0ae10ec5..986d573e 100644 --- a/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx +++ b/src/front/Components/DesignSystem/Document/DocumentNotary/index.tsx @@ -58,7 +58,9 @@ class DocumentNotaryClass extends React.Component { return fileName; } } else { - return `${documentFiles.length} documents déposés`; + const archivedFilesLenght = documentFiles.filter((file) => file.archived_at).length; + const documentFileLenght = documentFiles.length - archivedFilesLenght; + return `${documentFileLenght} documents déposés`; } } else { return "Aucun document déposé"; @@ -66,7 +68,11 @@ class DocumentNotaryClass extends React.Component { } private onClick() { - if (this.props.document.document_status !== EDocumentStatus.VALIDATED && this.props.document.document_status !== EDocumentStatus.DEPOSITED) return; + if ( + this.props.document.document_status !== EDocumentStatus.VALIDATED && + this.props.document.document_status !== EDocumentStatus.DEPOSITED + ) + return; this.props.router.push(`/folders/${this.props.folderUid}/documents/${this.props.document.uid}`); } From fdd7d2ca79d6bce1bcf85fa624c802e3960477a9 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 17:33:16 +0200 Subject: [PATCH 2/4] :art: fix tooltip description --- .../FolderBoxInformation/classes.module.scss | 11 +++-- .../Components/DesignSystem/Select/index.tsx | 1 + .../Layouts/Folder/AskDocuments/index.tsx | 4 +- .../Folder/FolderInformation/index.tsx | 3 +- src/front/Components/Layouts/Folder/index.tsx | 2 +- .../FolderInformation/index.tsx | 3 +- .../Layouts/FolderArchived/index.tsx | 8 +++- .../Components/Layouts/MyAccount/index.tsx | 40 +++++++++++++++---- 8 files changed, 51 insertions(+), 21 deletions(-) diff --git a/src/front/Components/DesignSystem/FolderBoxInformation/classes.module.scss b/src/front/Components/DesignSystem/FolderBoxInformation/classes.module.scss index c22fa8de..37c7ee45 100644 --- a/src/front/Components/DesignSystem/FolderBoxInformation/classes.module.scss +++ b/src/front/Components/DesignSystem/FolderBoxInformation/classes.module.scss @@ -8,6 +8,12 @@ align-items: center; justify-content: space-between; + &.single-information { + .content { + grid-template-columns: 1fr; + } + } + .content { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; @@ -17,7 +23,6 @@ .text-container { display: flex; flex-direction: column; - justify-content: space-between; > :first-child { margin-bottom: 12px; @@ -33,9 +38,7 @@ grid-template-columns: 1fr; } - &.single-information { - grid-template-columns: 1fr; - } + } .edit-icon-container { diff --git a/src/front/Components/DesignSystem/Select/index.tsx b/src/front/Components/DesignSystem/Select/index.tsx index 3ea8698b..de35d518 100644 --- a/src/front/Components/DesignSystem/Select/index.tsx +++ b/src/front/Components/DesignSystem/Select/index.tsx @@ -22,6 +22,7 @@ export type IOption = { value: unknown; label: string; icon?: ReactNode; + description?: string; }; type IState = { diff --git a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx index 9f718dac..c8835c17 100644 --- a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx @@ -1,4 +1,3 @@ - import PlusIcon from "@Assets/Icons/plus.svg"; import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; @@ -71,7 +70,7 @@ class AskDocumentsClass extends BasePage { {this.state.documentTypes.map((documentType) => ( @@ -172,6 +171,7 @@ class AskDocumentsClass extends BasePage { return { label: documentType.document_type!.name!, value: documentType.document_type!.uid!, + description: documentType.document_type!.private_description!, }; }); diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index 176f61f3..402b8a52 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -1,4 +1,3 @@ - import ChevronIcon from "@Assets/Icons/chevron.svg"; import Folders, { IPutFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; @@ -124,7 +123,7 @@ class FolderInformationClass extends BasePage { Informations du dossier
- Veuillez sélectionner un dossier. + Vous n'avez aucun dossier archivés
diff --git a/src/front/Components/Layouts/Folder/index.tsx b/src/front/Components/Layouts/Folder/index.tsx index 0b012370..ce73a13d 100644 --- a/src/front/Components/Layouts/Folder/index.tsx +++ b/src/front/Components/Layouts/Folder/index.tsx @@ -28,7 +28,7 @@ export default class Folder extends BasePage { Informations du dossier
- Veuillez sélectionner un dossier. + Vous n'avez aucun dossier archivés
diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index fa34a49d..d17634ae 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -1,4 +1,3 @@ - import ChevronIcon from "@Assets/Icons/chevron.svg"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation"; @@ -94,7 +93,7 @@ class FolderInformationClass extends BasePage { Informations du dossier
- Veuillez sélectionner un dossier. + Vous n'avez aucun dossier archivés
diff --git a/src/front/Components/Layouts/FolderArchived/index.tsx b/src/front/Components/Layouts/FolderArchived/index.tsx index 93afb625..f411b087 100644 --- a/src/front/Components/Layouts/FolderArchived/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/index.tsx @@ -21,13 +21,17 @@ export default class Folder extends BasePage { // TODO: Message if the user has not created any folder yet public override render(): JSX.Element { return ( - +
Informations du dossier
- Veuillez sélectionner un dossier. + Vous n'avez aucun dossier archivés
diff --git a/src/front/Components/Layouts/MyAccount/index.tsx b/src/front/Components/Layouts/MyAccount/index.tsx index 4f892401..11fbb369 100644 --- a/src/front/Components/Layouts/MyAccount/index.tsx +++ b/src/front/Components/Layouts/MyAccount/index.tsx @@ -25,10 +25,22 @@ export default class MyAccount extends Base {
- - - - + + + +
@@ -42,12 +54,24 @@ export default class MyAccount extends Base { name="office_denomination" fakeplaceholder="Dénomination de l'office" type="text" - defaultValue="AP NOTAIRES" + defaultValue="Etude Office notarial du Cormier" + disabled + /> + + + - - - From 480fff082ff88de6184327e2b6427e050c9c7f47 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Thu, 11 May 2023 17:50:16 +0200 Subject: [PATCH 3/4] :bug: Folder name in view document --- src/front/Components/Layouts/Folder/ViewDocuments/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 68b41f2e..677b0260 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -74,7 +74,7 @@ class ViewDocumentsClass extends BasePage { {this.state.document && this.state.document.files && this.state.selectedFile && (
- {this.state.document.document_type?.name} + {this.state.document.folder?.name} {this.state.document.document_type?.name} @@ -188,6 +188,7 @@ class ViewDocumentsClass extends BasePage { const document = await Documents.getInstance().getByUid(this.props.documentUid, { files: true, document_type: true, + folder: true, }); this.setState({ document, From 72342d98d0317bcde76bef4a01748be504496cc9 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 17:55:23 +0200 Subject: [PATCH 4/4] :art: tooltip + folder name --- src/front/Components/Layouts/DesignSystem/dummyData.ts | 4 ++-- .../Components/Layouts/Folder/ViewDocuments/index.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/front/Components/Layouts/DesignSystem/dummyData.ts b/src/front/Components/Layouts/DesignSystem/dummyData.ts index 6007218c..449e321f 100644 --- a/src/front/Components/Layouts/DesignSystem/dummyData.ts +++ b/src/front/Components/Layouts/DesignSystem/dummyData.ts @@ -82,8 +82,8 @@ export const docType: DocumentType = { uid: "fezezfazegezrgrezg", created_at: new Date(), updated_at: new Date(), - public_description: "Acte de naissance public description", - private_description: "Acte de naissance private description", + public_description: "", + private_description: "", archived_at: new Date(), office: office, }; diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 68b41f2e..82d555c9 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -10,7 +10,7 @@ import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; import Module from "@Front/Config/Module"; -import { Document, File } from "le-coffre-resources/dist/Customer"; +import { Document, File, OfficeFolder } from "le-coffre-resources/dist/Customer"; import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; import Image from "next/image"; import { NextRouter, useRouter } from "next/router"; @@ -20,6 +20,8 @@ import BasePage from "../../Base"; import classes from "./classes.module.scss"; import OcrResult from "./OcrResult"; import Files from "@Front/Api/LeCoffreApi/SuperAdmin/Files/Files"; +import Folder from ".."; +import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; type IProps = {}; type IPropsClass = { @@ -37,6 +39,7 @@ type IState = { selectedFile: File | null; validatedPercentage: number; document: Document | null; + folder: OfficeFolder | null; }; class ViewDocumentsClass extends BasePage { @@ -52,6 +55,7 @@ class ViewDocumentsClass extends BasePage { selectedFile: null, validatedPercentage: this.getRandomPercentageForOcr(), document: null, + folder: null, }; this.closeModals = this.closeModals.bind(this); @@ -74,7 +78,7 @@ class ViewDocumentsClass extends BasePage { {this.state.document && this.state.document.files && this.state.selectedFile && (
- {this.state.document.document_type?.name} + {this.state.folder?.name} {this.state.document.document_type?.name} @@ -189,10 +193,12 @@ class ViewDocumentsClass extends BasePage { files: true, document_type: true, }); + const folder = await Folders.getInstance().getByUid(this.props.folderUid); this.setState({ document, selectedFileIndex: 0, selectedFile: document.files![0]!, + folder, }); } catch (e) { console.error(e);