🐛 Fixing requests
This commit is contained in:
parent
302384ab01
commit
0c6f495929
@ -67,6 +67,7 @@ export default class UserFolderHeader extends React.Component<IProps, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private hasPendingFiles() {
|
private hasPendingFiles() {
|
||||||
|
console.log(this.props.folder.documents);
|
||||||
const documents =
|
const documents =
|
||||||
this.props.folder.documents?.filter((document) => document.depositor?.contact?.uid === this.props.customer.contact?.uid) ?? [];
|
this.props.folder.documents?.filter((document) => document.depositor?.contact?.uid === this.props.customer.contact?.uid) ?? [];
|
||||||
const notAskedDocuments = documents.filter((document) => document.document_status === EDocumentStatus.DEPOSITED) ?? [];
|
const notAskedDocuments = documents.filter((document) => document.document_status === EDocumentStatus.DEPOSITED) ?? [];
|
||||||
|
@ -125,14 +125,14 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
|||||||
private calculateDocumentsPercentageProgress(): number {
|
private calculateDocumentsPercentageProgress(): number {
|
||||||
if (!this.props.customer.documents) return 0;
|
if (!this.props.customer.documents) return 0;
|
||||||
const totalDocuments: number = this.props.customer.documents.length;
|
const totalDocuments: number = this.props.customer.documents.length;
|
||||||
const numberDocumentsAsked: number = this.getDocumentsByStatus("ASKED")?.length || 0;
|
const numberDocumentsAsked: number = this.getDocumentsByStatus(EDocumentStatus.ASKED)?.length || 0;
|
||||||
return Math.round(((totalDocuments - numberDocumentsAsked) / totalDocuments) * 100);
|
return Math.round(((totalDocuments - numberDocumentsAsked) / totalDocuments) * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDocumentsByStatus(status: string): Document[] | null {
|
private getDocumentsByStatus(status: string): Document[] | null {
|
||||||
if (!this.props.customer.documents) return null;
|
if (!this.props.customer.documents) return null;
|
||||||
const filteredDocuments = this.props.customer.documents.filter(
|
const filteredDocuments = this.props.customer.documents.filter(
|
||||||
(document) => document.document_status === status,
|
(document) => document.document_status === status && document.folder?.uid === this.props.folder.uid,
|
||||||
);
|
);
|
||||||
return filteredDocuments;
|
return filteredDocuments;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import "reflect-metadata";
|
import "reflect-metadata";
|
||||||
|
|
||||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||||
|
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import FolderListContainer from "@Front/Components/DesignSystem/FolderListContainer";
|
import FolderListContainer from "@Front/Components/DesignSystem/FolderListContainer";
|
||||||
import Header from "@Front/Components/DesignSystem/Header";
|
import Header from "@Front/Components/DesignSystem/Header";
|
||||||
@ -9,12 +10,12 @@ import BackArrow from "@Front/Components/Elements/BackArrow";
|
|||||||
import WindowStore from "@Front/Stores/WindowStore";
|
import WindowStore from "@Front/Stores/WindowStore";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { OfficeFolder } from "le-coffre-resources/dist/Customer";
|
import { OfficeFolder } from "le-coffre-resources/dist/Customer";
|
||||||
|
import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import React, { ReactNode } from "react";
|
import React, { ReactNode } from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
|
||||||
import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder";
|
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
title: string;
|
title: string;
|
||||||
@ -118,12 +119,22 @@ export default class DefaultNotaryDashboard extends React.Component<IProps, ISta
|
|||||||
include: {
|
include: {
|
||||||
deed: { include: { deed_type: true } },
|
deed: { include: { deed_type: true } },
|
||||||
office: true,
|
office: true,
|
||||||
office_folder_has_customers: { include: { customer: { include: { contact: true, documents: {
|
office_folder_has_customers: {
|
||||||
include: {
|
include: {
|
||||||
|
customer: {
|
||||||
|
include: {
|
||||||
|
contact: true,
|
||||||
|
documents: {
|
||||||
|
include: {
|
||||||
|
folder: true,
|
||||||
document_type: true,
|
document_type: true,
|
||||||
files: true
|
files: true,
|
||||||
}
|
},
|
||||||
} } } } },
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
documents: {
|
documents: {
|
||||||
include: {
|
include: {
|
||||||
depositor: {
|
depositor: {
|
||||||
|
@ -185,12 +185,22 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
q: {
|
q: {
|
||||||
deed: { include: { deed_type: true } },
|
deed: { include: { deed_type: true } },
|
||||||
office: true,
|
office: true,
|
||||||
office_folder_has_customers: { include: { customer: { include: { contact: true, documents: {
|
office_folder_has_customers: {
|
||||||
include: {
|
include: {
|
||||||
|
customer: {
|
||||||
|
include: {
|
||||||
|
contact: true,
|
||||||
|
documents: {
|
||||||
|
include: {
|
||||||
|
folder: true,
|
||||||
document_type: true,
|
document_type: true,
|
||||||
files: true
|
files: true,
|
||||||
}
|
},
|
||||||
} } } } },
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
documents: {
|
documents: {
|
||||||
include: {
|
include: {
|
||||||
depositor: {
|
depositor: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user