diff --git a/src/front/Assets/images/background_refonte_reverse.svg b/src/front/Assets/images/background_refonte_reverse.svg new file mode 100644 index 00000000..1d862495 --- /dev/null +++ b/src/front/Assets/images/background_refonte_reverse.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/front/Components/DesignSystem/Alert/classes.module.scss b/src/front/Components/DesignSystem/Alert/classes.module.scss index b230faf6..96e78746 100644 --- a/src/front/Components/DesignSystem/Alert/classes.module.scss +++ b/src/front/Components/DesignSystem/Alert/classes.module.scss @@ -83,4 +83,8 @@ stroke: var(--alerts-badge-contrast-neutral); } } + + &.fullwidth { + width: 100%; + } } diff --git a/src/front/Components/DesignSystem/Alert/index.tsx b/src/front/Components/DesignSystem/Alert/index.tsx index 4605961f..a00022bc 100644 --- a/src/front/Components/DesignSystem/Alert/index.tsx +++ b/src/front/Components/DesignSystem/Alert/index.tsx @@ -16,6 +16,7 @@ type IProps = { firstButton?: IButtonProps; secondButton?: IButtonProps; closeButton?: boolean; + fullWidth?: boolean; }; export enum EAlertVariant { @@ -36,12 +37,12 @@ const variantButtonMap: Record = { export default function Alert(props: IProps) { const { isOpen, close } = useOpenable({ defaultOpen: true }); - const { variant = EAlertVariant.INFO, title, description, firstButton, secondButton, closeButton, icon } = props; + const { variant = EAlertVariant.INFO, title, description, firstButton, secondButton, closeButton, icon, fullWidth } = props; if (!isOpen) return null; return ( -
+
{icon ?? }
diff --git a/src/front/Components/DesignSystem/EmptyAlert/classes.module.scss b/src/front/Components/DesignSystem/EmptyAlert/classes.module.scss index d356ef14..0b036bd3 100644 --- a/src/front/Components/DesignSystem/EmptyAlert/classes.module.scss +++ b/src/front/Components/DesignSystem/EmptyAlert/classes.module.scss @@ -13,6 +13,14 @@ text-align: center; + .text { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: var(--spacing-md, 16px); + } + svg { width: 32px; stroke: var(--primary-weak-contrast); diff --git a/src/front/Components/DesignSystem/EmptyAlert/index.tsx b/src/front/Components/DesignSystem/EmptyAlert/index.tsx index 878db597..17b3e0c1 100644 --- a/src/front/Components/DesignSystem/EmptyAlert/index.tsx +++ b/src/front/Components/DesignSystem/EmptyAlert/index.tsx @@ -16,12 +16,14 @@ export default function EmptyAlert(props: IProps) { return (
{icon} - - {title} - - - {description} - +
+ + {title} + + + {description} + +
{footer}
); diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/classes.module.scss b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/classes.module.scss index 9b23977b..c14e500d 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/classes.module.scss +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/classes.module.scss @@ -11,6 +11,7 @@ } .root { + position: relative; .content { display: flex; overflow: hidden; @@ -114,4 +115,19 @@ } } } + + .background-image-container { + position: fixed; + top: 0; + right: 0; + @media (max-width: $screen-l) { + display: none; + } + + .background-image { + width: 100%; + height: 100%; + object-fit: cover; + } + } } diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx index e4730df6..da2d01dc 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx @@ -1,20 +1,20 @@ import ChevronIcon from "@Assets/Icons/chevron.svg"; import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/Notary/Folders/Folders"; import Button, { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; -import FolderListContainer from "@Front/Components/DesignSystem/FolderListContainer"; import FolderArchivedListContainer from "@Front/Components/DesignSystem/FolderArchivedListContainer"; +import FolderListContainer from "@Front/Components/DesignSystem/FolderListContainer"; import Header from "@Front/Components/DesignSystem/Header"; import Version from "@Front/Components/DesignSystem/Version"; import BackArrow from "@Front/Components/Elements/BackArrow"; import WindowStore from "@Front/Stores/WindowStore"; +import { ChevronLeftIcon } from "@heroicons/react/24/outline"; import classNames from "classnames"; import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus"; import { OfficeFolder } from "le-coffre-resources/dist/Notary"; -import Image from "next/image"; +import Image, { StaticImageData } from "next/image"; import React, { ReactNode } from "react"; import classes from "./classes.module.scss"; -import { ChevronLeftIcon } from "@heroicons/react/24/outline"; type IProps = { title: string; @@ -24,6 +24,7 @@ type IProps = { hasBackArrow: boolean; backArrowUrl?: string; mobileBackText?: string; + image?: StaticImageData; }; type IState = { folders: OfficeFolder[] | null; @@ -96,6 +97,11 @@ export default class DefaultNotaryDashboard extends React.Component + {this.props.image && ( +
+ {"right +
+ )}
diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/DeleteCustomerModal/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/DeleteCustomerModal/index.tsx index 559ba8ca..bdf407d9 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/DeleteCustomerModal/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/DeleteCustomerModal/index.tsx @@ -7,21 +7,15 @@ type IProps = { isOpen: boolean; onClose?: () => void; - onDeleteSuccess: (uid: string) => void; + onDelete: (customerUid: string) => void; }; export default function DeleteCustomerModal(props: IProps) { - const { isOpen, onClose, customerUid, onDeleteSuccess } = props; + const { isOpen, onClose, onDelete } = props; - const onDelete = useCallback( - () => onDeleteSuccess(customerUid), - // Documents.getInstance() - // .delete(documentUid) - // .then(() => onDeleteSuccess(documentUid)) - // .then(onClose) - // .catch((error) => console.warn(error)), - [customerUid, onDeleteSuccess], - ); + const handleDelete = useCallback(() => { + onDelete(props.customerUid); + }, [onDelete, props.customerUid]); return ( + secondButton={{ children: "Supprimer le client", onClick: handleDelete }}> Cette action retirera le client de ce dossier. Vous ne pourrez plus récupérer les informations associées à ce client dans ce dossier une fois supprimées. 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 2aebed14..5e75f6fa 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 @@ -9,10 +9,14 @@ background: var(--primary-weak-higlight, #e5eefa); min-width: 300px; - .header{ + .header { display: flex; justify-content: space-between; align-items: center; width: 100%; } + + .delete-button { + margin: auto; + } } 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 5de56af7..2a54b013 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx @@ -1,4 +1,4 @@ -import Button, { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; +import Button, { EButtonSize, EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; import IconButton, { EIconButtonVariant } from "@Front/Components/DesignSystem/IconButton"; import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography"; import useOpenable from "@Front/Hooks/useOpenable"; @@ -8,33 +8,53 @@ import { ICustomer } from ".."; import { AnchorStatus } from "../.."; import classes from "./classes.module.scss"; import DeleteCustomerModal from "./DeleteCustomerModal"; +import Link from "next/link"; +import Module from "@Front/Config/Module"; +import { useCallback } from "react"; +import { Note } from "le-coffre-resources/dist/Customer"; type IProps = { customer: ICustomer; anchorStatus: AnchorStatus; + folderUid: string | undefined; + customerNote: Note | null; + onDelete: (customerUid: string) => void; }; export default function ClientBox(props: IProps) { - const { customer, anchorStatus } = props; + const { customer, anchorStatus, folderUid, customerNote } = props; const { isOpen, open, close } = useOpenable(); + const handleDelete = useCallback( + (customerUid: string) => { + props.onDelete(customerUid); + }, + [props], + ); + return (
- {customer.contact?.last_name} + {customer.contact?.first_name} {customer.contact?.last_name} {anchorStatus === AnchorStatus.NOT_ANCHORED && ( - } /> + + } /> + )}
- + Numéro de téléphone - - {customer.contact?.phone_number} + + {customer.contact?.cell_phone_number ?? customer.contact?.phone_number ?? "_"}
@@ -42,7 +62,7 @@ export default function ClientBox(props: IProps) { E-mail - {customer.contact?.email} + {customer.contact?.email ?? "_"}
@@ -50,7 +70,7 @@ export default function ClientBox(props: IProps) { Note client - {customer.notes?.[0]?.content ?? "_"} + {customerNote?.content ?? "-"}
@@ -58,13 +78,14 @@ export default function ClientBox(props: IProps) { <> - {}} /> + )}
diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/DocumentTables/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/DocumentTables/index.tsx index 4d6cbb20..d8dd6ca1 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/DocumentTables/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/DocumentTables/index.tsx @@ -5,18 +5,20 @@ import Table from "@Front/Components/DesignSystem/Table"; import { IHead, IRowProps } from "@Front/Components/DesignSystem/Table/MuiTable"; import Tag, { ETagColor, ETagVariant } from "@Front/Components/DesignSystem/Tag"; import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography"; +import Module from "@Front/Config/Module"; import useOpenable from "@Front/Hooks/useOpenable"; import { ArrowDownTrayIcon, EyeIcon, TrashIcon } from "@heroicons/react/24/outline"; -import { Document, File } from "le-coffre-resources/dist/Customer"; +import { Document } from "le-coffre-resources/dist/Customer"; import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; +import Link from "next/link"; import { useCallback, useEffect, useMemo, useState } from "react"; import classes from "./classes.module.scss"; import DeleteAskedDocumentModal from "./DeleteAskedDocumentModal"; -import FilePreviewModal from "./FilePreviewModal"; type IProps = { documents: Document[]; + folderUid: string; }; const header: readonly IHead[] = [ @@ -46,11 +48,9 @@ const tradDocumentStatus: Record = { }; export default function DocumentTables(props: IProps) { - const { documents: documentsProps } = props; + const { documents: documentsProps, folderUid } = props; const [documents, setDocuments] = useState(documentsProps); const [documentUid, setDocumentUid] = useState(null); - const previewModal = useOpenable(); - const [file, setFile] = useState<{ file: File; blob: Blob } | null>(null); const deleteAskedOocumentModal = useOpenable(); @@ -67,19 +67,6 @@ export default function DocumentTables(props: IProps) { [deleteAskedOocumentModal], ); - const onPreview = useCallback( - (document: Document) => { - const file = document.files?.[0]; - if (!file || !file?.uid) return; - return Files.getInstance() - .download(file.uid) - .then((blob) => setFile({ file, blob })) - .then(() => previewModal.open()) - .catch((e) => console.warn(e)); - }, - [previewModal], - ); - const onDownload = useCallback((doc: Document) => { const file = doc.files?.[0]; if (!file || !file?.uid) return; @@ -136,11 +123,19 @@ export default function DocumentTables(props: IProps) { /> ), created_at: document.created_at, - actions: onPreview(document)} icon={} />, + actions: ( + + } /> + + ), }; }) .filter((document) => document !== null) as IRowProps[], - [documents, onPreview], + [documents, folderUid], ); const validatedDocuments: IRowProps[] = useMemo( @@ -161,14 +156,20 @@ export default function DocumentTables(props: IProps) { created_at: document.created_at, actions: (
- onPreview(document)} icon={} /> + + } /> + onDownload(document)} icon={} />
), }; }) .filter((document) => document !== null) as IRowProps[], - [documents, onDownload, onPreview], + [documents, folderUid, onDownload], ); const refusedDocuments: IRowProps[] = useMemo( @@ -208,7 +209,7 @@ export default function DocumentTables(props: IProps) {
- + {askedDocuments.length > 0 &&
} {toValidateDocuments.length > 0 &&
} {validatedDocuments.length > 0 &&
} {refusedDocuments.length > 0 &&
} @@ -220,14 +221,6 @@ export default function DocumentTables(props: IProps) { documentUid={documentUid} /> )} - {file && ( - - )} ); } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/classes.module.scss b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/classes.module.scss index b55462e7..673d2297 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/classes.module.scss +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/classes.module.scss @@ -10,6 +10,10 @@ gap: var(--spacing-md, 16px); justify-content: space-between; align-items: center; + + .tabs { + width: calc(100% - 210px); + } } .content { diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/index.tsx index 1b3fc3bd..cce182f9 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/index.tsx @@ -2,7 +2,7 @@ import Tabs from "@Front/Components/Elements/Tabs"; import Customer from "le-coffre-resources/dist/Customer"; import { OfficeFolder } from "le-coffre-resources/dist/Notary"; -import { useMemo, useState } from "react"; +import { useCallback, useMemo, useState } from "react"; import { AnchorStatus } from ".."; import classes from "./classes.module.scss"; @@ -13,6 +13,7 @@ import Module from "@Front/Config/Module"; import Link from "next/link"; import NoDocument from "./NoDocument"; import DocumentTables from "./DocumentTables"; +import Folders from "@Front/Api/LeCoffreApi/Notary/Folders/Folders"; type IProps = { folder: OfficeFolder; @@ -47,10 +48,26 @@ export default function ClientView(props: IProps) { const doesCustomerHaveDocument = useMemo(() => customer.documents && customer.documents.length > 0, [customer]); + const handleClientDelete = useCallback( + (customerUid: string) => { + if (!folder.uid) return; + Folders.getInstance().put( + folder.uid, + OfficeFolder.hydrate({ + ...folder, + customers: folder.customers?.filter((customer) => customer.uid !== customerUid), + }), + ); + window.location.reload(); + }, + [folder], + ); + return (
- {tabs && tabs={tabs} onSelect={setCustomer} />} +
{tabs && tabs={tabs} onSelect={setCustomer} />}
+ {anchorStatus === AnchorStatus.NOT_ANCHORED && (
- + value.customer?.uid === customer.uid) ?? null} + /> {anchorStatus === AnchorStatus.NOT_ANCHORED && ( )}
- {doesCustomerHaveDocument ? : } + {doesCustomerHaveDocument ? ( + + ) : ( + + )}
); 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 5abf5a01..dd4839c0 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/classes.module.scss +++ b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/classes.module.scss @@ -5,7 +5,7 @@ gap: var(--spacing-lg, 40px); .info-box1 { display: flex; - width: 648px; + width: 100%; flex-direction: column; gap: var(--spacing-sm, 8px); @@ -19,7 +19,11 @@ display: flex; flex-direction: column; gap: var(--spacing-lg, 24px); + width: 100%; + max-width: 400px; + .progress-container { + width: 100%; display: flex; justify-content: space-between; align-items: center; @@ -29,6 +33,13 @@ gap: var(--spacing-md, 8px); } } + + .description-container { + .text { + max-height: 60px; + overflow-y: auto; + } + } } .separator { diff --git a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx index 925a1b3f..39a6e2c8 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx @@ -76,11 +76,13 @@ export default function InformationSection(props: IProps) { )} -
+
- Notre dossier + Note du dossier + + + {folder?.description} - Travaux de rénovation en cours.
diff --git a/src/front/Components/Layouts/Folder/FolderInformation/NoClientView/AddClientSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/NoClientView/AddClientSection/index.tsx index 3d9f7da1..09421703 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/NoClientView/AddClientSection/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/NoClientView/AddClientSection/index.tsx @@ -1,4 +1,4 @@ -import Button, { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; +import Button, { EButtonSize, EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; import EmptyAlert from "@Front/Components/DesignSystem/EmptyAlert"; import Module from "@Front/Config/Module"; import { UserPlusIcon } from "@heroicons/react/24/outline"; @@ -24,7 +24,7 @@ export default function AddClientSection(props: IProps) { description="Pour pouvoir faire une demande de document, vous devez d'abord ajouter un ou plusieurs clients à ce dossier. Cette étape est essentielle pour assurer le suivi et la gestion des documents." footer={ - diff --git a/src/front/Components/Layouts/Folder/FolderInformation/NoClientView/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/NoClientView/index.tsx index 3273eeb6..3eb99a8d 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/NoClientView/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/NoClientView/index.tsx @@ -1,4 +1,4 @@ -import Button, { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; +import Button, { EButtonSize, EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; import { TrashIcon } from "@heroicons/react/24/outline"; import { OfficeFolder } from "le-coffre-resources/dist/Notary"; import { useMemo } from "react"; @@ -30,7 +30,8 @@ export default function NoClientView(props: IProps) { variant={EButtonVariant.ERROR} styletype={EButtonstyletype.TEXT} rightIcon={} - onClick={deleteFolderModal.open}> + onClick={deleteFolderModal.open} + size={EButtonSize.SM}> Supprimer le dossier diff --git a/src/front/Components/Layouts/Folder/FolderInformation/elements/AnchoringAlertInfo/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/elements/AnchoringAlertInfo/index.tsx index b8d243ed..bbdf1378 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/elements/AnchoringAlertInfo/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/elements/AnchoringAlertInfo/index.tsx @@ -19,6 +19,7 @@ export default function AnchoringAlertInfo(props: IProps) { onClick: onAnchor, }} variant={EAlertVariant.INFO} + fullWidth /> ); } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/elements/AnchoringAlertSuccess/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/elements/AnchoringAlertSuccess/index.tsx index 3cef33fb..0c5ae96f 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/elements/AnchoringAlertSuccess/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/elements/AnchoringAlertSuccess/index.tsx @@ -30,6 +30,7 @@ export default function AnchoringAlertSuccess(props: IProps) { } variant={EAlertVariant.SUCCESS} icon={} + fullWidth /> ); } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/elements/ArchiveAlertWarning/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/elements/ArchiveAlertWarning/index.tsx new file mode 100644 index 00000000..89828c08 --- /dev/null +++ b/src/front/Components/Layouts/Folder/FolderInformation/elements/ArchiveAlertWarning/index.tsx @@ -0,0 +1,48 @@ +import Folders from "@Front/Api/LeCoffreApi/Notary/Folders/Folders"; +import Alert, { EAlertVariant } from "@Front/Components/DesignSystem/Alert"; +import { EButtonstyletype } from "@Front/Components/DesignSystem/Button"; +import Module from "@Front/Config/Module"; +import { ArchiveBoxArrowDownIcon, ArchiveBoxIcon, ArrowDownOnSquareIcon } from "@heroicons/react/24/outline"; +import { useRouter } from "next/router"; +import { useCallback } from "react"; + +type IProps = { + onDownloadAnchoringProof: () => void; + folderUid: string; +}; + +export default function ArchiveAlertWarning(props: IProps) { + const { onDownloadAnchoringProof, folderUid } = props; + + const router = useRouter(); + + const restoreArchive = useCallback(() => { + Folders.getInstance() + .restore(folderUid) + .then(() => router.push(Module.getInstance().get().modules.pages.Folder.props.path)) + .catch((e) => { + console.warn(e); + }); + }, [folderUid, router]); + + return ( + , + onClick: onDownloadAnchoringProof, + }} + secondButton={{ + children: "Restaurer le dossier", + onClick: restoreArchive, + rightIcon: , + }} + variant={EAlertVariant.WARNING} + icon={} + fullWidth + /> + ); +} diff --git a/src/front/Components/Layouts/Folder/FolderInformation/elements/ArchiveModal/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/elements/ArchiveModal/index.tsx index 441b71b3..177ddf8e 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/elements/ArchiveModal/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/elements/ArchiveModal/index.tsx @@ -18,7 +18,6 @@ export default function ArchiveModal(props: IProps) { const router = useRouter(); const archive = useCallback(() => { - if (!folderUid) return; const description = (document.querySelector("textarea[name='archived_description']") as HTMLTextAreaElement).value ?? ""; Folders.getInstance() diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index c9770a16..2f1b37a0 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -2,6 +2,7 @@ import Folders from "@Front/Api/LeCoffreApi/Notary/Folders/Folders"; import OfficeFolderAnchors from "@Front/Api/LeCoffreApi/Notary/OfficeFolderAnchors/OfficeFolderAnchors"; import Loader from "@Front/Components/DesignSystem/Loader"; import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; +import useOpenable from "@Front/Hooks/useOpenable"; import { OfficeFolder } from "le-coffre-resources/dist/Notary"; import { EDocumentStatus } from "le-coffre-resources/dist/Notary/Document"; import { useParams } from "next/navigation"; @@ -9,15 +10,15 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import classes from "./classes.module.scss"; import ClientView from "./ClientView"; -import InformationSection from "./InformationSection"; -import NoClientView from "./NoClientView"; import AnchoringAlertInfo from "./elements/AnchoringAlertInfo"; -import AnchoringModal from "./elements/AnchoringModal"; -import useOpenable from "@Front/Hooks/useOpenable"; import AnchoringAlertSuccess from "./elements/AnchoringAlertSuccess"; +import AnchoringModal from "./elements/AnchoringModal"; +import ArchiveAlertWarning from "./elements/ArchiveAlertWarning"; +import ArchiveModal from "./elements/ArchiveModal"; import DownloadAnchoringProofModal from "./elements/DownloadAnchoringProofModal"; import RequireAnchoringModal from "./elements/RequireAnchoringModal"; -import ArchiveModal from "./elements/ArchiveModal"; +import InformationSection from "./InformationSection"; +import NoClientView from "./NoClientView"; export enum AnchorStatus { "VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN", @@ -138,13 +139,16 @@ export default function FolderInformation(props: IProps) { {progress === 100 && anchorStatus === AnchorStatus.NOT_ANCHORED && ( )} - {anchorStatus === AnchorStatus.VERIFIED_ON_CHAIN && ( + {!isArchived && anchorStatus === AnchorStatus.VERIFIED_ON_CHAIN && ( )} + {isArchived && folderUid && ( + + )} {folder && !doesFolderHaveClient && } {folder && doesFolderHaveClient && } {folderUid && anchorStatus === AnchorStatus.NOT_ANCHORED && ( diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 2fcf31db..2f6fe8cf 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -105,9 +105,11 @@ class ViewDocumentsClass extends BasePage { )}
-
- Veuillez valider le document afin de pouvoir le télécharger. -
+ {this.state.document?.document_status === EDocumentStatus.DEPOSITED && ( +
+ Veuillez valider le document afin de pouvoir le télécharger. +
+ )} {/* {this.state.document?.document_type?.name === "Document d'identité" && (
diff --git a/src/front/Components/Layouts/Folder/index.tsx b/src/front/Components/Layouts/Folder/index.tsx index 844893de..d9f7b1d9 100644 --- a/src/front/Components/Layouts/Folder/index.tsx +++ b/src/front/Components/Layouts/Folder/index.tsx @@ -1,34 +1,64 @@ +import backgroundImage from "@Assets/images/background_refonte_reverse.svg"; import LogoIcon from "@Assets/logo_small_blue.svg"; -import Button, { EButtonVariant, EButtonstyletype } from "@Front/Components/DesignSystem/Button"; +import Users from "@Front/Api/LeCoffreApi/Notary/Users/Users"; +import Button, { EButtonSize, EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button"; import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography"; import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; +import Module from "@Front/Config/Module"; +import JwtService from "@Front/Services/JwtService/JwtService"; import { DocumentIcon } from "@heroicons/react/24/outline"; -import { OfficeFolder } from "le-coffre-resources/dist/Notary"; -import { useCallback, useState } from "react"; +import User, { OfficeFolder } from "le-coffre-resources/dist/Notary"; import Image from "next/image"; +import Link from "next/link"; +import { useCallback, useEffect, useState } from "react"; import classes from "./classes.module.scss"; -import Link from "next/link"; -import Module from "@Front/Config/Module"; export default function Folder() { const [_folder, setFolder] = useState(null); const [_isArchivedModalOpen, _setIsArchivedModalOpen] = useState(true); + const [activeUser, setActiveUser] = useState(); const onSelectedFolder = useCallback((folder: OfficeFolder): void => { setFolder(folder); }, []); + useEffect(() => { + const decodedJwt = JwtService.getInstance().decodeJwt(); + if (!decodedJwt) return; + Users.getInstance() + .getByUid(decodedJwt.userId, { + q: { + contact: true, + }, + }) + .then((user) => { + setActiveUser(user); + }); + }, []); + return ( - +
- - Bonjour John, bienvenue sur LeCoffre.io - + {activeUser && activeUser.contact && ( + + Bonjour {activeUser.contact.first_name}, bienvenue sur LeCoffre.io + + )} + {!activeUser || + (!activeUser.contact && ( + + Bonjour, bienvenue sur LeCoffre.io + + ))} Commencez par créer votre{" "} @@ -56,7 +86,7 @@ export default function Folder() {
Besoin d'aide ? Consultez nos guides pour bien démarrer. -
@@ -65,7 +95,7 @@ export default function Folder() {
Vous avez des questions ? Notre équipe de support est là pour vous aider. -
diff --git a/src/front/Config/Module/development.json b/src/front/Config/Module/development.json index 1668208d..20bc04c8 100644 --- a/src/front/Config/Module/development.json +++ b/src/front/Config/Module/development.json @@ -66,6 +66,13 @@ "labelKey": "ask_documents" } }, + "ViewDocuments": { + "enabled": true, + "props": { + "path": "/folders/[folderUid]/documents/[documentUid]", + "labelKey": "ask_documents" + } + }, "EditDescription": { "enabled": true, "props": { diff --git a/src/front/Config/Module/preprod.json b/src/front/Config/Module/preprod.json index 1668208d..20bc04c8 100644 --- a/src/front/Config/Module/preprod.json +++ b/src/front/Config/Module/preprod.json @@ -66,6 +66,13 @@ "labelKey": "ask_documents" } }, + "ViewDocuments": { + "enabled": true, + "props": { + "path": "/folders/[folderUid]/documents/[documentUid]", + "labelKey": "ask_documents" + } + }, "EditDescription": { "enabled": true, "props": { diff --git a/src/front/Config/Module/production.json b/src/front/Config/Module/production.json index 1668208d..20bc04c8 100644 --- a/src/front/Config/Module/production.json +++ b/src/front/Config/Module/production.json @@ -66,6 +66,13 @@ "labelKey": "ask_documents" } }, + "ViewDocuments": { + "enabled": true, + "props": { + "path": "/folders/[folderUid]/documents/[documentUid]", + "labelKey": "ask_documents" + } + }, "EditDescription": { "enabled": true, "props": { diff --git a/src/front/Config/Module/staging.json b/src/front/Config/Module/staging.json index 1668208d..20bc04c8 100644 --- a/src/front/Config/Module/staging.json +++ b/src/front/Config/Module/staging.json @@ -66,6 +66,13 @@ "labelKey": "ask_documents" } }, + "ViewDocuments": { + "enabled": true, + "props": { + "path": "/folders/[folderUid]/documents/[documentUid]", + "labelKey": "ask_documents" + } + }, "EditDescription": { "enabled": true, "props": {