🔨 Fixing build
This commit is contained in:
parent
4e4fc97ae5
commit
2bdc8a7e05
@ -13,9 +13,9 @@ import classes from "./classes.module.scss";
|
||||
type IProps = {
|
||||
document: {
|
||||
uid?: Document["uid"];
|
||||
document_type: Document["document_type"];
|
||||
document_type?: Document["document_type"];
|
||||
document_status: Document["document_status"];
|
||||
folder: Document["folder"];
|
||||
folder?: Document["folder"];
|
||||
files?: Document["files"];
|
||||
};
|
||||
openDeletionModal?: (uid: Document["uid"]) => void;
|
||||
|
@ -10,9 +10,9 @@ type IProps = {
|
||||
documents:
|
||||
| {
|
||||
uid?: Document["uid"];
|
||||
document_type: Document["document_type"];
|
||||
document_type?: Document["document_type"];
|
||||
document_status: Document["document_status"];
|
||||
folder: Document["folder"];
|
||||
folder?: Document["folder"];
|
||||
}[]
|
||||
| null;
|
||||
openDeletionModal: (uid: Document["uid"]) => void;
|
||||
|
@ -1,13 +1,14 @@
|
||||
import React from "react";
|
||||
import classes from "./classes.module.scss";
|
||||
import { Customer } from "le-coffre-resources/dist/Notary";
|
||||
import Typography, { ITypo } from "../../Typography";
|
||||
import Image from "next/image";
|
||||
import PenIcon from "@Assets/Icons/pen.svg";
|
||||
import WarningBadge from "../../WarningBadge";
|
||||
import Link from "next/link";
|
||||
import Module from "@Front/Config/Module";
|
||||
import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
||||
import Module from "@Front/Config/Module";
|
||||
import { Customer } from "le-coffre-resources/dist/Notary";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import React from "react";
|
||||
|
||||
import Typography, { ITypo } from "../../Typography";
|
||||
import WarningBadge from "../../WarningBadge";
|
||||
import classes from "./classes.module.scss";
|
||||
|
||||
type IProps = {
|
||||
customer: Customer;
|
||||
@ -20,11 +21,12 @@ export default class UserFolderHeader extends React.Component<IProps, IState> {
|
||||
static defaultProps = {
|
||||
isArchived: false,
|
||||
};
|
||||
public override render(): JSX.Element {
|
||||
public override render(): JSX.Element | null {
|
||||
const redirectPath = Module.getInstance()
|
||||
.get()
|
||||
.modules.pages.Folder.pages.EditClient.props.path.replace("[folderUid]", this.props.folder.uid ?? "")
|
||||
.replace("[customerUid]", this.props.customer.uid ?? "");
|
||||
if (!this.props.customer.contact) return null;
|
||||
return (
|
||||
<div className={classes["root"]}>
|
||||
<div className={classes["content"]}>
|
||||
@ -64,7 +66,8 @@ export default class UserFolderHeader extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private hasPendingFiles() {
|
||||
const documents = this.props.folder.documents?.filter((document) => document.depositor.contact.uid === this.props.customer.contact.uid) ?? [];
|
||||
const documents =
|
||||
this.props.folder.documents?.filter((document) => document.depositor?.contact?.uid === this.props.customer.contact?.uid) ?? [];
|
||||
const notAskedDocuments = documents.filter((document) => document.document_status === "PENDING") ?? [];
|
||||
return notAskedDocuments.length > 0;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
||||
private getDocumentsByStatus(status: string): Document[] | null {
|
||||
if (!this.props.customer.documents) return null;
|
||||
const filteredDocuments = this.props.customer.documents.filter(
|
||||
(document) => document.document_status === status && document.folder.uid === this.props.folder.uid,
|
||||
(document) => document.document_status === status && document.folder?.uid === this.props.folder.uid,
|
||||
);
|
||||
return filteredDocuments;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ export type IDashBoardFolder = {
|
||||
folder_number: OfficeFolder["folder_number"];
|
||||
documents?: OfficeFolder["documents"];
|
||||
description: OfficeFolder["description"];
|
||||
deed: OfficeFolder["deed"];
|
||||
deed?: OfficeFolder["deed"];
|
||||
created_at: OfficeFolder["created_at"];
|
||||
office_folder_has_customers?: OfficeFolder["office_folder_has_customers"];
|
||||
archived_description: OfficeFolder["archived_description"];
|
||||
|
@ -23,6 +23,7 @@ import Toasts, { IToast } from "@Front/Stores/Toasts";
|
||||
|
||||
import classes from "./classes.module.scss";
|
||||
import { customer2, document, documentDeposited, documentPending, folder, folders, folderWithPendingDocument } from "./dummyData";
|
||||
import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
||||
|
||||
type IState = {
|
||||
isModalDisplayed: boolean;
|
||||
@ -182,13 +183,13 @@ export default class DesignSystem extends BasePage<IProps, IState> {
|
||||
<div className={classes["sub-section"]}>
|
||||
<Typography typo={ITypo.P_16}>Folder with no document to validate</Typography>
|
||||
<div className={classes["folder-conatainer"]}>
|
||||
<FolderContainer folder={folder} />
|
||||
<FolderContainer folder={folder as IDashBoardFolder} />
|
||||
</div>
|
||||
</div>
|
||||
<div className={classes["sub-section"]}>
|
||||
<Typography typo={ITypo.P_16}>Folder with document waiting for being validate</Typography>
|
||||
<div className={classes["folder-conatainer"]}>
|
||||
<FolderContainer folder={folderWithPendingDocument} />
|
||||
<FolderContainer folder={folderWithPendingDocument as IDashBoardFolder} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -239,7 +240,7 @@ export default class DesignSystem extends BasePage<IProps, IState> {
|
||||
<Typography typo={ITypo.H3}>Notary Documents</Typography>
|
||||
</div>
|
||||
<div className={classes["sub-section"]}>
|
||||
<UserFolder customer={customer2} folder={folder} isOpened={true} onClose={() => {return}} onOpen={() => {return}}/>
|
||||
<UserFolder customer={customer2} folder={folder as IDashBoardFolder} isOpened={true} onClose={() => {return}} onOpen={() => {return}}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -257,7 +258,7 @@ export default class DesignSystem extends BasePage<IProps, IState> {
|
||||
<Typography typo={ITypo.H3}>Document SearchBar</Typography>
|
||||
</div>
|
||||
<div className={classes["sub-section"]}>
|
||||
<SearchBar folders={folders} />
|
||||
<SearchBar folders={folders as IDashBoardFolder[]} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -266,7 +267,7 @@ export default class DesignSystem extends BasePage<IProps, IState> {
|
||||
<Typography typo={ITypo.H3}>Folder List</Typography>
|
||||
</div>
|
||||
<div className={classes["sub-section"]}>
|
||||
<FolderList folders={folders} isArchived={false} />
|
||||
<FolderList folders={folders as IDashBoardFolder[]} isArchived={false} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -140,7 +140,7 @@ class CreateFolderClass extends BasePage<IPropsClass, IState> {
|
||||
const usersMock = await Users.getInstance().get( { include: { office_membership: true } });
|
||||
const userMock = usersMock[0];
|
||||
// -------------------
|
||||
const collaborators = await Users.getInstance().get( { where: { office_membership: { uid: userMock?.office_membership.uid } }, include: { contact: true } },
|
||||
const collaborators = await Users.getInstance().get( { where: { office_membership: { uid: userMock?.office_membership?.uid } }, include: { contact: true } },
|
||||
);
|
||||
this.setState({
|
||||
deedTypes,
|
||||
@ -159,7 +159,7 @@ class CreateFolderClass extends BasePage<IPropsClass, IState> {
|
||||
|
||||
private mapUsersOptions(collaborators: User[]) {
|
||||
return collaborators.map((collaborator) => ({
|
||||
label: collaborator.contact.last_name.concat(" ", collaborator.contact.first_name),
|
||||
label: collaborator.contact?.last_name.concat(" ", collaborator.contact.first_name),
|
||||
value: collaborator.uid,
|
||||
})) as IOption[];
|
||||
}
|
||||
@ -226,7 +226,7 @@ class CreateFolderClass extends BasePage<IPropsClass, IState> {
|
||||
const userMock = usersMock[0];
|
||||
// -----
|
||||
if (!selectedDeedTypeUid) return;
|
||||
if (!userMock?.office_membership.uid) return;
|
||||
if (!userMock?.office_membership?.uid) return;
|
||||
|
||||
let stakeholders = this.getStakeholders();
|
||||
let test = stakeholders.map((stakeholder) => ({
|
||||
|
@ -121,7 +121,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
}
|
||||
public override async componentDidMount() {
|
||||
this.setState({
|
||||
selectedFolder: await this.getFolder(),
|
||||
selectedFolder: (await this.getFolder()) as IDashBoardFolder,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -82,27 +82,27 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
||||
name="first_name"
|
||||
fakeplaceholder="Nom"
|
||||
onChange={this.onChangeNameInput}
|
||||
defaultValue={this.state.customer?.contact.first_name}
|
||||
defaultValue={this.state.customer?.contact?.first_name}
|
||||
/>
|
||||
<InputField
|
||||
name="last_name"
|
||||
fakeplaceholder="Prénom"
|
||||
onChange={this.onChangeFirstNameInput}
|
||||
defaultValue={this.state.customer?.contact.last_name}
|
||||
defaultValue={this.state.customer?.contact?.last_name}
|
||||
/>
|
||||
<InputField
|
||||
name="email"
|
||||
fakeplaceholder="E-mail"
|
||||
isEmail
|
||||
onChange={this.onChangeEmailInput}
|
||||
defaultValue={this.state.customer?.contact.email}
|
||||
defaultValue={this.state.customer?.contact?.email}
|
||||
/>
|
||||
<InputField
|
||||
name="phone_number"
|
||||
fakeplaceholder="Numéro de téléphone"
|
||||
isPositiveNumber
|
||||
onChange={this.onChangePhoneNumberInput}
|
||||
defaultValue={this.state.customer?.contact.phone_number}
|
||||
defaultValue={this.state.customer?.contact?.phone_number ?? ""}
|
||||
/>
|
||||
<InputField
|
||||
name="birthdate"
|
||||
@ -110,7 +110,7 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
||||
fakeplaceholder="Date de naissance"
|
||||
required={false}
|
||||
onChange={this.onChangeBirthDateInput}
|
||||
defaultValue={this.state.customer?.contact.birthdate?.toString() ?? ""}
|
||||
defaultValue={this.state.customer?.contact?.birthdate?.toString() ?? ""}
|
||||
/>
|
||||
<InputField
|
||||
name="address"
|
||||
@ -118,7 +118,7 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
||||
fakeplaceholder="Adresse"
|
||||
required={false}
|
||||
onChange={this.onChangeAddressInput}
|
||||
defaultValue={this.state.customer?.contact.address?.address ?? ""}
|
||||
defaultValue={this.state.customer?.contact?.address?.address ?? ""}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -51,7 +51,7 @@ class UpdateFolderCollaboratorsClass extends BasePage<IPropsClass, IState> {
|
||||
const backwardPath = foldersInformationPath.replace("[folderUid]", this.props.selectedFolderUid);
|
||||
const selectOptions : IOption[]= this.state.availableCollaborators.map((collaborator) => {
|
||||
return {
|
||||
label: collaborator.contact.first_name + " " + collaborator.contact.last_name,
|
||||
label: collaborator.contact?.first_name + " " + collaborator.contact?.last_name,
|
||||
value: collaborator.uid,
|
||||
}
|
||||
})
|
||||
@ -116,7 +116,7 @@ class UpdateFolderCollaboratorsClass extends BasePage<IPropsClass, IState> {
|
||||
folder = await Folders.getInstance().getByUid(folderUid, query);
|
||||
const preSelectedCollaborators : IOption[]= folder.office_folder_has_stakeholder!.map((collaborator) => {
|
||||
return {
|
||||
label: collaborator.user_stakeholder.contact.first_name + " " + collaborator.user_stakeholder.contact.last_name,
|
||||
label: collaborator.user_stakeholder.contact?.first_name + " " + collaborator.user_stakeholder.contact?.last_name,
|
||||
value: collaborator.user_stakeholder.uid,
|
||||
}
|
||||
})
|
||||
@ -128,7 +128,7 @@ class UpdateFolderCollaboratorsClass extends BasePage<IPropsClass, IState> {
|
||||
|
||||
const userQuery: IGetUsersparams = {
|
||||
where: {
|
||||
office_uid: folder.office.uid,
|
||||
office_uid: folder.office?.uid,
|
||||
},
|
||||
include:{
|
||||
contact: {
|
||||
|
@ -73,7 +73,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
App 23 rue Torus Toulon
|
||||
</Typography>
|
||||
<Typography typo={ITypo.H3} color={ITypoColor.BLACK} className={classes["subtitle"]}>
|
||||
{this.props.selectedDocument.document_type.name}
|
||||
{this.props.selectedDocument.document_type?.name}
|
||||
</Typography>
|
||||
<div className={classes["document-container"]}>
|
||||
{this.props.selectedDocument.files.length > 1 && (
|
||||
@ -97,7 +97,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
)}
|
||||
</div>
|
||||
<div className={classes["footer"]}>
|
||||
{this.props.selectedDocument?.document_type.name === "Carte d'identité" && (
|
||||
{this.props.selectedDocument?.document_type?.name === "Carte d'identité" && (
|
||||
<div className={classes["ocr-container"]}>
|
||||
<OcrResult percentage={this.state.validatedPercentage} />
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user