merge dev in staging (#44)
This commit is contained in:
commit
58c3d127ae
@ -4,15 +4,14 @@ const nextConfig = {
|
|||||||
reactStrictMode: false,
|
reactStrictMode: false,
|
||||||
publicRuntimeConfig: {
|
publicRuntimeConfig: {
|
||||||
// Will be available on both server and client
|
// Will be available on both server and client
|
||||||
BACK_API_PROTOCOL: process.env.BACK_API_PROTOCOL,
|
BACK_API_PROTOCOL: process.env.NEXT_PUBLIC_BACK_API_PROTOCOL,
|
||||||
BACK_API_HOST: process.env.BACK_API_HOST,
|
BACK_API_HOST: process.env.NEXT_PUBLIC_BACK_API_HOST,
|
||||||
BACK_API_PORT: process.env.BACK_API_PORT,
|
BACK_API_ROOT_URL: process.env.NEXT_PUBLIC_BACK_API_ROOT_URL,
|
||||||
BACK_API_ROOT_URL: process.env.BACK_API_ROOT_URL,
|
BACK_API_VERSION: process.env.NEXT_PUBLIC_BACK_API_VERSION,
|
||||||
BACK_API_VERSION: process.env.BACK_API_VERSION,
|
FRONT_APP_HOST: process.env.NEXT_PUBLIC_FRONT_APP_HOST,
|
||||||
FRONT_APP_HOST: process.env.FRONT_APP_HOST,
|
FRONT_APP_PORT: process.env.NEXT_PUBLIC_FRONT_APP_PORT,
|
||||||
FRONT_APP_PORT: process.env.FRONT_APP_PORT,
|
IDNOT_AUTHORIZE_ENDPOINT: process.env.NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT,
|
||||||
IDNOT_AUTHORIZE_ENDPOINT: process.env.IDNOT_AUTHORIZE_ENDPOINT,
|
IDNOT_CLIENT_ID: process.env.NEXT_PUBLIC_IDNOT_CLIENT_ID,
|
||||||
IDNOT_CLIENT_ID: process.env.IDNOT_CLIENT_ID,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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"
|
||||||
|
@ -18,11 +18,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",
|
||||||
|
@ -17,7 +17,6 @@ export default abstract class BaseApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected getBaseUrl() {
|
protected getBaseUrl() {
|
||||||
console.log("BaseApiService.baseUrl >>> ", BaseApiService.baseUrl);
|
|
||||||
return BaseApiService.baseUrl;
|
return BaseApiService.baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,7 +1,6 @@
|
|||||||
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
|
||||||
@ -20,7 +19,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();
|
||||||
}
|
}
|
||||||
@ -35,9 +33,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);
|
||||||
@ -58,13 +53,17 @@ export default class Files extends BaseSuperAdmin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getUploadLink(uid: string): string {
|
||||||
|
return this.baseURl.concat(`/upload/${uid}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public async getByUid(uid: string, q?: any): Promise<File> {
|
public async getByUid(uid: string, q?: any): Promise<File> {
|
||||||
const url = new URL(this.baseURl.concat(`/${uid}`));
|
const url = new URL(this.baseURl.concat(`/${uid}`));
|
||||||
const query = { q };
|
const query = { q };
|
||||||
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);
|
||||||
|
@ -144,7 +144,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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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,9 +1,9 @@
|
|||||||
|
|
||||||
import React, { ReactNode } from "react";
|
|
||||||
import classes from "./classes.module.scss";
|
|
||||||
import Header from "@Front/Components/DesignSystem/Header";
|
import Header from "@Front/Components/DesignSystem/Header";
|
||||||
import Version from "@Front/Components/DesignSystem/Version";
|
import Version from "@Front/Components/DesignSystem/Version";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
import React, { ReactNode } from "react";
|
||||||
|
|
||||||
|
import classes from "./classes.module.scss";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
title: string;
|
title: string;
|
||||||
@ -13,6 +13,7 @@ type IProps = {
|
|||||||
*/
|
*/
|
||||||
scrollTop: number | null;
|
scrollTop: number | null;
|
||||||
isPadding?: boolean;
|
isPadding?: boolean;
|
||||||
|
hasHeaderLinks: boolean;
|
||||||
};
|
};
|
||||||
type IState = {};
|
type IState = {};
|
||||||
|
|
||||||
@ -20,12 +21,13 @@ export default class DefaultTemplate extends React.Component<IProps, IState> {
|
|||||||
public static defaultProps = {
|
public static defaultProps = {
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
isPadding: true,
|
isPadding: true,
|
||||||
|
hasHeaderLinks: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header isUserConnected={true} />
|
<Header isUserConnected={this.props.hasHeaderLinks} />
|
||||||
<div className={classNames(classes["root"], this.props.isPadding && classes["padding"])}>{this.props.children}</div>
|
<div className={classNames(classes["root"], this.props.isPadding && classes["padding"])}>{this.props.children}</div>
|
||||||
<Version />
|
<Version />
|
||||||
</>
|
</>
|
||||||
|
@ -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,24 +7,26 @@ 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 = {};
|
||||||
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> {
|
||||||
|
private currentClient: number = 0;
|
||||||
public constructor(props: IProps) {
|
public constructor(props: IProps) {
|
||||||
super(props);
|
super(props);
|
||||||
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);
|
||||||
@ -31,17 +34,13 @@ export default class ClientDashboard extends Base<IProps, IState> {
|
|||||||
|
|
||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<DefaultTemplate title={"Mon compte"} isPadding={false}>
|
<DefaultTemplate title={"Mon compte"} isPadding={false} hasHeaderLinks={false}>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
{this.renderHeader()}
|
{this.renderHeader()}
|
||||||
<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 +68,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 +82,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 +96,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">
|
||||||
|
<Button className={classes["button"]}>Contacter mon notaire</Button>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -105,9 +106,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({});
|
||||||
|
const mockedCustomer = mockedCustomers[this.currentClient]!;
|
||||||
|
|
||||||
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 +118,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 = {
|
||||||
|
@ -20,6 +20,7 @@ import React from "react";
|
|||||||
import BasePage from "../../Base";
|
import BasePage from "../../Base";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import OcrResult from "./OcrResult";
|
import OcrResult from "./OcrResult";
|
||||||
|
import Files from "@Front/Api/LeCoffreApi/SuperAdmin/Files/Files";
|
||||||
|
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
@ -90,7 +91,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className={classes["file-container"]}>
|
<div className={classes["file-container"]}>
|
||||||
<FilePreview href={this.state.selectedFile.file_path 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
|
||||||
@ -199,7 +200,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
private downloadFile() {
|
private downloadFile() {
|
||||||
const fileName = this.state.selectedFile?.file_path?.split("/").pop();
|
const fileName = this.state.selectedFile?.file_path?.split("/").pop();
|
||||||
fetch(this.state.selectedFile?.file_path as string)
|
fetch(Files.getInstance().getUploadLink(this.state.selectedFile?.uid as string))
|
||||||
.then((resp) => resp.blob())
|
.then((resp) => resp.blob())
|
||||||
.then((blob) => {
|
.then((blob) => {
|
||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
@ -10,7 +10,7 @@ import { useRouter } from "next/router";
|
|||||||
//import React, { useEffect, useState } from "react";
|
//import React, { useEffect, useState } from "react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
//import Loader from "@Front/Components/DesignSystem/Loader";
|
//import Loader from "@Front/Components/DesignSystem/Loader";
|
||||||
import Auth from "@Front/Api/Auth/IdNot";
|
//import Auth from "@Front/Api/Auth/IdNot";
|
||||||
import Folder from "../Folder";
|
import Folder from "../Folder";
|
||||||
import LoginClass from "../Login";
|
import LoginClass from "../Login";
|
||||||
|
|
||||||
@ -75,15 +75,15 @@ export default function LoginCallBack(props: IPropsClass) {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { code } = router.query;
|
const { code } = router.query;
|
||||||
if (code) {
|
if (code) {
|
||||||
const getIdNotJwt = async () => {
|
// const getIdNotJwt = async () => {
|
||||||
try {
|
// try {
|
||||||
const authService = Auth.getInstance();
|
// const authService = Auth.getInstance();
|
||||||
await authService.getIdnotJwt(code);
|
// await authService.getIdnotJwt(code);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.error(error);
|
// console.error(error);
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
getIdNotJwt();
|
//getIdNotJwt();
|
||||||
return <Folder {...props} />;
|
return <Folder {...props} />;
|
||||||
}
|
}
|
||||||
return <LoginClass {...props} />;
|
return <LoginClass {...props} />;
|
||||||
|
@ -6,6 +6,8 @@ import Image from "next/image";
|
|||||||
import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage";
|
import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage";
|
||||||
import FranceConnectIcon from "./france-connect.svg";
|
import FranceConnectIcon from "./france-connect.svg";
|
||||||
import ExportIcon from "@Assets/Icons/export.svg";
|
import ExportIcon from "@Assets/Icons/export.svg";
|
||||||
|
import { FrontendVariables } from "@Front/Config/VariablesFront";
|
||||||
|
import cryptoRandomString from "crypto-random-string";
|
||||||
|
|
||||||
export default class LoginCustomer extends BasePage {
|
export default class LoginCustomer extends BasePage {
|
||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
@ -35,12 +37,12 @@ export default class LoginCustomer extends BasePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private redirectUserOnConnection() {
|
private redirectUserOnConnection() {
|
||||||
// const variables = FrontendVariables.getInstance();
|
const variables = FrontendVariables.getInstance();
|
||||||
// const baseFronturl =
|
// const baseFronturl =
|
||||||
// variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST + (variables.FRONT_APP_PORT ? ":" + variables.FRONT_APP_PORT : "");
|
// variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST + (variables.FRONT_APP_PORT ? ":" + variables.FRONT_APP_PORT : "");
|
||||||
// const authorizeEndPoint = variables.IDNOT_AUTHORIZE_ENDPOINT;
|
const authorizeEndPoint = variables.FC_AUTHORIZE_ENDPOINT;
|
||||||
// const clientId = variables.IDNOT_CLIENT_ID;
|
const clientId = variables.FC_CLIENT_ID;
|
||||||
// const url = `${authorizeEndPoint}?client_id=${clientId}&redirect_uri=${baseFronturl}/authorized-client&scope=openid,profile,offline_access&response_type=code`;
|
const url = `${authorizeEndPoint}?client_id=${clientId}&redirect_uri=http://localhost:8080/login-callback&scope=openid&response_type=code&state=${cryptoRandomString({length: 64})}&nonce=${cryptoRandomString({length: 64})}&acr_values=eidas1`;
|
||||||
// window.location.assign(url);
|
window.location.assign(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,10 @@ 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" disabled />
|
<InputField name="name" fakeplaceholder="Nom" type="text" defaultValue={"TEXIER"} disabled />
|
||||||
<InputField name="surname" fakeplaceholder="Prénom" type="text" disabled />
|
<InputField name="surname" fakeplaceholder="Prénom" type="text" defaultValue={"Gwendal"} disabled />
|
||||||
<InputField name="email" fakeplaceholder="E-mail" type="email" disabled />
|
<InputField name="email" fakeplaceholder="E-mail" type="email" defaultValue={"g.texier@notaires.fr"} disabled />
|
||||||
<InputField name="phone" fakeplaceholder="Numéro de téléphone" type="tel" 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,11 +42,12 @@ 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"
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
<InputField name="crpcen" fakeplaceholder="CRPCEN" type="number" disabled />
|
<InputField name="crpcen" fakeplaceholder="CRPCEN" type="number" defaultValue="04839284" disabled />
|
||||||
<InputField name="cp_address" fakeplaceholder="Adresse CP" type="text" 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" disabled />
|
<InputField name="city" fakeplaceholder="Ville" type="text" defaultValue="35340 LIFFRE" disabled />
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,6 +19,10 @@ export class FrontendVariables {
|
|||||||
|
|
||||||
public KEY_DATA!: string;
|
public KEY_DATA!: string;
|
||||||
|
|
||||||
|
public FC_AUTHORIZE_ENDPOINT!: string;
|
||||||
|
|
||||||
|
public FC_CLIENT_ID!: string;
|
||||||
|
|
||||||
private constructor() {}
|
private constructor() {}
|
||||||
|
|
||||||
public static getInstance(): FrontendVariables {
|
public static getInstance(): FrontendVariables {
|
||||||
|
@ -20,6 +20,8 @@ type AppPropsWithLayout = AppProps & {
|
|||||||
frontAppPort: string;
|
frontAppPort: string;
|
||||||
idNotAuthorizeEndpoint: string;
|
idNotAuthorizeEndpoint: string;
|
||||||
idNotClientId: string;
|
idNotClientId: string;
|
||||||
|
fcAuthorizeEndpoint: string;
|
||||||
|
fcClientId: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const MyApp = (({
|
const MyApp = (({
|
||||||
@ -33,31 +35,38 @@ const MyApp = (({
|
|||||||
frontAppPort,
|
frontAppPort,
|
||||||
idNotAuthorizeEndpoint,
|
idNotAuthorizeEndpoint,
|
||||||
idNotClientId,
|
idNotClientId,
|
||||||
|
fcAuthorizeEndpoint,
|
||||||
|
fcClientId
|
||||||
}: AppPropsWithLayout) => {
|
}: AppPropsWithLayout) => {
|
||||||
const getLayout = Component.getLayout ?? ((page) => <DefaultLayout children={page}></DefaultLayout>);
|
const getLayout = Component.getLayout ?? ((page) => <DefaultLayout children={page}></DefaultLayout>);
|
||||||
|
|
||||||
FrontendVariables.getInstance().BACK_API_PROTOCOL = backApiProtocol;
|
const instance = FrontendVariables.getInstance();
|
||||||
FrontendVariables.getInstance().BACK_API_HOST = backApiHost;
|
instance.BACK_API_PROTOCOL = backApiProtocol;
|
||||||
FrontendVariables.getInstance().BACK_API_ROOT_URL = backApiRootUrl;
|
instance.BACK_API_HOST = backApiHost;
|
||||||
FrontendVariables.getInstance().BACK_API_VERSION = backApiVersion;
|
instance.BACK_API_ROOT_URL = backApiRootUrl;
|
||||||
FrontendVariables.getInstance().FRONT_APP_HOST = frontAppHost;
|
instance.BACK_API_VERSION = backApiVersion;
|
||||||
FrontendVariables.getInstance().FRONT_APP_PORT = frontAppPort;
|
instance.FRONT_APP_HOST = frontAppHost;
|
||||||
FrontendVariables.getInstance().IDNOT_AUTHORIZE_ENDPOINT = idNotAuthorizeEndpoint;
|
instance.FRONT_APP_PORT = frontAppPort;
|
||||||
FrontendVariables.getInstance().IDNOT_CLIENT_ID = idNotClientId;
|
instance.IDNOT_AUTHORIZE_ENDPOINT = idNotAuthorizeEndpoint;
|
||||||
|
instance.IDNOT_CLIENT_ID = idNotClientId;
|
||||||
|
instance.FC_AUTHORIZE_ENDPOINT= fcAuthorizeEndpoint;
|
||||||
|
instance.FC_CLIENT_ID = fcClientId
|
||||||
|
|
||||||
return getLayout(<Component {...pageProps} />);
|
return getLayout(<Component {...pageProps} />);
|
||||||
}) as AppType;
|
}) as AppType;
|
||||||
|
|
||||||
MyApp.getInitialProps = async () => {
|
MyApp.getInitialProps = async () => {
|
||||||
return {
|
return {
|
||||||
backApiProtocol: process.env["BACK_API_PROTOCOL"],
|
backApiProtocol: process.env["NEXT_PUBLIC_BACK_API_PROTOCOL"],
|
||||||
backApiHost: process.env["BACK_API_HOST"],
|
backApiHost: process.env["NEXT_PUBLIC_BACK_API_HOST"],
|
||||||
backApiRootUrl: process.env["BACK_API_ROOT_URL"],
|
backApiRootUrl: process.env["NEXT_PUBLIC_BACK_API_ROOT_URL"],
|
||||||
backApiVersion: process.env["BACK_API_VERSION"],
|
backApiVersion: process.env["NEXT_PUBLIC_BACK_API_VERSION"],
|
||||||
frontAppHost: process.env["FRONT_APP_HOST"],
|
frontAppHost: process.env["NEXT_PUBLIC_FRONT_APP_HOST"],
|
||||||
frontAppPort: process.env["FRONT_APP_PORT"],
|
frontAppPort: process.env["NEXT_PUBLIC_FRONT_APP_PORT"],
|
||||||
idNotAuthorizeEndpoint: process.env["IDNOT_AUTHORIZE_ENDPOINT"],
|
idNotAuthorizeEndpoint: process.env["NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT"],
|
||||||
idNotClientId: process.env["IDNOT_CLIENT_ID"],
|
idNotClientId: process.env["NEXT_PUBLIC_IDNOT_CLIENT_ID"],
|
||||||
|
fcAuthorizeEndpoint: process.env["NEXT_PUBLIC_FC_AUTHORIZE_ENDPOINT"],
|
||||||
|
fcClientId: process.env["NEXT_PUBLIC_FC_CLIENT_ID"]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
5
src/pages/login-callback.tsx
Normal file
5
src/pages/login-callback.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
|
||||||
|
|
||||||
|
export default function Route() {
|
||||||
|
return <ClientDashboard />;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user