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 03ad6bc8..fd679e57 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()}
@@ -95,7 +93,7 @@ export default function ContactBox(props: IProps) { Note dossier - + {note?.content ?? "-"} @@ -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..c0599f9c 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) ?? []; @@ -27,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() @@ -50,6 +54,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 +74,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} + +
+
+ (null); const [folder, setFolder] = useState(null); const [documentsNotary, setDocumentsNotary] = useState([]); + // const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState(false); const fetchFolderAndCustomer = useCallback(async () => { let jwt: ICustomerJwtPayload | undefined; @@ -120,6 +122,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 (
@@ -206,6 +236,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/Folder/FolderInformation/InformationSection/classes.module.scss b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/classes.module.scss index bf486242..6eea2a8e 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/classes.module.scss +++ b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/classes.module.scss @@ -1,6 +1,7 @@ @import "@Themes/constants.scss"; $mobile-breakpoint: 600px; +$tablet-breakpoint: 1024px; .root { display: flex; @@ -21,7 +22,6 @@ $mobile-breakpoint: 600px; justify-content: space-between; align-items: center; gap: var(--spacing-lg, 24px); - } .open-date { @@ -92,11 +92,11 @@ $mobile-breakpoint: 600px; word-wrap: break-word; } - &.desktop { - @media screen and (max-width: $screen-s) { - display: none; - } - } + // &.desktop { + // @media screen and (max-width: $screen-s) { + // display: none; + // } + // } &.ipad { display: none; @@ -104,17 +104,17 @@ $mobile-breakpoint: 600px; display: block; } - @media screen and (max-width: $mobile-breakpoint) { + @media screen and (max-width: $tablet-breakpoint) { display: none; } } - &.mobile { - display: none; - @media screen and (max-width: $mobile-breakpoint) { - display: block; - } - } + // &.mobile { + // display: none; + // @media screen and (max-width: $mobile-breakpoint) { + // display: block; + // } + // } } .separator { diff --git a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx index eef289b6..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} @@ -154,11 +154,11 @@ export default function InformationSection(props: IProps) { {!isArchived && } variant={EIconButtonVariant.ERROR} />} -
+
Note du dossier - + {folder?.description}
diff --git a/src/front/Components/Layouts/Login/StepEmail/index.tsx b/src/front/Components/Layouts/Login/StepEmail/index.tsx index d03d48b6..fc04fb80 100644 --- a/src/front/Components/Layouts/Login/StepEmail/index.tsx +++ b/src/front/Components/Layouts/Login/StepEmail/index.tsx @@ -83,7 +83,7 @@ export default function StepEmail(props: IProps) {
- Pour les notaires : + Pour les notaires et les colaborateurs :