Merge Dev in Staging
This commit is contained in:
commit
0fd6c35f10
28
package-lock.json
generated
28
package-lock.json
generated
@ -22,7 +22,7 @@
|
|||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.84",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.85",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
@ -394,9 +394,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint-community/regexpp": {
|
"node_modules/@eslint-community/regexpp": {
|
||||||
"version": "4.8.2",
|
"version": "4.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.0.tgz",
|
||||||
"integrity": "sha512-0MGxAVt1m/ZK+LTJp/j0qF7Hz97D9O/FH9Ms3ltnyIdDD57cbb1ACIQTkbHvNXtWDv5TPq7w5Kq56+cNukbo7g==",
|
"integrity": "sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
||||||
}
|
}
|
||||||
@ -1016,9 +1016,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/react-transition-group": {
|
"node_modules/@types/react-transition-group": {
|
||||||
"version": "4.4.6",
|
"version": "4.4.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.7.tgz",
|
||||||
"integrity": "sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==",
|
"integrity": "sha512-ICCyBl5mvyqYp8Qeq9B5G/fyBSRC0zx3XM3sCC6KkcMsNeAHqXBKkmat4GqdJET5jtYUpZXrxI5flve5qhi2Eg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/react": "*"
|
"@types/react": "*"
|
||||||
}
|
}
|
||||||
@ -1507,9 +1507,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001539",
|
"version": "1.0.30001541",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001539.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz",
|
||||||
"integrity": "sha512-hfS5tE8bnNiNvEOEkm8HElUHroYwlqMMENEzELymy77+tJ6m+gA2krtHl5hxJaj71OlpC2cHZbdSMX1/YEqEkA==",
|
"integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@ -3361,7 +3361,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/le-coffre-resources": {
|
"node_modules/le-coffre-resources": {
|
||||||
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#e28887de459d0820c732bd4eed3c422a4b3aad90",
|
"resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#0e1663716a698cc584a89e5e2a03b72113702d55",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
@ -3382,9 +3382,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/libphonenumber-js": {
|
"node_modules/libphonenumber-js": {
|
||||||
"version": "1.10.44",
|
"version": "1.10.45",
|
||||||
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.44.tgz",
|
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.45.tgz",
|
||||||
"integrity": "sha512-svlRdNBI5WgBjRC20GrCfbFiclbF0Cx+sCcQob/C1r57nsoq0xg8r65QbTyVyweQIlB33P+Uahyho6EMYgcOyQ=="
|
"integrity": "sha512-eeHcvGafEYCaKB4fo2uBINfG7j7PcGwBHUaTVfbwl/6KcjCgIKNlIOsSXVRp9BH10NQwmvvk+nQ1e/Yp4BGB7w=="
|
||||||
},
|
},
|
||||||
"node_modules/lines-and-columns": {
|
"node_modules/lines-and-columns": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.84",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.85",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
import Customer, { Contact } from "le-coffre-resources/dist/Customer";
|
|
||||||
|
|
||||||
import BaseCustomer from "../BaseCustomer";
|
|
||||||
import { ECivility } from "le-coffre-resources/dist/Customer/Contact";
|
|
||||||
|
|
||||||
// TODO Type get query params -> Where + inclue + orderby
|
|
||||||
export interface IGetCustomersparams {
|
|
||||||
where?: {};
|
|
||||||
include?: {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO Type getbyuid query params
|
|
||||||
|
|
||||||
export type IPutCustomersParams = {
|
|
||||||
uid?: Customer["uid"];
|
|
||||||
contact?: Customer["contact"];
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface IPostCustomersParams {
|
|
||||||
first_name: string;
|
|
||||||
last_name: string;
|
|
||||||
email: string;
|
|
||||||
cell_phone_number: string;
|
|
||||||
civility: ECivility;
|
|
||||||
address?: Contact["address"];
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class Customers extends BaseCustomer {
|
|
||||||
private static instance: Customers;
|
|
||||||
private readonly baseURl = this.namespaceUrl.concat("/customers");
|
|
||||||
|
|
||||||
private constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static getInstance() {
|
|
||||||
if (!this.instance) {
|
|
||||||
return new this();
|
|
||||||
} else {
|
|
||||||
return this.instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async get(q: IGetCustomersparams): Promise<Customer[]> {
|
|
||||||
const url = new URL(this.baseURl);
|
|
||||||
const query = { q };
|
|
||||||
Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
|
||||||
try {
|
|
||||||
return await this.getRequest<Customer[]>(url);
|
|
||||||
} catch (err) {
|
|
||||||
this.onError(err);
|
|
||||||
return Promise.reject(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getByUid(uid: string, q?: any): Promise<Customer> {
|
|
||||||
const url = new URL(this.baseURl.concat(`/${uid}`));
|
|
||||||
const query = { q };
|
|
||||||
if (q) Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
|
||||||
try {
|
|
||||||
return await this.getRequest<Customer>(url);
|
|
||||||
} catch (err) {
|
|
||||||
this.onError(err);
|
|
||||||
return Promise.reject(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
import BaseNotary from "../BaseCustomer";
|
|
||||||
import User from "le-coffre-resources/dist/Notary";
|
|
||||||
|
|
||||||
export default class Users extends BaseNotary {
|
|
||||||
private static instance: Users;
|
|
||||||
private readonly baseURl = this.namespaceUrl.concat("/Users");
|
|
||||||
|
|
||||||
private constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static getInstance() {
|
|
||||||
if (!this.instance) {
|
|
||||||
return new Users();
|
|
||||||
} else {
|
|
||||||
return this.instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async get(): Promise<User[]> {
|
|
||||||
const url = new URL(this.baseURl);
|
|
||||||
try {
|
|
||||||
return await this.getRequest<User[]>(url);
|
|
||||||
} catch (err) {
|
|
||||||
this.onError(err);
|
|
||||||
return Promise.reject(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getOne(uid: string): Promise<User> {
|
|
||||||
const url = new URL(this.baseURl.concat("/").concat(uid));
|
|
||||||
try {
|
|
||||||
return await this.getRequest<User>(url);
|
|
||||||
} catch (err) {
|
|
||||||
this.onError(err);
|
|
||||||
return Promise.reject(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// public async post(params: User): Promise<User> {
|
|
||||||
// const url = new URL(this.baseURl);
|
|
||||||
// try {
|
|
||||||
// return await this.postRequest<User>(url, params);
|
|
||||||
// } catch (err) {
|
|
||||||
// this.onError(err);
|
|
||||||
// return Promise.reject(err);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
import BaseApiService from "@Front/Api/BaseApiService";
|
import BaseNotary from "../BaseNotary";
|
||||||
import { UserNotification } from "le-coffre-resources/dist/Notary";
|
import { UserNotification } from "le-coffre-resources/dist/Notary";
|
||||||
|
|
||||||
// TODO Type get query params -> Where + inclue + orderby
|
// TODO Type get query params -> Where + inclue + orderby
|
||||||
@ -12,9 +12,9 @@ export type IPutNotificationsParams = {
|
|||||||
read?: boolean;
|
read?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class Notifications extends BaseApiService {
|
export default class Notifications extends BaseNotary {
|
||||||
private static instance: Notifications;
|
private static instance: Notifications;
|
||||||
private baseUrl = this.getBaseUrl().concat("/notifications");
|
private baseUrl = this.namespaceUrl.concat("/notifications");
|
||||||
|
|
||||||
private constructor() {
|
private constructor() {
|
||||||
super();
|
super();
|
@ -26,4 +26,10 @@
|
|||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.right-side {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,13 @@ import classes from "./classes.module.scss";
|
|||||||
import Typography, { ITypo } from "../Typography";
|
import Typography, { ITypo } from "../Typography";
|
||||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
import WarningBadge from "../WarningBadge";
|
||||||
|
|
||||||
export type IBlock = {
|
export type IBlock = {
|
||||||
name: string;
|
name: string;
|
||||||
id: string;
|
id: string;
|
||||||
selected: boolean;
|
selected: boolean;
|
||||||
|
hasFlag?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
@ -30,7 +32,10 @@ export default function BlockList({ blocks, onSelectedBlock }: IProps) {
|
|||||||
<div className={classes["left-side"]}>
|
<div className={classes["left-side"]}>
|
||||||
<Typography typo={ITypo.P_16}>{folder.name}</Typography>
|
<Typography typo={ITypo.P_16}>{folder.name}</Typography>
|
||||||
</div>
|
</div>
|
||||||
<Image alt="chevron" src={ChevronIcon} />
|
<div className={classes["right-side"]}>
|
||||||
|
{folder.hasFlag && <WarningBadge />}
|
||||||
|
<Image alt="chevron" src={ChevronIcon} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -108,6 +108,7 @@ class FolderListContainerClass extends React.Component<IPropsClass, IState> {
|
|||||||
id: folder.uid!,
|
id: folder.uid!,
|
||||||
name: folder.folder_number! + " - " + folder.name!,
|
name: folder.folder_number! + " - " + folder.name!,
|
||||||
selected: this.props.selectedFolder === folder.uid,
|
selected: this.props.selectedFolder === folder.uid,
|
||||||
|
hasFlag: folder.documents?.some((document) => document.document_status === EDocumentStatus.DEPOSITED),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import classes from "./classes.module.scss";
|
|||||||
import Rules, { RulesMode } from "@Front/Components/Elements/Rules";
|
import Rules, { RulesMode } from "@Front/Components/Elements/Rules";
|
||||||
import { AppRuleActions, AppRuleNames } from "@Front/Api/Entities/rule";
|
import { AppRuleActions, AppRuleNames } from "@Front/Api/Entities/rule";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import Notifications from "@Front/Api/LeCoffreApi/Notifications/Notifications";
|
import Notifications from "@Front/Api/LeCoffreApi/Notary/Notifications/Notifications";
|
||||||
import Toasts from "@Front/Stores/Toasts";
|
import Toasts from "@Front/Stores/Toasts";
|
||||||
export default function Navigation() {
|
export default function Navigation() {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import Customers from "@Front/Api/LeCoffreApi/Customer/Customers/Customers";
|
|
||||||
import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/Customer/Documents/Documents";
|
import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/Customer/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";
|
||||||
@ -10,7 +9,7 @@ import React, { useCallback, useEffect, useState } from "react";
|
|||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import JwtService from "@Front/Services/JwtService/JwtService";
|
import JwtService, { ICustomerJwtPayload } from "@Front/Services/JwtService/JwtService";
|
||||||
import DepositOtherDocument from "@Front/Components/DesignSystem/DepositOtherDocument";
|
import DepositOtherDocument from "@Front/Components/DesignSystem/DepositOtherDocument";
|
||||||
import Folders from "@Front/Api/LeCoffreApi/Customer/Folders/Folders";
|
import Folders from "@Front/Api/LeCoffreApi/Customer/Folders/Folders";
|
||||||
|
|
||||||
@ -25,15 +24,15 @@ export default function ClientDashboard(props: IProps) {
|
|||||||
const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState<boolean>(false);
|
const [isAddDocumentModalVisible, setIsAddDocumentModalVisible] = useState<boolean>(false);
|
||||||
|
|
||||||
const getDocuments = useCallback(async () => {
|
const getDocuments = useCallback(async () => {
|
||||||
let jwt;
|
let jwt: ICustomerJwtPayload | undefined;;
|
||||||
if (typeof document !== "undefined") {
|
if (typeof document !== "undefined") {
|
||||||
jwt = JwtService.getInstance().decodeJwt();
|
jwt = JwtService.getInstance().decodeCustomerJwt();
|
||||||
}
|
}
|
||||||
if (!jwt || !jwt.email) return;
|
|
||||||
const customers = await Customers.getInstance().get({
|
const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } });
|
||||||
where: { contact: { email: jwt.email }, office_folders: { some: { uid: folderUid } } },
|
console.log(folder)
|
||||||
});
|
const actualCustomer = folder?.customers?.find((customer) => customer.uid === jwt?.customerId);
|
||||||
const actualCustomer: Customer = customers[0]!;
|
if(!actualCustomer) throw new Error("Customer not found");
|
||||||
|
|
||||||
const query: IGetDocumentsparams = {
|
const query: IGetDocumentsparams = {
|
||||||
where: { depositor: { uid: actualCustomer.uid }, folder_uid: folderUid as string },
|
where: { depositor: { uid: actualCustomer.uid }, folder_uid: folderUid as string },
|
||||||
@ -47,7 +46,8 @@ export default function ClientDashboard(props: IProps) {
|
|||||||
|
|
||||||
const documentList = await Documents.getInstance().get(query);
|
const documentList = await Documents.getInstance().get(query);
|
||||||
|
|
||||||
const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true } });
|
//const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } });
|
||||||
|
|
||||||
setFolder(folder);
|
setFolder(folder);
|
||||||
setDocuments(documentList);
|
setDocuments(documentList);
|
||||||
setCustomer(actualCustomer);
|
setCustomer(actualCustomer);
|
||||||
@ -67,7 +67,6 @@ export default function ClientDashboard(props: IProps) {
|
|||||||
}, [folderUid, getDocuments]);
|
}, [folderUid, getDocuments]);
|
||||||
|
|
||||||
const renderHeader = useCallback(() => {
|
const renderHeader = useCallback(() => {
|
||||||
console.log("Dossier : ", customer);
|
|
||||||
return (
|
return (
|
||||||
<div className={classes["header"]}>
|
<div className={classes["header"]}>
|
||||||
<div className={classes["text-container"]}>
|
<div className={classes["text-container"]}>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import Customers from "@Front/Api/LeCoffreApi/Customer/Customers/Customers";
|
//import Customers from "@Front/Api/LeCoffreApi/Customer/Customers/Customers";
|
||||||
import Documents, { IGetDocumentsparams } from "@Front/Api/LeCoffreApi/Customer/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 TextField from "@Front/Components/DesignSystem/Form/TextField";
|
import TextField from "@Front/Components/DesignSystem/Form/TextField";
|
||||||
@ -11,7 +10,6 @@ import Customer, { Document, DocumentType } from "le-coffre-resources/dist/Custo
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import JwtService from "@Front/Services/JwtService/JwtService";
|
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
type IState = {
|
type IState = {
|
||||||
@ -109,27 +107,27 @@ 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 jwt = JwtService.getInstance().decodeJwt();
|
// const jwt = JwtService.getInstance().decodeJwt();
|
||||||
const mockedCustomers = await Customers.getInstance().get({
|
// const mockedCustomers = await Customers.getInstance().get({
|
||||||
where: { contact: { email: jwt?.email } },
|
// where: { contact: { email: jwt?.email } },
|
||||||
});
|
// });
|
||||||
const mockedCustomer: Customer = mockedCustomers[0]!;
|
// const mockedCustomer: Customer = mockedCustomers[0]!;
|
||||||
|
|
||||||
const query: IGetDocumentsparams = {
|
// const query: IGetDocumentsparams = {
|
||||||
where: { depositor: { uid: mockedCustomer.uid } },
|
// where: { depositor: { uid: mockedCustomer.uid } },
|
||||||
include: {
|
// include: {
|
||||||
files: true,
|
// files: true,
|
||||||
document_history: true,
|
// document_history: true,
|
||||||
document_type: true,
|
// document_type: true,
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
const documents: Document[] = await Documents.getInstance().get(query);
|
// const documents: Document[] = await Documents.getInstance().get(query);
|
||||||
this.setState({ documents, mockedCustomer });
|
// this.setState({ documents, mockedCustomer });
|
||||||
}
|
// }
|
||||||
|
|
||||||
private onCloseModalAddDocument() {
|
private onCloseModalAddDocument() {
|
||||||
this.setState({ isAddDocumentModalVisible: false });
|
this.setState({ isAddDocumentModalVisible: false });
|
||||||
|
@ -274,7 +274,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
if (!uid) return;
|
if (!uid) return;
|
||||||
|
|
||||||
const anchor = await OfficeFolderAnchors.getInstance().get(uid);
|
const anchor = await OfficeFolderAnchors.getInstance().get(uid);
|
||||||
if (anchor.transactions[0].status !== "VERIFIED_ON_CHAIN") return;
|
if (anchor.status !== "VERIFIED_ON_CHAIN") return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const file: Blob = await OfficeFolderAnchors.getInstance().download(uid);
|
const file: Blob = await OfficeFolderAnchors.getInstance().download(uid);
|
||||||
|
@ -15,7 +15,6 @@ 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 Files from "@Front/Api/LeCoffreApi/Notary/Files/Files";
|
import Files from "@Front/Api/LeCoffreApi/Notary/Files/Files";
|
||||||
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
|
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
|
||||||
|
|
||||||
|
@ -116,10 +116,9 @@ export default class MyAccount extends Base<IProps, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override async componentDidMount() {
|
public override async componentDidMount() {
|
||||||
const jwtUncoded = JwtService.getInstance().decodeCustomerJwt();
|
const jwtDecoded = JwtService.getInstance().decodeJwt();
|
||||||
console.log(jwtUncoded);
|
if (!jwtDecoded) return;
|
||||||
if (!jwtUncoded) return;
|
const user = await Users.getInstance().getByUid(jwtDecoded.userId, {
|
||||||
const user = await Users.getInstance().getByUid(jwtUncoded.userId, {
|
|
||||||
q: {
|
q: {
|
||||||
office_membership: {
|
office_membership: {
|
||||||
include: {
|
include: {
|
||||||
|
@ -45,7 +45,11 @@ export default function RolesInformations(props: IProps) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules = await Rules.getInstance().get({});
|
const rules = await Rules.getInstance().get({
|
||||||
|
where: {
|
||||||
|
namespace: "notary",
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!role) return;
|
if (!role) return;
|
||||||
setRoleSelected(role);
|
setRoleSelected(role);
|
||||||
if (!role.rules) return;
|
if (!role.rules) return;
|
||||||
@ -124,7 +128,6 @@ export default function RolesInformations(props: IProps) {
|
|||||||
label: "Tout sélectionner",
|
label: "Tout sélectionner",
|
||||||
value: "all",
|
value: "all",
|
||||||
}}
|
}}
|
||||||
toolTip="Tout sélectionner"
|
|
||||||
onChange={handleSelectAllChange}
|
onChange={handleSelectAllChange}
|
||||||
checked={selectAll}
|
checked={selectAll}
|
||||||
/>
|
/>
|
||||||
|
@ -25,7 +25,7 @@ export default function SelectFolder() {
|
|||||||
where: {
|
where: {
|
||||||
customers: {
|
customers: {
|
||||||
some: {
|
some: {
|
||||||
uid: jwt.userId || (jwt as any).customerId,
|
uid: jwt.customerId || (jwt as any).customerId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,7 @@ export interface IUserJwtPayload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ICustomerJwtPayload {
|
export interface ICustomerJwtPayload {
|
||||||
userId: string;
|
customerId: string;
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import Notifications from "@Front/Api/LeCoffreApi/Notifications/Notifications";
|
import Notifications from "@Front/Api/LeCoffreApi/Notary/Notifications/Notifications";
|
||||||
import EventEmitter from "@Front/Services/EventEmitter";
|
import EventEmitter from "@Front/Services/EventEmitter";
|
||||||
// import I18n from "Components/Elements/I18n";
|
// import I18n from "Components/Elements/I18n";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user