From d5239766eb4856845ee21b46077df211ac41a1c2 Mon Sep 17 00:00:00 2001 From: Vins Date: Tue, 29 Oct 2024 15:57:42 +0100 Subject: [PATCH 1/5] Typo front + Refused reason customer side --- .../ClientDashboard/ContactBox/index.tsx | 6 +-- .../classes.module.scss | 6 +++ .../DepositDocumentComponent/index.tsx | 45 ++++++++++++++++++- .../Layouts/Login/StepEmail/index.tsx | 2 +- 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/src/front/Components/Layouts/ClientDashboard/ContactBox/index.tsx b/src/front/Components/Layouts/ClientDashboard/ContactBox/index.tsx index 03ad6bc8..d3c806a1 100644 --- a/src/front/Components/Layouts/ClientDashboard/ContactBox/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/ContactBox/index.tsx @@ -79,9 +79,7 @@ export default function ContactBox(props: IProps) { {notaryContact?.email ?? "_"} -
- {noteAndRibButton()} -
+
{noteAndRibButton()}
{noteAndRibButton()}
@@ -107,7 +105,7 @@ export default function ContactBox(props: IProps) { size={EButtonSize.LG} styletype={EButtonstyletype.CONTAINED} rightIcon={}> - Télécharger le RIB + Télécharger le RIB de mon notaire )} diff --git a/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/classes.module.scss b/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/classes.module.scss index c13c6a35..dc156ed8 100644 --- a/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/classes.module.scss +++ b/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/classes.module.scss @@ -11,6 +11,12 @@ display: flex; flex-direction: column; gap: var(--spacing-sm, 8px); + + .refused-link { + color: var(--color-danger-500); + text-decoration: underline !important; + cursor: pointer; + } } @media screen and (max-width: $screen-s) { diff --git a/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/index.tsx b/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/index.tsx index 46ef2cec..44c227f3 100644 --- a/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/index.tsx @@ -1,11 +1,12 @@ import DragAndDrop, { IDocumentFileWithUid } from "@Front/Components/DesignSystem/DragAndDrop"; import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography"; import { Document } from "le-coffre-resources/dist/Customer"; -import { useCallback, useMemo } from "react"; +import { useCallback, useMemo, useState } from "react"; import classes from "./classes.module.scss"; import Files from "@Front/Api/LeCoffreApi/Customer/Files/Files"; import { ToasterService } from "@Front/Components/DesignSystem/Toaster"; +import Confirm from "@Front/Components/DesignSystem/OldModal/Confirm"; type IProps = { document: Document; @@ -14,6 +15,8 @@ type IProps = { export default function DepositDocumentComponent(props: IProps) { const { document, onChange } = props; + const [isModalOpen, setIsModalOpen] = useState(false); + const [refused_reason, setRefusedReason] = useState(null); const defaultFiles: IDocumentFileWithUid[] = useMemo(() => { const filesNotArchived = document.files?.filter((file) => !file.archived_at) ?? []; @@ -50,6 +53,17 @@ export default function DepositDocumentComponent(props: IProps) { [onChange], ); + const onOpenModal = useCallback(async () => { + const refused_reason = document.document_history?.find((history) => history.document_status === "REFUSED")?.refused_reason; + if (!refused_reason) return; + setRefusedReason(refused_reason); + setIsModalOpen(true); + }, []); + + const closeModal = useCallback(() => { + setIsModalOpen(false); + }, []); + return (
@@ -59,8 +73,37 @@ export default function DepositDocumentComponent(props: IProps) { Demandé le: {document.created_at ? new Date(document.created_at).toLocaleDateString() : "_"} + {document.document_status === "REFUSED" && ( +
+ + Refusé le : {document.updated_at ? new Date(document.updated_at).toLocaleDateString() : "_"} + + + Document non-conforme{" : "} Voir le motif de refus + +
+ )}
+ +
+ + Votre document a été refusé pour la raison suivante : + +
+ + {refused_reason} + +
+
+
- Pour les notaires : + Pour les notaires et les colaborateurs :
-
+
Note du dossier diff --git a/src/front/Components/Layouts/Subscription/SubscriptionInvite/index.tsx b/src/front/Components/Layouts/Subscription/SubscriptionInvite/index.tsx index e8bcc73d..badeec04 100644 --- a/src/front/Components/Layouts/Subscription/SubscriptionInvite/index.tsx +++ b/src/front/Components/Layouts/Subscription/SubscriptionInvite/index.tsx @@ -8,7 +8,7 @@ import Form from "@Front/Components/DesignSystem/Form"; import Subscriptions from "@Front/Api/LeCoffreApi/Admin/Subscriptions/Subscriptions"; import { useCallback, useState } from "react"; import { TrashIcon } from "@heroicons/react/24/outline"; -import PlusIcon from "@Assets/Icons/plus.svg"; +// import PlusIcon from "@Assets/Icons/plus.svg"; import Module from "@Front/Config/Module"; type EmailLine = { @@ -108,11 +108,7 @@ export default function SubscriptionInvite() { ))} {isNaN(nbOfCollaborators) && (
-
From 13055e49f2acde45e5e2e3086f20d66d26ee9c5e Mon Sep 17 00:00:00 2001 From: Vins Date: Mon, 4 Nov 2024 10:45:13 +0100 Subject: [PATCH 3/5] Fixing description lenght --- .../Folder/FolderInformation/InformationSection/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx index 8a19d1be..75d9e95e 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx @@ -129,7 +129,7 @@ export default function InformationSection(props: IProps) { Note du dossier - + {folder?.description}
@@ -158,7 +158,7 @@ export default function InformationSection(props: IProps) { Note du dossier - + {folder?.description}
From cfe9601661c3e7a35815abb6ae078a397d39baff Mon Sep 17 00:00:00 2001 From: Vins Date: Thu, 7 Nov 2024 14:53:37 +0100 Subject: [PATCH 4/5] Other document to finish + Email on docuemnt sent by notary --- .../ContactBox/classes.module.scss | 7 +++ .../ClientDashboard/ContactBox/index.tsx | 2 +- .../DepositDocumentComponent/index.tsx | 3 +- .../Layouts/ClientDashboard/index.tsx | 46 ++++++++++++++++++- .../ClientView/ClientBox/classes.module.scss | 7 +++ .../ClientView/ClientBox/index.tsx | 2 +- .../Components/Layouts/MyAccount/index.tsx | 20 ++++++-- .../Components/Layouts/PageNotFound/index.tsx | 3 +- 8 files changed, 81 insertions(+), 9 deletions(-) diff --git a/src/front/Components/Layouts/ClientDashboard/ContactBox/classes.module.scss b/src/front/Components/Layouts/ClientDashboard/ContactBox/classes.module.scss index f6b53440..893f7cef 100644 --- a/src/front/Components/Layouts/ClientDashboard/ContactBox/classes.module.scss +++ b/src/front/Components/Layouts/ClientDashboard/ContactBox/classes.module.scss @@ -33,5 +33,12 @@ @media screen and (max-width: $screen-s) { display: none; } + + .text { + max-height: 60px; + overflow-y: auto; + white-space: normal; + word-break: break-all; + } } } diff --git a/src/front/Components/Layouts/ClientDashboard/ContactBox/index.tsx b/src/front/Components/Layouts/ClientDashboard/ContactBox/index.tsx index d3c806a1..fd679e57 100644 --- a/src/front/Components/Layouts/ClientDashboard/ContactBox/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/ContactBox/index.tsx @@ -93,7 +93,7 @@ export default function ContactBox(props: IProps) { Note dossier - + {note?.content ?? "-"} diff --git a/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/index.tsx b/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/index.tsx index 44c227f3..c0599f9c 100644 --- a/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/DepositDocumentComponent/index.tsx @@ -30,7 +30,8 @@ export default function DepositDocumentComponent(props: IProps) { const addFile = useCallback( (file: File) => { const formData = new FormData(); - formData.append("file", file, file.name); + const safeFileName = file.name.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); + formData.append("file", file, safeFileName); const query = JSON.stringify({ document: { uid: document.uid } }); formData.append("q", query); return Files.getInstance() diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index 69a36c32..e1a2ed36 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -3,7 +3,7 @@ import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/Customer/ import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography"; -import Customer, { Document } from "le-coffre-resources/dist/Customer"; +import Customer, { Document, DocumentType } from "le-coffre-resources/dist/Customer"; import React, { useCallback, useEffect, useMemo, useState } from "react"; import { DocumentNotary, type OfficeFolder as OfficeFolderNotary } from "le-coffre-resources/dist/Notary"; @@ -15,7 +15,7 @@ import Folders from "@Front/Api/LeCoffreApi/Customer/Folders/Folders"; import Tag, { ETagColor } from "@Front/Components/DesignSystem/Tag"; import DefaultCustomerDashboard from "@Front/Components/LayoutTemplates/DefaultCustomerDashboard"; -import { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; +import Button, { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; import DepositDocumentComponent from "./DepositDocumentComponent"; import Module from "@Front/Config/Module"; import Separator, { ESeperatorColor, ESeperatorDirection } from "@Front/Components/DesignSystem/Separator"; @@ -23,6 +23,7 @@ import NotificationBox from "@Front/Components/DesignSystem/NotificationBox"; import ContactBox from "./ContactBox"; import DocumentsNotary from "@Front/Api/LeCoffreApi/Customer/DocumentsNotary/DocumentsNotary"; import { EDocumentNotaryStatus } from "le-coffre-resources/dist/Notary/DocumentNotary"; +import DepositOtherDocument from "@Front/Components/DesignSystem/DepositOtherDocument"; type IProps = {}; @@ -34,6 +35,7 @@ export default function ClientDashboard(props: IProps) { const [customer, setCustomer] = useState(null); const [folder, setFolder] = useState(null); const [documentsNotary, setDocumentsNotary] = useState([]); + const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState(false); const fetchFolderAndCustomer = useCallback(async () => { let jwt: ICustomerJwtPayload | undefined; @@ -118,6 +120,34 @@ export default function ClientDashboard(props: IProps) { [documentsNotary], ); + const onCloseModalAddDocument = useCallback(() => { + setIsAddDocumentModalVisible(false); + fetchFolderAndCustomer(); + }, [fetchFolderAndCustomer]); + + const onOpenModalAddDocument = useCallback(() => { + setIsAddDocumentModalVisible(true); + }, []); + + const renderBox = useCallback(() => { + console.log(folder!.office!.uid); + + return ( + ({ + document_type: DocumentType.hydrate({ + name: "Autres documents", + office: folder!.office!, + }), + })} + /> + ); + }, [customer, folderUid, isAddDocumentModalVisible, onCloseModalAddDocument]); + return (
@@ -204,6 +234,18 @@ export default function ClientDashboard(props: IProps) { ))}
+ Documents supplémentaires (facultatif) + + Vous souhaitez envoyer d'autres documents à votre notaire ? + + + {isAddDocumentModalVisible && renderBox()}
); diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/classes.module.scss b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/classes.module.scss index 17c7b641..25f67f3c 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/classes.module.scss +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/classes.module.scss @@ -18,4 +18,11 @@ .delete-button { margin: auto; } + + .text { + max-height: 60px; + overflow-y: auto; + white-space: normal; + word-wrap: break-word; + } } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx index 44c86b1c..a99ad14d 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx @@ -98,7 +98,7 @@ export default function ClientBox(props: IProps) { Note client - + {customerNote?.content ?? "-"} diff --git a/src/front/Components/Layouts/MyAccount/index.tsx b/src/front/Components/Layouts/MyAccount/index.tsx index 13ef4111..7bbc65bc 100644 --- a/src/front/Components/Layouts/MyAccount/index.tsx +++ b/src/front/Components/Layouts/MyAccount/index.tsx @@ -34,7 +34,7 @@ export default function MyAccount() { }, []); return ( - +
@@ -47,7 +47,14 @@ export default function MyAccount() {
- + - + window.open("https://tally.so/r/mBGaNY") }} />
From 0add92ca3028105329d2e6c61a7562ae0102c345 Mon Sep 17 00:00:00 2001 From: Vins Date: Tue, 12 Nov 2024 10:20:11 +0100 Subject: [PATCH 5/5] Temp removed add other document --- .../Layouts/ClientDashboard/index.tsx | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index e1a2ed36..d3e53586 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -3,7 +3,7 @@ import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/Customer/ import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography"; -import Customer, { Document, DocumentType } from "le-coffre-resources/dist/Customer"; +import Customer, { Document } from "le-coffre-resources/dist/Customer"; import React, { useCallback, useEffect, useMemo, useState } from "react"; import { DocumentNotary, type OfficeFolder as OfficeFolderNotary } from "le-coffre-resources/dist/Notary"; @@ -15,7 +15,7 @@ import Folders from "@Front/Api/LeCoffreApi/Customer/Folders/Folders"; import Tag, { ETagColor } from "@Front/Components/DesignSystem/Tag"; import DefaultCustomerDashboard from "@Front/Components/LayoutTemplates/DefaultCustomerDashboard"; -import Button, { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; +import { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; import DepositDocumentComponent from "./DepositDocumentComponent"; import Module from "@Front/Config/Module"; import Separator, { ESeperatorColor, ESeperatorDirection } from "@Front/Components/DesignSystem/Separator"; @@ -23,7 +23,7 @@ import NotificationBox from "@Front/Components/DesignSystem/NotificationBox"; import ContactBox from "./ContactBox"; import DocumentsNotary from "@Front/Api/LeCoffreApi/Customer/DocumentsNotary/DocumentsNotary"; import { EDocumentNotaryStatus } from "le-coffre-resources/dist/Notary/DocumentNotary"; -import DepositOtherDocument from "@Front/Components/DesignSystem/DepositOtherDocument"; +// import DepositOtherDocument from "@Front/Components/DesignSystem/DepositOtherDocument"; type IProps = {}; @@ -35,7 +35,7 @@ export default function ClientDashboard(props: IProps) { const [customer, setCustomer] = useState(null); const [folder, setFolder] = useState(null); const [documentsNotary, setDocumentsNotary] = useState([]); - const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState(false); + // const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState(false); const fetchFolderAndCustomer = useCallback(async () => { let jwt: ICustomerJwtPayload | undefined; @@ -120,33 +120,33 @@ export default function ClientDashboard(props: IProps) { [documentsNotary], ); - const onCloseModalAddDocument = useCallback(() => { - setIsAddDocumentModalVisible(false); - fetchFolderAndCustomer(); - }, [fetchFolderAndCustomer]); + // const onCloseModalAddDocument = useCallback(() => { + // setIsAddDocumentModalVisible(false); + // fetchFolderAndCustomer(); + // }, [fetchFolderAndCustomer]); - const onOpenModalAddDocument = useCallback(() => { - setIsAddDocumentModalVisible(true); - }, []); + // const onOpenModalAddDocument = useCallback(() => { + // setIsAddDocumentModalVisible(true); + // }, []); - const renderBox = useCallback(() => { - console.log(folder!.office!.uid); + // const renderBox = useCallback(() => { + // console.log(folder!.office!.uid); - return ( - ({ - document_type: DocumentType.hydrate({ - name: "Autres documents", - office: folder!.office!, - }), - })} - /> - ); - }, [customer, folderUid, isAddDocumentModalVisible, onCloseModalAddDocument]); + // return ( + // ({ + // document_type: DocumentType.hydrate({ + // name: "Autres documents", + // office: folder!.office!, + // }), + // })} + // /> + // ); + // }, [customer, folderUid, isAddDocumentModalVisible, onCloseModalAddDocument]); return ( @@ -238,14 +238,14 @@ export default function ClientDashboard(props: IProps) { Vous souhaitez envoyer d'autres documents à votre notaire ? - - {isAddDocumentModalVisible && renderBox()} + {isAddDocumentModalVisible && renderBox()} */}
);