From 4fdb6ef2108c5e4c577ddb97c25c9e920e496c12 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Thu, 11 May 2023 11:52:42 +0200 Subject: [PATCH 01/12] :sparkles: Add mailto to contact my notary --- .../Layouts/ClientDashboard/index.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index e861b1f8..0c3fe27b 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -1,3 +1,5 @@ +import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; +import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import DepositDocument from "@Front/Components/DesignSystem/DepositDocument"; import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"; @@ -5,12 +7,11 @@ import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; import Base from "@Front/Components/Layouts/Base"; import DefaultTemplate from "@Front/Components/LayoutTemplates/DefaultTemplate"; +import { Document } from "le-coffre-resources/dist/Customer"; import React from "react"; + import { documentDeposited } from "../DesignSystem/dummyData"; import classes from "./classes.module.scss"; -import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; -import { Document } from "le-coffre-resources/dist/Customer"; -import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; type IProps = {}; type IState = { @@ -37,11 +38,7 @@ export default class ClientDashboard extends Base {
{this.state.documents?.map((document) => ( - + ))}
Documents supplémentaires (facultatif) @@ -97,7 +94,9 @@ export default class ClientDashboard extends Base { l’aide du bouton ci-dessus.
- + + + ); } From ad2b89367f50021c78d8d7e616763cecfa77ef44 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 12:28:43 +0200 Subject: [PATCH 02/12] :art: patch other document --- .../SuperAdmin/DocumentTypes/DocumentTypes.ts | 18 ++++++------- .../DesignSystem/DepositDocument/index.tsx | 1 - .../Layouts/ClientDashboard/index.tsx | 27 ++++++++++--------- .../Layouts/DesignSystem/dummyData.ts | 8 +++--- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes.ts b/src/front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes.ts index 7904e6e5..1e8a09af 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes.ts @@ -10,16 +10,15 @@ export interface IGetDocumentTypesparams { // TODO Type getbyuid query params -export type IPutDocumentTypesParams = { -}; +export type IPutDocumentTypesParams = {}; export interface IPostDocumentTypesParams { - name: string; - public_description: string; - private_description: string; - office: { - uid: string; - }; + name: string; + public_description: string; + private_description: string; + office: { + uid: string; + }; } export default class DocumentTypes extends BaseSuperAdmin { @@ -40,7 +39,8 @@ export default class DocumentTypes extends BaseSuperAdmin { public async get(q: IGetDocumentTypesparams): Promise { const url = new URL(this.baseURl); - Object.entries(q).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value))); + const query = { q }; + if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value))); try { return await this.getRequest(url); } catch (err) { diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index fae00235..236c10e7 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -144,7 +144,6 @@ export default class DepositDocument extends React.Component { - ; ); } diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index 6fe77df4..0b6fdea4 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -6,24 +6,27 @@ import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; import Base from "@Front/Components/Layouts/Base"; import DefaultTemplate from "@Front/Components/LayoutTemplates/DefaultTemplate"; import React from "react"; -import { documentDeposited } from "../DesignSystem/dummyData"; import classes from "./classes.module.scss"; import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; -import { Document } from "le-coffre-resources/dist/Customer"; -import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; +import Customer, { Document } from "le-coffre-resources/dist/Customer"; +import Customers from "@Front/Api/LeCoffreApi/SuperAdmin/Customers/Customers"; +import { document } from "./../../../Components/Layouts/DesignSystem/dummyData"; type IProps = {}; type IState = { isAddDocumentModalVisible: boolean; documents: Document[]; + mockedCustomer: Customer | null; }; export default class ClientDashboard extends Base { + private currentClient: number = 0; public constructor(props: IProps) { super(props); this.state = { isAddDocumentModalVisible: false, documents: [], + mockedCustomer: null, }; this.onCloseModalAddDocument = this.onCloseModalAddDocument.bind(this); this.onOpenModalAddDocument = this.onOpenModalAddDocument.bind(this); @@ -37,11 +40,7 @@ export default class ClientDashboard extends Base {
{this.state.documents?.map((document) => ( - + ))}
Documents supplémentaires (facultatif) @@ -69,7 +68,7 @@ export default class ClientDashboard extends Base { Glissez / Déposez votre document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le document correspondant. - +
@@ -83,7 +82,7 @@ export default class ClientDashboard extends Base {
{/* TODO Get name from userStore */} - Bonjour John Doe + Bonjour {this.state.mockedCustomer?.contact?.first_name.concat(" ", this.state.mockedCustomer?.contact?.last_name)} @@ -105,9 +104,11 @@ export default class ClientDashboard extends Base { public override async componentDidMount() { // TODO Get documents of the current customer according to userStore // REMOVE this mock - const mockUsers = (await Users.getInstance().get({}))[2]; + const mockedCustomers = await Customers.getInstance().get({}); + const mockedCustomer = mockedCustomers[this.currentClient]!; + const query: IGetDocumentsparams = { - where: { depositor: mockUsers?.uid }, + where: { depositor: { uid: mockedCustomer.uid } }, include: { files: true, document_history: true, @@ -115,7 +116,7 @@ export default class ClientDashboard extends Base { }, }; const documents: Document[] = await Documents.getInstance().get(query); - this.setState({ documents }); + this.setState({ documents, mockedCustomer }); } private onCloseModalAddDocument() { diff --git a/src/front/Components/Layouts/DesignSystem/dummyData.ts b/src/front/Components/Layouts/DesignSystem/dummyData.ts index 552a023f..57157d5b 100644 --- a/src/front/Components/Layouts/DesignSystem/dummyData.ts +++ b/src/front/Components/Layouts/DesignSystem/dummyData.ts @@ -78,7 +78,7 @@ export const contact2: Contact = { }; export const docType: DocumentType = { - name: "Acte de naissance", + name: "Votre document", uid: "fezezfazegezrgrezg", created_at: new Date(), updated_at: new Date(), @@ -146,7 +146,7 @@ export const fileMock: File = { file_name: "file_1", file_path: "https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/Qmf_Yb_Eh_X9st_F_Srq_Ve_Bj_Yb_Aj56xv_AV_Nj6_Wjypo_B4r5ubce_U_ae3303e7ab.pdf", - iv: "1" + iv: "1", }; export const fileMock2: File = { @@ -157,7 +157,7 @@ export const fileMock2: File = { file_name: "file_2", file_path: "https://minteed-prod-euwest3-s3.s3.eu-west-3.amazonaws.com/Qm_Wq_En1_DCA_8yt_RX_Qx_QFA_9_Fm_ZKZH_Qqb_VH_1_Q_Mnv_G_Jtt1_FS_Xp_2a35a36e19", - iv: "2" + iv: "2", }; export const identityFile: File = { @@ -167,7 +167,7 @@ export const identityFile: File = { document: document, file_name: "file_3", file_path: "https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/cni_fake_c7259d4923.png", - iv: "3" + iv: "3", }; export const documentIdentity: Document = { From fa1da23eb2145ae5c358c5e1ec5032f7f54c7a4a Mon Sep 17 00:00:00 2001 From: Vincent Alamelle Date: Thu, 11 May 2023 12:39:35 +0200 Subject: [PATCH 03/12] fix iv --- package-lock.json | 38 ++++++++++++++++--- package.json | 2 +- .../Api/LeCoffreApi/SuperAdmin/Files/Files.ts | 6 --- .../Layouts/DesignSystem/dummyData.ts | 6 +-- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76839135..f10b3e4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,11 +16,12 @@ "@types/react-dom": "18.0.11", "class-validator": "^0.14.0", "classnames": "^2.3.2", + "crypto-random-string": "^5.0.0", "dotenv": "^16.0.3", "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.44", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.47", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", @@ -1535,6 +1536,20 @@ "node": ">= 8" } }, + "node_modules/crypto-random-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-5.0.0.tgz", + "integrity": "sha512-KWjTXWwxFd6a94m5CdRGW/t82Tr8DoBc9dNnPCAbFI1EBweN6v1tv8y4Y1m7ndkp/nkIBRxUxAzpaBnR2k3bcQ==", + "dependencies": { + "type-fest": "^2.12.2" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/csstype": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", @@ -2551,6 +2566,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/globalthis": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", @@ -3202,7 +3228,7 @@ } }, "node_modules/le-coffre-resources": { - "resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#30c8ee50b872a8bc6bec0f5d8c4626d8f4490177", + "resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#467b34a484adbd6dfa3fd6082bb7677f6178da51", "license": "MIT", "dependencies": { "class-transformer": "^0.5.1", @@ -4474,11 +4500,11 @@ } }, "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "engines": { - "node": ">=10" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" diff --git a/package.json b/package.json index 0ad651d1..9ebaabbc 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.44", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.47", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts index 044ed4f1..db4f0e7f 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Files/Files.ts @@ -1,7 +1,6 @@ import { File } from "le-coffre-resources/dist/SuperAdmin"; import BaseSuperAdmin from "../BaseSuperAdmin"; -import CryptoService from "@Front/Services/CryptoService/CryptoService"; // TODO Type get query params -> Where + inclue + orderby @@ -20,7 +19,6 @@ export default class Files extends BaseSuperAdmin { private static instance: Files; private readonly baseURl = this.namespaceUrl.concat("/files"); - private cryptoService: CryptoService = CryptoService.getInstance(); private constructor() { super(); } @@ -35,9 +33,6 @@ export default class Files extends BaseSuperAdmin { if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value))); try { const files = await this.getRequest(url); - files.forEach(async (file) => { - file.file_path = await this.cryptoService.decrypt(file.file_path!, file.iv); - }); return files; } catch (err) { this.onError(err); @@ -69,7 +64,6 @@ export default class Files extends BaseSuperAdmin { if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value))); try { const file = await this.getRequest(url); - file.file_path = await this.cryptoService.decrypt(file.file_path!, file.iv); return file; } catch (err) { this.onError(err); diff --git a/src/front/Components/Layouts/DesignSystem/dummyData.ts b/src/front/Components/Layouts/DesignSystem/dummyData.ts index 552a023f..ff72876b 100644 --- a/src/front/Components/Layouts/DesignSystem/dummyData.ts +++ b/src/front/Components/Layouts/DesignSystem/dummyData.ts @@ -146,7 +146,7 @@ export const fileMock: File = { file_name: "file_1", file_path: "https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/Qmf_Yb_Eh_X9st_F_Srq_Ve_Bj_Yb_Aj56xv_AV_Nj6_Wjypo_B4r5ubce_U_ae3303e7ab.pdf", - iv: "1" + archived_at: null, }; export const fileMock2: File = { @@ -157,7 +157,7 @@ export const fileMock2: File = { file_name: "file_2", file_path: "https://minteed-prod-euwest3-s3.s3.eu-west-3.amazonaws.com/Qm_Wq_En1_DCA_8yt_RX_Qx_QFA_9_Fm_ZKZH_Qqb_VH_1_Q_Mnv_G_Jtt1_FS_Xp_2a35a36e19", - iv: "2" + archived_at: null, }; export const identityFile: File = { @@ -167,7 +167,7 @@ export const identityFile: File = { document: document, file_name: "file_3", file_path: "https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/cni_fake_c7259d4923.png", - iv: "3" + archived_at: null, }; export const documentIdentity: Document = { From c4ee5111d275e7ada3c465ac48253b25f9c265cf Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 14:06:28 +0200 Subject: [PATCH 04/12] fix height --- .../Components/DesignSystem/FolderList/classes.module.scss | 3 +++ src/front/Components/DesignSystem/FolderList/index.tsx | 6 +----- .../DesignSystem/FolderListContainer/classes.module.scss | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/front/Components/DesignSystem/FolderList/classes.module.scss b/src/front/Components/DesignSystem/FolderList/classes.module.scss index 0bf5be03..b6ca5e4f 100644 --- a/src/front/Components/DesignSystem/FolderList/classes.module.scss +++ b/src/front/Components/DesignSystem/FolderList/classes.module.scss @@ -1,6 +1,9 @@ @import "@Themes/constants.scss"; .root { + height: calc(100vh - 290px); + overflow: scroll; + .active { background-color: var(--grey-medium); } diff --git a/src/front/Components/DesignSystem/FolderList/index.tsx b/src/front/Components/DesignSystem/FolderList/index.tsx index d98d432c..871eb511 100644 --- a/src/front/Components/DesignSystem/FolderList/index.tsx +++ b/src/front/Components/DesignSystem/FolderList/index.tsx @@ -26,11 +26,7 @@ class FolderListClass extends React.Component { ? Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.pages.FolderInformation.props.path : Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path; public override render(): JSX.Element { - return ( -
- {this.renderFolders()} -
- ); + return
{this.renderFolders()}
; } private renderFolders(): JSX.Element[] { diff --git a/src/front/Components/DesignSystem/FolderListContainer/classes.module.scss b/src/front/Components/DesignSystem/FolderListContainer/classes.module.scss index 588e1a18..b11dc6ba 100644 --- a/src/front/Components/DesignSystem/FolderListContainer/classes.module.scss +++ b/src/front/Components/DesignSystem/FolderListContainer/classes.module.scss @@ -1,8 +1,7 @@ @import "@Themes/constants.scss"; .root { - min-height: 100%; - width: 100%; + width: calc(100vh - 83px); display: flex; flex-direction: column; justify-content: space-between; From 48a8759e95559cdf7b79b00b4e5e7f38c9edfa30 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 14:10:06 +0200 Subject: [PATCH 05/12] :art: fix format number --- .../DesignSystem/UserFolder/UserFolderHeader/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx index bdc82961..c0749243 100644 --- a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx @@ -75,6 +75,7 @@ export default class UserFolderHeader extends React.Component { private formatPhoneNumber(phoneNumber: string): string { if (!phoneNumber) return ""; + phoneNumber = phoneNumber.replace(" ", ""); const output = phoneNumber.split("").map((char, index) => { if (index % 2) return char + " "; return char; From 3df721dad0200eca841cc3c1c8663678cf506660 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 14:18:18 +0200 Subject: [PATCH 06/12] fix format phone number --- .../DesignSystem/UserFolder/UserFolderHeader/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx index c0749243..1568a2c5 100644 --- a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx @@ -75,7 +75,7 @@ export default class UserFolderHeader extends React.Component { private formatPhoneNumber(phoneNumber: string): string { if (!phoneNumber) return ""; - phoneNumber = phoneNumber.replace(" ", ""); + phoneNumber = phoneNumber.replace(/ /g, ""); const output = phoneNumber.split("").map((char, index) => { if (index % 2) return char + " "; return char; From 488bc2809a951e88da5bd5d50cb4f090ad60a73d Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 14:43:34 +0200 Subject: [PATCH 07/12] :art: supress document on archived date --- src/front/Components/DesignSystem/DepositDocument/index.tsx | 6 ++++++ src/front/Components/Layouts/ClientDashboard/index.tsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index 236c10e7..ff6a9cf0 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -26,6 +26,7 @@ type IFile = { index: number; file: File; uid: string; + archived: Date | null; }; type IState = { @@ -100,6 +101,7 @@ export default class DepositDocument extends React.Component {
{this.state.files.map((file) => { const fileObj = file.file; + if (file.archived) return; return (
@@ -155,6 +157,7 @@ export default class DepositDocument extends React.Component { index: this.index++, file: new File([""], file.file_path ?? "", {}), uid: file.uid!, + archived: file.archived_at ? new Date(file.archived_at) : null, })), }); } @@ -219,6 +222,8 @@ export default class DepositDocument extends React.Component { return name; } + private doesFileIsArchived(file: IFile) {} + private onDragOver(event: React.DragEvent) { if (!this.state.isDragOver) { this.setState({ @@ -268,6 +273,7 @@ export default class DepositDocument extends React.Component { index: this.index++, file: file, uid: newFile.uid!, + archived: null, }, ], }); diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index 6c2a7e7e..f2ba8bf4 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -20,7 +20,7 @@ type IState = { }; export default class ClientDashboard extends Base { - private currentClient: number = 0; + private currentClient: number = 14; public constructor(props: IProps) { super(props); this.state = { From f20517117e4baa56e9cd77a0434d14dd0afa4b2d Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 14:47:40 +0200 Subject: [PATCH 08/12] fix build --- src/front/Components/DesignSystem/DepositDocument/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index ff6a9cf0..80210dde 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -222,8 +222,6 @@ export default class DepositDocument extends React.Component { return name; } - private doesFileIsArchived(file: IFile) {} - private onDragOver(event: React.DragEvent) { if (!this.state.isDragOver) { this.setState({ From 3c92a0e9abd922149f824c84ec623a83fdba3800 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 16:10:51 +0200 Subject: [PATCH 09/12] :art: fix 4 client dashboard --- .../Layouts/ClientDashboard/index.tsx | 9 +++++---- .../Layouts/Folder/ViewDocuments/index.tsx | 17 +++++++++-------- src/pages/client-dashboard.tsx | 2 +- src/pages/client-dashboard1.tsx | 5 +++++ src/pages/client-dashboard2.tsx | 5 +++++ src/pages/client-dashboard3.tsx | 5 +++++ src/pages/login-callback.tsx | 2 +- 7 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 src/pages/client-dashboard1.tsx create mode 100644 src/pages/client-dashboard2.tsx create mode 100644 src/pages/client-dashboard3.tsx diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index f2ba8bf4..ca89171b 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -12,7 +12,9 @@ import Customers from "@Front/Api/LeCoffreApi/SuperAdmin/Customers/Customers"; import Customer, { Document } from "le-coffre-resources/dist/Customer"; import { document } from "./../../../Components/Layouts/DesignSystem/dummyData"; -type IProps = {}; +type IProps = { + targetedCustormer: string; // MOCK +}; type IState = { isAddDocumentModalVisible: boolean; documents: Document[]; @@ -20,7 +22,6 @@ type IState = { }; export default class ClientDashboard extends Base { - private currentClient: number = 14; public constructor(props: IProps) { super(props); this.state = { @@ -106,8 +107,8 @@ export default class ClientDashboard extends Base { public override async componentDidMount() { // TODO Get documents of the current customer according to userStore // REMOVE this mock - const mockedCustomers = await Customers.getInstance().get({}); - const mockedCustomer = mockedCustomers[this.currentClient]!; + const mockedCustomers = await Customers.getInstance().get({ where: { contact: { email: this.props.targetedCustormer } } }); + const mockedCustomer: Customer = mockedCustomers[0]!; const query: IGetDocumentsparams = { where: { depositor: { uid: mockedCustomer.uid } }, diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 9db8c4fd..68b41f2e 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -1,4 +1,3 @@ - import LeftArrowIcon from "@Assets/Icons/left-arrow.svg"; import RightArrowIcon from "@Assets/Icons/right-arrow.svg"; import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; @@ -22,7 +21,6 @@ import classes from "./classes.module.scss"; import OcrResult from "./OcrResult"; import Files from "@Front/Api/LeCoffreApi/SuperAdmin/Files/Files"; - type IProps = {}; type IPropsClass = { documentUid: string; @@ -76,7 +74,7 @@ class ViewDocumentsClass extends BasePage { {this.state.document && this.state.document.files && this.state.selectedFile && (
- App 23 rue Torus Toulon + {this.state.document.document_type?.name} {this.state.document.document_type?.name} @@ -91,7 +89,10 @@ class ViewDocumentsClass extends BasePage {
)}
- +
{this.state.document.files.length > 1 && (
{ return index < this.state.document!.files!.length; } - private async refuseDocument(){ - try{ + private async refuseDocument() { + try { await Documents.getInstance().put(this.props.documentUid, { document_status: EDocumentStatus.REFUSED, - refused_reason: this.state.refuseText + refused_reason: this.state.refuseText, }); this.props.router.push( @@ -280,7 +281,7 @@ class ViewDocumentsClass extends BasePage { .get() .modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid), ); - }catch(e){ + } catch (e) { console.error(e); } } diff --git a/src/pages/client-dashboard.tsx b/src/pages/client-dashboard.tsx index eb839556..931db6d5 100644 --- a/src/pages/client-dashboard.tsx +++ b/src/pages/client-dashboard.tsx @@ -1,5 +1,5 @@ import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; export default function Route() { - return ; + return ; } diff --git a/src/pages/client-dashboard1.tsx b/src/pages/client-dashboard1.tsx new file mode 100644 index 00000000..9c2082f6 --- /dev/null +++ b/src/pages/client-dashboard1.tsx @@ -0,0 +1,5 @@ +import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; + +export default function Route() { + return ; +} diff --git a/src/pages/client-dashboard2.tsx b/src/pages/client-dashboard2.tsx new file mode 100644 index 00000000..3f09fb4f --- /dev/null +++ b/src/pages/client-dashboard2.tsx @@ -0,0 +1,5 @@ +import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; + +export default function Route() { + return ; +} diff --git a/src/pages/client-dashboard3.tsx b/src/pages/client-dashboard3.tsx new file mode 100644 index 00000000..d4f29e4f --- /dev/null +++ b/src/pages/client-dashboard3.tsx @@ -0,0 +1,5 @@ +import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; + +export default function Route() { + return ; +} diff --git a/src/pages/login-callback.tsx b/src/pages/login-callback.tsx index eb839556..931db6d5 100644 --- a/src/pages/login-callback.tsx +++ b/src/pages/login-callback.tsx @@ -1,5 +1,5 @@ import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; export default function Route() { - return ; + return ; } From 4b4bafee316d3bcd9798d6b682188818c7c68c87 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 16:26:13 +0200 Subject: [PATCH 10/12] :art: fix blank --- src/front/Components/Layouts/ClientDashboard/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index ca89171b..77680d3a 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -97,7 +97,7 @@ export default class ClientDashboard extends Base { l’aide du bouton ci-dessus.
- +
From 31b5fed9b3f9f06413ae6fb7610e381ea03d8f7c Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 17:09:28 +0200 Subject: [PATCH 11/12] :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 12/12] :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 + /> + + + - - -