Merge branch 'dev' of https://github.com/smart-chain-fr/leCoffre-front into dev
This commit is contained in:
commit
1d82962e6e
38
package-lock.json
generated
38
package-lock.json
generated
@ -16,11 +16,12 @@
|
|||||||
"@types/react-dom": "18.0.11",
|
"@types/react-dom": "18.0.11",
|
||||||
"class-validator": "^0.14.0",
|
"class-validator": "^0.14.0",
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
|
"crypto-random-string": "^5.0.0",
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.0.3",
|
||||||
"eslint": "8.36.0",
|
"eslint": "8.36.0",
|
||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.44",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.47",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
@ -1535,6 +1536,20 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/crypto-random-string": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-KWjTXWwxFd6a94m5CdRGW/t82Tr8DoBc9dNnPCAbFI1EBweN6v1tv8y4Y1m7ndkp/nkIBRxUxAzpaBnR2k3bcQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"type-fest": "^2.12.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.16"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/csstype": {
|
"node_modules/csstype": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||||
@ -2551,6 +2566,17 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/globals/node_modules/type-fest": {
|
||||||
|
"version": "0.20.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
|
||||||
|
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/globalthis": {
|
"node_modules/globalthis": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz",
|
||||||
@ -3202,7 +3228,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/le-coffre-resources": {
|
"node_modules/le-coffre-resources": {
|
||||||
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#30c8ee50b872a8bc6bec0f5d8c4626d8f4490177",
|
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#467b34a484adbd6dfa3fd6082bb7677f6178da51",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
@ -4474,11 +4500,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/type-fest": {
|
"node_modules/type-fest": {
|
||||||
"version": "0.20.2",
|
"version": "2.19.0",
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
|
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
|
||||||
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=12.20"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"eslint": "8.36.0",
|
"eslint": "8.36.0",
|
||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.44",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.47",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
@ -10,16 +10,15 @@ export interface IGetDocumentTypesparams {
|
|||||||
|
|
||||||
// TODO Type getbyuid query params
|
// TODO Type getbyuid query params
|
||||||
|
|
||||||
export type IPutDocumentTypesParams = {
|
export type IPutDocumentTypesParams = {};
|
||||||
};
|
|
||||||
|
|
||||||
export interface IPostDocumentTypesParams {
|
export interface IPostDocumentTypesParams {
|
||||||
name: string;
|
name: string;
|
||||||
public_description: string;
|
public_description: string;
|
||||||
private_description: string;
|
private_description: string;
|
||||||
office: {
|
office: {
|
||||||
uid: string;
|
uid: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class DocumentTypes extends BaseSuperAdmin {
|
export default class DocumentTypes extends BaseSuperAdmin {
|
||||||
@ -40,7 +39,8 @@ export default class DocumentTypes extends BaseSuperAdmin {
|
|||||||
|
|
||||||
public async get(q: IGetDocumentTypesparams): Promise<DocumentType[]> {
|
public async get(q: IGetDocumentTypesparams): Promise<DocumentType[]> {
|
||||||
const url = new URL(this.baseURl);
|
const url = new URL(this.baseURl);
|
||||||
Object.entries(q).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
const query = { q };
|
||||||
|
if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||||
try {
|
try {
|
||||||
return await this.getRequest<DocumentType[]>(url);
|
return await this.getRequest<DocumentType[]>(url);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { File } from "le-coffre-resources/dist/SuperAdmin";
|
import { File } from "le-coffre-resources/dist/SuperAdmin";
|
||||||
import BaseSuperAdmin from "../BaseSuperAdmin";
|
import BaseSuperAdmin from "../BaseSuperAdmin";
|
||||||
import CryptoService from "@Front/Services/CryptoService/CryptoService";
|
|
||||||
|
|
||||||
|
|
||||||
// TODO Type get query params -> Where + inclue + orderby
|
// TODO Type get query params -> Where + inclue + orderby
|
||||||
@ -19,7 +18,6 @@ export default class Files extends BaseSuperAdmin {
|
|||||||
private static instance: Files;
|
private static instance: Files;
|
||||||
private readonly baseURl = this.namespaceUrl.concat("/files");
|
private readonly baseURl = this.namespaceUrl.concat("/files");
|
||||||
|
|
||||||
private cryptoService: CryptoService = CryptoService.getInstance();
|
|
||||||
private constructor() {
|
private constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
@ -34,9 +32,6 @@ export default class Files extends BaseSuperAdmin {
|
|||||||
if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||||
try {
|
try {
|
||||||
const files = await this.getRequest<File[]>(url);
|
const files = await this.getRequest<File[]>(url);
|
||||||
files.forEach(async (file) => {
|
|
||||||
file.file_path = await this.cryptoService.decrypt(file.file_path!, file.iv);
|
|
||||||
});
|
|
||||||
return files;
|
return files;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
@ -68,7 +63,6 @@ export default class Files extends BaseSuperAdmin {
|
|||||||
if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||||
try {
|
try {
|
||||||
const file = await this.getRequest<File>(url);
|
const file = await this.getRequest<File>(url);
|
||||||
file.file_path = await this.cryptoService.decrypt(file.file_path!, file.iv);
|
|
||||||
return file;
|
return file;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
|
@ -26,6 +26,7 @@ type IFile = {
|
|||||||
index: number;
|
index: number;
|
||||||
file: File;
|
file: File;
|
||||||
uid: string;
|
uid: string;
|
||||||
|
archived: Date | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IState = {
|
type IState = {
|
||||||
@ -100,6 +101,7 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
|||||||
<div className={classes["documents-container"]}>
|
<div className={classes["documents-container"]}>
|
||||||
{this.state.files.map((file) => {
|
{this.state.files.map((file) => {
|
||||||
const fileObj = file.file;
|
const fileObj = file.file;
|
||||||
|
if (file.archived) return;
|
||||||
return (
|
return (
|
||||||
<div className={classes["file-container"]} key={fileObj.name + file.index}>
|
<div className={classes["file-container"]} key={fileObj.name + file.index}>
|
||||||
<div className={classes["left-part"]}>
|
<div className={classes["left-part"]}>
|
||||||
@ -144,7 +146,6 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
|||||||
<InputField textarea fakeplaceholder={"Description"} defaultValue={this.state.refusedReason} readOnly />
|
<InputField textarea fakeplaceholder={"Description"} defaultValue={this.state.refusedReason} readOnly />
|
||||||
</div>
|
</div>
|
||||||
</Confirm>
|
</Confirm>
|
||||||
;
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -156,6 +157,7 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
|||||||
index: this.index++,
|
index: this.index++,
|
||||||
file: new File([""], file.file_path ?? "", {}),
|
file: new File([""], file.file_path ?? "", {}),
|
||||||
uid: file.uid!,
|
uid: file.uid!,
|
||||||
|
archived: file.archived_at ? new Date(file.archived_at) : null,
|
||||||
})),
|
})),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -269,6 +271,7 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
|||||||
index: this.index++,
|
index: this.index++,
|
||||||
file: file,
|
file: file,
|
||||||
uid: newFile.uid!,
|
uid: newFile.uid!,
|
||||||
|
archived: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
@ -58,7 +58,9 @@ class DocumentNotaryClass extends React.Component<IPropsClass, IState> {
|
|||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return `${documentFiles.length} documents déposés`;
|
const archivedFilesLenght = documentFiles.filter((file) => file.archived_at).length;
|
||||||
|
const documentFileLenght = documentFiles.length - archivedFilesLenght;
|
||||||
|
return `${documentFileLenght} documents déposés`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "Aucun document déposé";
|
return "Aucun document déposé";
|
||||||
@ -66,7 +68,11 @@ class DocumentNotaryClass extends React.Component<IPropsClass, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private onClick() {
|
private onClick() {
|
||||||
if (this.props.document.document_status !== EDocumentStatus.VALIDATED && this.props.document.document_status !== EDocumentStatus.DEPOSITED) return;
|
if (
|
||||||
|
this.props.document.document_status !== EDocumentStatus.VALIDATED &&
|
||||||
|
this.props.document.document_status !== EDocumentStatus.DEPOSITED
|
||||||
|
)
|
||||||
|
return;
|
||||||
this.props.router.push(`/folders/${this.props.folderUid}/documents/${this.props.document.uid}`);
|
this.props.router.push(`/folders/${this.props.folderUid}/documents/${this.props.document.uid}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,12 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
&.single-information {
|
||||||
|
.content {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||||
@ -17,7 +23,6 @@
|
|||||||
.text-container {
|
.text-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
> :first-child {
|
> :first-child {
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
@ -33,9 +38,7 @@
|
|||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.single-information {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-icon-container {
|
.edit-icon-container {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
@import "@Themes/constants.scss";
|
@import "@Themes/constants.scss";
|
||||||
|
|
||||||
.root {
|
.root {
|
||||||
|
height: calc(100vh - 290px);
|
||||||
|
overflow: scroll;
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
background-color: var(--grey-medium);
|
background-color: var(--grey-medium);
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,7 @@ class FolderListClass extends React.Component<IPropsClass, IState> {
|
|||||||
? Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.pages.FolderInformation.props.path
|
? Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.pages.FolderInformation.props.path
|
||||||
: Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path;
|
: Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path;
|
||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
return (
|
return <div className={classes["root"]}>{this.renderFolders()}</div>;
|
||||||
<div className={classes["root"]}>
|
|
||||||
{this.renderFolders()}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderFolders(): JSX.Element[] {
|
private renderFolders(): JSX.Element[] {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
@import "@Themes/constants.scss";
|
@import "@Themes/constants.scss";
|
||||||
|
|
||||||
.root {
|
.root {
|
||||||
min-height: 100%;
|
width: calc(100vh - 83px);
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -22,6 +22,7 @@ export type IOption = {
|
|||||||
value: unknown;
|
value: unknown;
|
||||||
label: string;
|
label: string;
|
||||||
icon?: ReactNode;
|
icon?: ReactNode;
|
||||||
|
description?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IState = {
|
type IState = {
|
||||||
|
@ -75,6 +75,7 @@ export default class UserFolderHeader extends React.Component<IProps, IState> {
|
|||||||
|
|
||||||
private formatPhoneNumber(phoneNumber: string): string {
|
private formatPhoneNumber(phoneNumber: string): string {
|
||||||
if (!phoneNumber) return "";
|
if (!phoneNumber) return "";
|
||||||
|
phoneNumber = phoneNumber.replace(/ /g, "");
|
||||||
const output = phoneNumber.split("").map((char, index) => {
|
const output = phoneNumber.split("").map((char, index) => {
|
||||||
if (index % 2) return char + " ";
|
if (index % 2) return char + " ";
|
||||||
return char;
|
return char;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import DepositDocument from "@Front/Components/DesignSystem/DepositDocument";
|
import DepositDocument from "@Front/Components/DesignSystem/DepositDocument";
|
||||||
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
|
import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField";
|
||||||
@ -6,16 +7,18 @@ import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography";
|
|||||||
import Base from "@Front/Components/Layouts/Base";
|
import Base from "@Front/Components/Layouts/Base";
|
||||||
import DefaultTemplate from "@Front/Components/LayoutTemplates/DefaultTemplate";
|
import DefaultTemplate from "@Front/Components/LayoutTemplates/DefaultTemplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { documentDeposited } from "../DesignSystem/dummyData";
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents";
|
import Customers from "@Front/Api/LeCoffreApi/SuperAdmin/Customers/Customers";
|
||||||
import { Document } from "le-coffre-resources/dist/Customer";
|
import Customer, { Document } from "le-coffre-resources/dist/Customer";
|
||||||
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
import { document } from "./../../../Components/Layouts/DesignSystem/dummyData";
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {
|
||||||
|
targetedCustormer: string; // MOCK
|
||||||
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
isAddDocumentModalVisible: boolean;
|
isAddDocumentModalVisible: boolean;
|
||||||
documents: Document[];
|
documents: Document[];
|
||||||
|
mockedCustomer: Customer | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class ClientDashboard extends Base<IProps, IState> {
|
export default class ClientDashboard extends Base<IProps, IState> {
|
||||||
@ -24,6 +27,7 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
|||||||
this.state = {
|
this.state = {
|
||||||
isAddDocumentModalVisible: false,
|
isAddDocumentModalVisible: false,
|
||||||
documents: [],
|
documents: [],
|
||||||
|
mockedCustomer: null,
|
||||||
};
|
};
|
||||||
this.onCloseModalAddDocument = this.onCloseModalAddDocument.bind(this);
|
this.onCloseModalAddDocument = this.onCloseModalAddDocument.bind(this);
|
||||||
this.onOpenModalAddDocument = this.onOpenModalAddDocument.bind(this);
|
this.onOpenModalAddDocument = this.onOpenModalAddDocument.bind(this);
|
||||||
@ -37,11 +41,7 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
|||||||
<div className={classes["sub-container"]}>
|
<div className={classes["sub-container"]}>
|
||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
{this.state.documents?.map((document) => (
|
{this.state.documents?.map((document) => (
|
||||||
<DepositDocument
|
<DepositDocument document={document} key={document.uid} defaultFiles={document.files ?? []} />
|
||||||
document={document}
|
|
||||||
key={document.uid}
|
|
||||||
defaultFiles={document.files ?? []}
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<Typography typo={ITypo.H2}>Documents supplémentaires (facultatif)</Typography>
|
<Typography typo={ITypo.H2}>Documents supplémentaires (facultatif)</Typography>
|
||||||
@ -69,7 +69,7 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
|||||||
Glissez / Déposez votre document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le
|
Glissez / Déposez votre document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le
|
||||||
document correspondant.
|
document correspondant.
|
||||||
</Typography>
|
</Typography>
|
||||||
<DepositDocument document={documentDeposited} />
|
<DepositDocument document={document} />
|
||||||
</div>
|
</div>
|
||||||
</Confirm>
|
</Confirm>
|
||||||
</div>
|
</div>
|
||||||
@ -83,7 +83,7 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
|||||||
<div className={classes["text-container"]}>
|
<div className={classes["text-container"]}>
|
||||||
{/* TODO Get name from userStore */}
|
{/* TODO Get name from userStore */}
|
||||||
<Typography typo={ITypo.H1} className={classes["title"]}>
|
<Typography typo={ITypo.H1} className={classes["title"]}>
|
||||||
Bonjour John Doe
|
Bonjour {this.state.mockedCustomer?.contact?.first_name.concat(" ", this.state.mockedCustomer?.contact?.last_name)}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Typography typo={ITypo.H2} className={classes["subtitle"]}>
|
<Typography typo={ITypo.H2} className={classes["subtitle"]}>
|
||||||
@ -97,7 +97,9 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
|||||||
l’aide du bouton ci-dessus.
|
l’aide du bouton ci-dessus.
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<Button className={classes["button"]}>Contacter mon notaire</Button>
|
<a href="mailto:g.texier@notaires.fr" target="_blank">
|
||||||
|
<Button className={classes["button"]}>Contacter mon notaire</Button>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -105,9 +107,11 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
|||||||
public override async componentDidMount() {
|
public override async componentDidMount() {
|
||||||
// TODO Get documents of the current customer according to userStore
|
// TODO Get documents of the current customer according to userStore
|
||||||
// REMOVE this mock
|
// REMOVE this mock
|
||||||
const mockUsers = (await Users.getInstance().get({}))[2];
|
const mockedCustomers = await Customers.getInstance().get({ where: { contact: { email: this.props.targetedCustormer } } });
|
||||||
|
const mockedCustomer: Customer = mockedCustomers[0]!;
|
||||||
|
|
||||||
const query: IGetDocumentsparams = {
|
const query: IGetDocumentsparams = {
|
||||||
where: { depositor: mockUsers?.uid },
|
where: { depositor: { uid: mockedCustomer.uid } },
|
||||||
include: {
|
include: {
|
||||||
files: true,
|
files: true,
|
||||||
document_history: true,
|
document_history: true,
|
||||||
@ -115,7 +119,7 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
const documents: Document[] = await Documents.getInstance().get(query);
|
const documents: Document[] = await Documents.getInstance().get(query);
|
||||||
this.setState({ documents });
|
this.setState({ documents, mockedCustomer });
|
||||||
}
|
}
|
||||||
|
|
||||||
private onCloseModalAddDocument() {
|
private onCloseModalAddDocument() {
|
||||||
|
@ -78,7 +78,7 @@ export const contact2: Contact = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const docType: DocumentType = {
|
export const docType: DocumentType = {
|
||||||
name: "Acte de naissance",
|
name: "Votre document",
|
||||||
uid: "fezezfazegezrgrezg",
|
uid: "fezezfazegezrgrezg",
|
||||||
created_at: new Date(),
|
created_at: new Date(),
|
||||||
updated_at: new Date(),
|
updated_at: new Date(),
|
||||||
@ -146,7 +146,7 @@ export const fileMock: File = {
|
|||||||
file_name: "file_1",
|
file_name: "file_1",
|
||||||
file_path:
|
file_path:
|
||||||
"https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/Qmf_Yb_Eh_X9st_F_Srq_Ve_Bj_Yb_Aj56xv_AV_Nj6_Wjypo_B4r5ubce_U_ae3303e7ab.pdf",
|
"https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/Qmf_Yb_Eh_X9st_F_Srq_Ve_Bj_Yb_Aj56xv_AV_Nj6_Wjypo_B4r5ubce_U_ae3303e7ab.pdf",
|
||||||
iv: "1"
|
archived_at: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fileMock2: File = {
|
export const fileMock2: File = {
|
||||||
@ -157,7 +157,7 @@ export const fileMock2: File = {
|
|||||||
file_name: "file_2",
|
file_name: "file_2",
|
||||||
file_path:
|
file_path:
|
||||||
"https://minteed-prod-euwest3-s3.s3.eu-west-3.amazonaws.com/Qm_Wq_En1_DCA_8yt_RX_Qx_QFA_9_Fm_ZKZH_Qqb_VH_1_Q_Mnv_G_Jtt1_FS_Xp_2a35a36e19",
|
"https://minteed-prod-euwest3-s3.s3.eu-west-3.amazonaws.com/Qm_Wq_En1_DCA_8yt_RX_Qx_QFA_9_Fm_ZKZH_Qqb_VH_1_Q_Mnv_G_Jtt1_FS_Xp_2a35a36e19",
|
||||||
iv: "2"
|
archived_at: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const identityFile: File = {
|
export const identityFile: File = {
|
||||||
@ -167,7 +167,7 @@ export const identityFile: File = {
|
|||||||
document: document,
|
document: document,
|
||||||
file_name: "file_3",
|
file_name: "file_3",
|
||||||
file_path: "https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/cni_fake_c7259d4923.png",
|
file_path: "https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/cni_fake_c7259d4923.png",
|
||||||
iv: "3"
|
archived_at: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const documentIdentity: Document = {
|
export const documentIdentity: Document = {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import PlusIcon from "@Assets/Icons/plus.svg";
|
import PlusIcon from "@Assets/Icons/plus.svg";
|
||||||
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
@ -71,7 +70,7 @@ class AskDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
{this.state.documentTypes.map((documentType) => (
|
{this.state.documentTypes.map((documentType) => (
|
||||||
<CheckBox
|
<CheckBox
|
||||||
name="document_types"
|
name="document_types"
|
||||||
toolTip="Checkbox with tooltip"
|
toolTip={documentType.description}
|
||||||
option={documentType}
|
option={documentType}
|
||||||
key={documentType.value as string}
|
key={documentType.value as string}
|
||||||
/>
|
/>
|
||||||
@ -172,6 +171,7 @@ class AskDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
return {
|
return {
|
||||||
label: documentType.document_type!.name!,
|
label: documentType.document_type!.name!,
|
||||||
value: documentType.document_type!.uid!,
|
value: documentType.document_type!.uid!,
|
||||||
|
description: documentType.document_type!.private_description!,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||||
import Folders, { IPutFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
import Folders, { IPutFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
@ -124,7 +123,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
<Typography typo={ITypo.H1Bis}>Informations du dossier</Typography>
|
<Typography typo={ITypo.H1Bis}>Informations du dossier</Typography>
|
||||||
<div className={classes["choose-a-folder"]}>
|
<div className={classes["choose-a-folder"]}>
|
||||||
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
||||||
Veuillez sélectionner un dossier.
|
Vous n'avez aucun dossier archivés
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import LeftArrowIcon from "@Assets/Icons/left-arrow.svg";
|
import LeftArrowIcon from "@Assets/Icons/left-arrow.svg";
|
||||||
import RightArrowIcon from "@Assets/Icons/right-arrow.svg";
|
import RightArrowIcon from "@Assets/Icons/right-arrow.svg";
|
||||||
import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents";
|
import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents";
|
||||||
@ -22,7 +21,6 @@ import classes from "./classes.module.scss";
|
|||||||
import OcrResult from "./OcrResult";
|
import OcrResult from "./OcrResult";
|
||||||
import Files from "@Front/Api/LeCoffreApi/SuperAdmin/Files/Files";
|
import Files from "@Front/Api/LeCoffreApi/SuperAdmin/Files/Files";
|
||||||
|
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
type IPropsClass = {
|
type IPropsClass = {
|
||||||
documentUid: string;
|
documentUid: string;
|
||||||
@ -76,7 +74,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
{this.state.document && this.state.document.files && this.state.selectedFile && (
|
{this.state.document && this.state.document.files && this.state.selectedFile && (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<Typography typo={ITypo.H1} color={ITypoColor.BLACK} className={classes["title"]}>
|
<Typography typo={ITypo.H1} color={ITypoColor.BLACK} className={classes["title"]}>
|
||||||
App 23 rue Torus Toulon
|
{this.state.document.document_type?.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography typo={ITypo.H3} color={ITypoColor.BLACK} className={classes["subtitle"]}>
|
<Typography typo={ITypo.H3} color={ITypoColor.BLACK} className={classes["subtitle"]}>
|
||||||
{this.state.document.document_type?.name}
|
{this.state.document.document_type?.name}
|
||||||
@ -91,7 +89,10 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className={classes["file-container"]}>
|
<div className={classes["file-container"]}>
|
||||||
<FilePreview href={Files.getInstance().getUploadLink(this.state.selectedFile?.uid as string)} key={this.state.selectedFile.uid} />
|
<FilePreview
|
||||||
|
href={Files.getInstance().getUploadLink(this.state.selectedFile?.uid as string)}
|
||||||
|
key={this.state.selectedFile.uid}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{this.state.document.files.length > 1 && (
|
{this.state.document.files.length > 1 && (
|
||||||
<div
|
<div
|
||||||
@ -268,11 +269,11 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
return index < this.state.document!.files!.length;
|
return index < this.state.document!.files!.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async refuseDocument(){
|
private async refuseDocument() {
|
||||||
try{
|
try {
|
||||||
await Documents.getInstance().put(this.props.documentUid, {
|
await Documents.getInstance().put(this.props.documentUid, {
|
||||||
document_status: EDocumentStatus.REFUSED,
|
document_status: EDocumentStatus.REFUSED,
|
||||||
refused_reason: this.state.refuseText
|
refused_reason: this.state.refuseText,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.props.router.push(
|
this.props.router.push(
|
||||||
@ -280,7 +281,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
.get()
|
.get()
|
||||||
.modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid),
|
.modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid),
|
||||||
);
|
);
|
||||||
}catch(e){
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ export default class Folder extends BasePage<IProps, IState> {
|
|||||||
<Typography typo={ITypo.H1Bis}>Informations du dossier</Typography>
|
<Typography typo={ITypo.H1Bis}>Informations du dossier</Typography>
|
||||||
<div className={classes["choose-a-folder"]}>
|
<div className={classes["choose-a-folder"]}>
|
||||||
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
||||||
Veuillez sélectionner un dossier.
|
Vous n'avez aucun dossier archivés
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation";
|
import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation";
|
||||||
@ -94,7 +93,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
<Typography typo={ITypo.H1Bis}>Informations du dossier</Typography>
|
<Typography typo={ITypo.H1Bis}>Informations du dossier</Typography>
|
||||||
<div className={classes["choose-a-folder"]}>
|
<div className={classes["choose-a-folder"]}>
|
||||||
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
||||||
Veuillez sélectionner un dossier.
|
Vous n'avez aucun dossier archivés
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,13 +21,17 @@ export default class Folder extends BasePage<IProps, IState> {
|
|||||||
// TODO: Message if the user has not created any folder yet
|
// TODO: Message if the user has not created any folder yet
|
||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<DefaultNotaryDashboard title={"Dossier"} onSelectedFolder={this.onSelectedFolder} isArchived mobileBackText={"Liste des dossiers"}>
|
<DefaultNotaryDashboard
|
||||||
|
title={"Dossier"}
|
||||||
|
onSelectedFolder={this.onSelectedFolder}
|
||||||
|
isArchived
|
||||||
|
mobileBackText={"Liste des dossiers"}>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["no-folder-selected"]}>
|
<div className={classes["no-folder-selected"]}>
|
||||||
<Typography typo={ITypo.H1Bis}>Informations du dossier</Typography>
|
<Typography typo={ITypo.H1Bis}>Informations du dossier</Typography>
|
||||||
<div className={classes["choose-a-folder"]}>
|
<div className={classes["choose-a-folder"]}>
|
||||||
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
||||||
Veuillez sélectionner un dossier.
|
Vous n'avez aucun dossier archivés
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,10 +25,22 @@ export default class MyAccount extends Base<IProps, IState> {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Form onSubmit={this.onFormSubmit}>
|
<Form onSubmit={this.onFormSubmit}>
|
||||||
<div className={classes["form-container"]}>
|
<div className={classes["form-container"]}>
|
||||||
<InputField name="name" fakeplaceholder="Nom" type="text" defaultValue={"TEXIER"} disabled />
|
<InputField name="name" fakeplaceholder="Nom" type="text" defaultValue={"BIHR"} disabled />
|
||||||
<InputField name="surname" fakeplaceholder="Prénom" type="text" defaultValue={"Gwendal"} disabled />
|
<InputField name="surname" fakeplaceholder="Prénom" type="text" defaultValue={"Nicolas"} disabled />
|
||||||
<InputField name="email" fakeplaceholder="E-mail" type="email" defaultValue={"g.texier@notaires.fr"} disabled />
|
<InputField
|
||||||
<InputField name="phone" fakeplaceholder="Numéro de téléphone" type="tel" defaultValue={"06 74 83 90 23"} disabled />
|
name="email"
|
||||||
|
fakeplaceholder="E-mail"
|
||||||
|
type="email"
|
||||||
|
defaultValue={"nicolas.bihr@notaires.fr"}
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
<InputField
|
||||||
|
name="phone"
|
||||||
|
fakeplaceholder="Numéro de téléphone"
|
||||||
|
type="tel"
|
||||||
|
defaultValue={"06 74 83 90 23"}
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
@ -42,12 +54,24 @@ export default class MyAccount extends Base<IProps, IState> {
|
|||||||
name="office_denomination"
|
name="office_denomination"
|
||||||
fakeplaceholder="Dénomination de l'office"
|
fakeplaceholder="Dénomination de l'office"
|
||||||
type="text"
|
type="text"
|
||||||
defaultValue="AP NOTAIRES"
|
defaultValue="Etude Office notarial du Cormier"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
<InputField name="crpcen" fakeplaceholder="CRPCEN" type="number" defaultValue="35137" disabled />
|
||||||
|
<InputField
|
||||||
|
name="cp_address"
|
||||||
|
fakeplaceholder="Adresse CP"
|
||||||
|
defaultValue="2 RUE DE RENNES"
|
||||||
|
type="text"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
<InputField
|
||||||
|
name="city"
|
||||||
|
fakeplaceholder="Ville"
|
||||||
|
type="text"
|
||||||
|
defaultValue="35140 ST AUBIN DU CORMIER"
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
<InputField name="crpcen" fakeplaceholder="CRPCEN" type="number" defaultValue="04839284" disabled />
|
|
||||||
<InputField name="cp_address" fakeplaceholder="Adresse CP" defaultValue="4 Avenue de La Forêt" type="text" disabled />
|
|
||||||
<InputField name="city" fakeplaceholder="Ville" type="text" defaultValue="35340 LIFFRE" disabled />
|
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
|
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
|
||||||
|
|
||||||
export default function Route() {
|
export default function Route() {
|
||||||
return <ClientDashboard />;
|
return <ClientDashboard targetedCustormer="kevin.hautefaye@gmail.com" />;
|
||||||
}
|
}
|
||||||
|
5
src/pages/client-dashboard1.tsx
Normal file
5
src/pages/client-dashboard1.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
|
||||||
|
|
||||||
|
export default function Route() {
|
||||||
|
return <ClientDashboard targetedCustormer="manon.simon@gmail.com" />;
|
||||||
|
}
|
5
src/pages/client-dashboard2.tsx
Normal file
5
src/pages/client-dashboard2.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
|
||||||
|
|
||||||
|
export default function Route() {
|
||||||
|
return <ClientDashboard targetedCustormer="vincent.brognard@gmail.com" />;
|
||||||
|
}
|
5
src/pages/client-dashboard3.tsx
Normal file
5
src/pages/client-dashboard3.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
|
||||||
|
|
||||||
|
export default function Route() {
|
||||||
|
return <ClientDashboard targetedCustormer="maxime.lalo@gmail.com" />;
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
|
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
|
||||||
|
|
||||||
export default function Route() {
|
export default function Route() {
|
||||||
return <ClientDashboard />;
|
return <ClientDashboard targetedCustormer="kevin.hautefaye@gmail.com" />;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user