Other document to finish + Email on docuemnt sent by notary

This commit is contained in:
Vins 2024-11-07 14:53:37 +01:00
parent 13055e49f2
commit cfe9601661
8 changed files with 81 additions and 9 deletions

View File

@ -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;
}
}
}

View File

@ -93,7 +93,7 @@ export default function ContactBox(props: IProps) {
<Typography typo={ETypo.TEXT_MD_REGULAR} color={ETypoColor.COLOR_NEUTRAL_700}>
Note dossier
</Typography>
<Typography typo={ETypo.TEXT_LG_REGULAR} color={ETypoColor.COLOR_NEUTRAL_950}>
<Typography typo={ETypo.TEXT_LG_REGULAR} type="span" color={ETypoColor.COLOR_NEUTRAL_950} className={classes["text"]}>
{note?.content ?? "-"}
</Typography>
</div>

View File

@ -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()

View File

@ -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<Customer | null>(null);
const [folder, setFolder] = useState<OfficeFolderNotary | null>(null);
const [documentsNotary, setDocumentsNotary] = useState<DocumentNotary[]>([]);
const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState<boolean>(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 (
<DepositOtherDocument
folder_uid={folderUid!}
customer_uid={customer!.uid!}
open={isAddDocumentModalVisible}
onClose={onCloseModalAddDocument}
document={Document.hydrate<Document>({
document_type: DocumentType.hydrate<DocumentType>({
name: "Autres documents",
office: folder!.office!,
}),
})}
/>
);
}, [customer, folderUid, isAddDocumentModalVisible, onCloseModalAddDocument]);
return (
<DefaultCustomerDashboard>
<div className={classes["root"]}>
@ -204,6 +234,18 @@ export default function ClientDashboard(props: IProps) {
))}
</div>
</div>
<Typography typo={ETypo.TITLE_H3}>Documents supplémentaires (facultatif)</Typography>
<Typography typo={ETypo.TEXT_MD_REGULAR} className={classes["text"]}>
Vous souhaitez envoyer d'autres documents à votre notaire ?
</Typography>
<Button
variant={EButtonVariant.PRIMARY}
styletype={EButtonstyletype.OUTLINED}
className={classes["button"]}
onClick={onOpenModalAddDocument}>
Ajouter d'autres documents
</Button>
{isAddDocumentModalVisible && renderBox()}
</div>
</DefaultCustomerDashboard>
);

View File

@ -18,4 +18,11 @@
.delete-button {
margin: auto;
}
.text {
max-height: 60px;
overflow-y: auto;
white-space: normal;
word-wrap: break-word;
}
}

View File

@ -98,7 +98,7 @@ export default function ClientBox(props: IProps) {
<Typography typo={ETypo.TEXT_MD_REGULAR} color={ETypoColor.COLOR_NEUTRAL_700}>
Note client
</Typography>
<Typography typo={ETypo.TEXT_LG_REGULAR} color={ETypoColor.COLOR_NEUTRAL_950}>
<Typography typo={ETypo.TEXT_LG_REGULAR} type="span" color={ETypoColor.COLOR_NEUTRAL_950} className={classes["text"]}>
{customerNote?.content ?? "-"}
</Typography>
</div>

View File

@ -34,7 +34,7 @@ export default function MyAccount() {
}, []);
return (
<DefaultDoubleSidePage title={"Mon Compte"} image={backgroundImage}>
<DefaultDoubleSidePage title={"Mon Compte"} image={backgroundImage} showHeader={true}>
<div className={classes["root"]}>
<div className={classes["title-container"]}>
<Typography typo={ETypo.TITLE_H1} color={ETypoColor.TEXT_PRIMARY}>
@ -47,7 +47,14 @@ export default function MyAccount() {
<Form className={classes["form"]}>
<TextField name="name" label="Nom" placeholder="Nom" defaultValue={user?.contact?.last_name} readonly canCopy />
<TextField name="surname" label="Prénom" placeholder="Prénom" defaultValue={user?.contact?.first_name} readonly canCopy />
<TextField
name="surname"
label="Prénom"
placeholder="Prénom"
defaultValue={user?.contact?.first_name}
readonly
canCopy
/>
<TextField name="email" label="E-mail" placeholder="E-mail" defaultValue={user?.contact?.email} readonly canCopy />
<TextField
name="phone"
@ -72,7 +79,14 @@ export default function MyAccount() {
readonly
canCopy
/>
<TextField name="crpcen" label="CRPCEN" placeholder="CRPCEN" defaultValue={user?.office_membership?.crpcen} readonly canCopy />
<TextField
name="crpcen"
label="CRPCEN"
placeholder="CRPCEN"
defaultValue={user?.office_membership?.crpcen}
readonly
canCopy
/>
<TextField
name="cp_address"
label="Adresse"

View File

@ -44,7 +44,8 @@ export default class PageNotFound extends BasePage {
<HelpBox
title="Vous avez des questions ?"
description="Notre équipe de support est là pour vous aider."
button={{ text: "Contactez le support" }}
//Button with onclick that redirect to a custom url
button={{ text: "Contactez le support", onClick: () => window.open("https://tally.so/r/mBGaNY") }}
/>
</div>
</DefaultDoubleSidePage>