Merge Dev in Staging
This commit is contained in:
commit
f03de33e74
@ -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.89",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.90",
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
@ -27,7 +27,6 @@ export default class User extends BaseApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async verifyJwt(jwt: string) {
|
public async verifyJwt(jwt: string) {
|
||||||
console.log(this.baseURl);
|
|
||||||
const url = new URL(`${this.baseURl}/verify-token/${jwt}`);
|
const url = new URL(`${this.baseURl}/verify-token/${jwt}`);
|
||||||
try {
|
try {
|
||||||
return await this.postRequest(url);
|
return await this.postRequest(url);
|
||||||
|
@ -16,7 +16,6 @@ export default class Auth extends BaseApiService {
|
|||||||
public async logOutWithIdNot() {
|
public async logOutWithIdNot() {
|
||||||
const variables = FrontendVariables.getInstance();
|
const variables = FrontendVariables.getInstance();
|
||||||
const url = new URL(`${variables.IDNOT_BASE_URL}/user/auth/logout?post_logout_redirect_uri=${variables.FRONT_APP_HOST}`);
|
const url = new URL(`${variables.IDNOT_BASE_URL}/user/auth/logout?post_logout_redirect_uri=${variables.FRONT_APP_HOST}`);
|
||||||
console.log(url.toString())
|
|
||||||
try {
|
try {
|
||||||
return await fetch(url);
|
return await fetch(url);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { type OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import { type OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
|
|
||||||
import BaseNotary from "../BaseNotary";
|
import BaseNotary from "../BaseNotary";
|
||||||
import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
|
||||||
|
|
||||||
// TODO Type get query params -> Where + inclue + orderby
|
// TODO Type get query params -> Where + inclue + orderby
|
||||||
export interface IGetFoldersParams {
|
export interface IGetFoldersParams {
|
||||||
@ -97,20 +96,32 @@ export default class Folders extends BaseNotary {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async archive(uid: string, body: Partial<OfficeFolder>): Promise<OfficeFolder> {
|
public async archive(uid: string, archived_description: string): Promise<OfficeFolder> {
|
||||||
body.status = EFolderStatus.ARCHIVED;
|
|
||||||
try {
|
try {
|
||||||
return await this.put(uid, body);
|
const url = new URL(this.baseURl.concat(`/${uid}/archive`));
|
||||||
|
try {
|
||||||
|
return await this.putRequest(url, {
|
||||||
|
archived_description,
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async restore(uid: string, body: Partial<OfficeFolder>): Promise<OfficeFolder> {
|
public async restore(uid: string): Promise<OfficeFolder> {
|
||||||
body.status = EFolderStatus.LIVE;
|
|
||||||
try {
|
try {
|
||||||
return await this.put(uid, body);
|
const url = new URL(this.baseURl.concat(`/${uid}/restore`));
|
||||||
|
try {
|
||||||
|
return await this.putRequest(url);
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
|
@ -121,7 +121,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
{this.state.currentFiles && this.state.currentFiles.length > 0 && (
|
{this.state.currentFiles && this.state.currentFiles.length > 0 && (
|
||||||
<div className={classes["documents-container"]}>
|
<div className={classes["documents-container"]}>
|
||||||
{this.state.currentFiles.map((file) => {
|
{this.state.currentFiles.map((file) => {
|
||||||
console.log(file);
|
|
||||||
|
|
||||||
const fileObj = file.file;
|
const fileObj = file.file;
|
||||||
|
|
||||||
@ -237,9 +236,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
this.setState({
|
this.setState({
|
||||||
currentFiles: tmpArray,
|
currentFiles: tmpArray,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(this.state.currentFiles);
|
|
||||||
|
|
||||||
// const formData = new FormData();
|
// const formData = new FormData();
|
||||||
// formData.append("file", file, file.name);
|
// formData.append("file", file, file.name);
|
||||||
// const query = JSON.stringify({ document: { uid: this.props.document.uid } });
|
// const query = JSON.stringify({ document: { uid: this.props.document.uid } });
|
||||||
@ -272,7 +268,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
|||||||
private async removeFile(e: any) {
|
private async removeFile(e: any) {
|
||||||
const image = e.target as HTMLElement;
|
const image = e.target as HTMLElement;
|
||||||
const indexToRemove = image.getAttribute("data-file");
|
const indexToRemove = image.getAttribute("data-file");
|
||||||
console.log(indexToRemove);
|
|
||||||
|
|
||||||
if (!indexToRemove) return;
|
if (!indexToRemove) return;
|
||||||
const file = this.state.currentFiles!.find((file) => file.index === parseInt(indexToRemove));
|
const file = this.state.currentFiles!.find((file) => file.index === parseInt(indexToRemove));
|
||||||
|
@ -8,11 +8,13 @@ import React from "react";
|
|||||||
|
|
||||||
import Typography, { ITypo } from "../Typography";
|
import Typography, { ITypo } from "../Typography";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
|
import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
type: EFolderBoxInformationType;
|
type: EFolderBoxInformationType;
|
||||||
isArchived?: boolean;
|
isArchived?: boolean;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum EFolderBoxInformationType {
|
export enum EFolderBoxInformationType {
|
||||||
@ -34,7 +36,7 @@ export default function FolderBoxInformation(props: IProps) {
|
|||||||
return (
|
return (
|
||||||
<div className={classNames(classes["root"], type !== EFolderBoxInformationType.INFORMATIONS && classes["single-information"])}>
|
<div className={classNames(classes["root"], type !== EFolderBoxInformationType.INFORMATIONS && classes["single-information"])}>
|
||||||
<div className={classes["content"]}>{renderContentByType(props.folder, type)}</div>
|
<div className={classes["content"]}>{renderContentByType(props.folder, type)}</div>
|
||||||
{!isArchived && (
|
{!isArchived && props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<Link href={path} className={classes["edit-icon-container"]}>
|
<Link href={path} className={classes["edit-icon-container"]}>
|
||||||
<Image src={PenICon} alt="edit informations" />
|
<Image src={PenICon} alt="edit informations" />
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -16,6 +16,7 @@ import QuantityProgressBar from "../QuantityProgressBar";
|
|||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import DocumentList from "./DocumentList";
|
import DocumentList from "./DocumentList";
|
||||||
import UserFolderHeader from "./UserFolderHeader";
|
import UserFolderHeader from "./UserFolderHeader";
|
||||||
|
import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
customer: Customer;
|
customer: Customer;
|
||||||
@ -24,6 +25,7 @@ type IProps = {
|
|||||||
isArchived?: boolean;
|
isArchived?: boolean;
|
||||||
isOpened: boolean;
|
isOpened: boolean;
|
||||||
onChange: (id: string) => void;
|
onChange: (id: string) => void;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
isOpenDeletionModal: boolean;
|
isOpenDeletionModal: boolean;
|
||||||
@ -89,25 +91,35 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
|||||||
currentNumber={this.calculateDocumentsPercentageProgress()}
|
currentNumber={this.calculateDocumentsPercentageProgress()}
|
||||||
/>
|
/>
|
||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
<DocumentList
|
{this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
documents={documentsAsked}
|
<DocumentList
|
||||||
title="Documents demandés"
|
documents={documentsAsked}
|
||||||
openDeletionModal={this.openDeletionModal}
|
title="Documents demandés"
|
||||||
folderUid={this.props.folder.uid!}
|
openDeletionModal={this.openDeletionModal}
|
||||||
className={classes["documents-asked"]}
|
folderUid={this.props.folder.uid!}
|
||||||
/>
|
className={classes["documents-asked"]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<DocumentList
|
<DocumentList
|
||||||
documents={otherDocuments}
|
documents={otherDocuments}
|
||||||
title="Documents à valider / validés"
|
title={
|
||||||
|
this.props.anchorStatus !== AnchorStatus.NOT_ANCHORED
|
||||||
|
? "Documents validés"
|
||||||
|
: "Documents à valider / validés"
|
||||||
|
}
|
||||||
subtitle={
|
subtitle={
|
||||||
otherDocuments && otherDocuments?.length > 0
|
otherDocuments && otherDocuments?.length > 0
|
||||||
? "Vous avez des documents à valider."
|
? this.props.anchorStatus !== AnchorStatus.NOT_ANCHORED
|
||||||
|
? ""
|
||||||
|
: "Vous avez des documents à valider."
|
||||||
: "Vous n'avez aucun document à valider"
|
: "Vous n'avez aucun document à valider"
|
||||||
}
|
}
|
||||||
openDeletionModal={this.openDeletionModal}
|
openDeletionModal={this.openDeletionModal}
|
||||||
folderUid={this.props.folder.uid!}
|
folderUid={this.props.folder.uid!}
|
||||||
/>
|
/>
|
||||||
{!this.props.isArchived && (
|
|
||||||
|
{!this.props.isArchived && this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Link href={redirectPath}>
|
<Link href={redirectPath}>
|
||||||
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
||||||
|
@ -8,9 +8,11 @@ import Link from "next/link";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
|
import { AnchorStatus } from "..";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
openedCustomer: string;
|
openedCustomer: string;
|
||||||
@ -35,11 +37,13 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
{this.doesFolderHaveCustomer() ? (
|
{this.doesFolderHaveCustomer() ? (
|
||||||
<>
|
<>
|
||||||
<div className={classes["client"]}>{this.renderCustomerFolders()}</div>
|
<div className={classes["client"]}>{this.renderCustomerFolders()}</div>
|
||||||
<Link href={navigatePath}>
|
{this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
<Link href={navigatePath}>
|
||||||
Ajouter un client
|
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
||||||
</Button>
|
Ajouter un client
|
||||||
</Link>
|
</Button>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className={classes["no-client"]}>
|
<div className={classes["no-client"]}>
|
||||||
@ -48,11 +52,13 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
Aucun client n'est associé au dossier.
|
Aucun client n'est associé au dossier.
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<Link href={navigatePath}>
|
{this.props.anchorStatus === AnchorStatus.NOT_ANCHORED && (
|
||||||
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
<Link href={navigatePath}>
|
||||||
Ajouter un client
|
<Button variant={EButtonVariant.LINE} icon={PlusIcon}>
|
||||||
</Button>
|
Ajouter un client
|
||||||
</Link>
|
</Button>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -69,6 +75,7 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
key={customer.uid}
|
key={customer.uid}
|
||||||
isOpened={this.state.openedCustomer === customer.uid}
|
isOpened={this.state.openedCustomer === customer.uid}
|
||||||
onChange={this.changeUserFolder}
|
onChange={this.changeUserFolder}
|
||||||
|
anchorStatus={this.props.anchorStatus}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@ import ClientSection from "./ClientSection";
|
|||||||
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
||||||
import Loader from "@Front/Components/DesignSystem/Loader";
|
import Loader from "@Front/Components/DesignSystem/Loader";
|
||||||
|
|
||||||
enum AnchorStatus {
|
export enum AnchorStatus {
|
||||||
"VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN",
|
"VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN",
|
||||||
"ANCHORING" = "ANCHORING",
|
"ANCHORING" = "ANCHORING",
|
||||||
"NOT_ANCHORED" = "NOT_ANCHORED",
|
"NOT_ANCHORED" = "NOT_ANCHORED",
|
||||||
@ -97,11 +97,13 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.props.selectedFolder}
|
folder={this.props.selectedFolder}
|
||||||
type={EFolderBoxInformationType.INFORMATIONS}
|
type={EFolderBoxInformationType.INFORMATIONS}
|
||||||
/>
|
/>
|
||||||
<div className={classes["second-box"]}>
|
<div className={classes["second-box"]}>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.props.selectedFolder}
|
folder={this.props.selectedFolder}
|
||||||
type={EFolderBoxInformationType.DESCRIPTION}
|
type={EFolderBoxInformationType.DESCRIPTION}
|
||||||
/>
|
/>
|
||||||
@ -113,10 +115,14 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
currentNumber={this.getCompletionNumber()}
|
currentNumber={this.getCompletionNumber()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{this.doesFolderHaveCustomer() && <ClientSection folder={this.props.selectedFolder} />}
|
{this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection folder={this.props.selectedFolder} anchorStatus={this.props.isAnchored} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!this.doesFolderHaveCustomer() && <ClientSection folder={this.props.selectedFolder} />}
|
{!this.doesFolderHaveCustomer() && (
|
||||||
|
<ClientSection folder={this.props.selectedFolder} anchorStatus={this.props.isAnchored} />
|
||||||
|
)}
|
||||||
|
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Button variant={EButtonVariant.GHOST} onClick={this.openArchivedModal}>
|
<Button variant={EButtonVariant.GHOST} onClick={this.openArchivedModal}>
|
||||||
@ -389,9 +395,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
private async onArchivedModalAccepted() {
|
private async onArchivedModalAccepted() {
|
||||||
if (!this.props.selectedFolder) return;
|
if (!this.props.selectedFolder) return;
|
||||||
const ressourceFolder = OfficeFolder.hydrate<OfficeFolder>(this.props.selectedFolder);
|
await Folders.getInstance().archive(this.props.selectedFolder.uid ?? "", this.state.inputArchivedDescripton);
|
||||||
ressourceFolder.archived_description = this.state.inputArchivedDescripton;
|
|
||||||
await Folders.getInstance().archive(this.props.selectedFolder.uid ?? "", ressourceFolder);
|
|
||||||
this.closeArchivedModal();
|
this.closeArchivedModal();
|
||||||
this.props.router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
this.props.router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,11 @@ import classes from "./classes.module.scss";
|
|||||||
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
import UserFolder from "@Front/Components/DesignSystem/UserFolder";
|
import UserFolder from "@Front/Components/DesignSystem/UserFolder";
|
||||||
|
import { AnchorStatus } from "@Front/Components/Layouts/Folder/FolderInformation";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
folder: OfficeFolder;
|
folder: OfficeFolder;
|
||||||
|
anchorStatus: AnchorStatus;
|
||||||
};
|
};
|
||||||
type IState = {
|
type IState = {
|
||||||
openedCustomer: string;
|
openedCustomer: string;
|
||||||
@ -49,6 +51,7 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
key={customer.uid}
|
key={customer.uid}
|
||||||
isOpened={this.state.openedCustomer === customer.uid}
|
isOpened={this.state.openedCustomer === customer.uid}
|
||||||
onChange={this.changeUserFolder}
|
onChange={this.changeUserFolder}
|
||||||
|
anchorStatus={this.props.anchorStatus}
|
||||||
isArchived
|
isArchived
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -86,4 +86,16 @@
|
|||||||
.modal-title {
|
.modal-title {
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader-container {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
.loader {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
}
|
}
|
@ -13,12 +13,18 @@ import BasePage from "../../Base";
|
|||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import ClientSection from "./ClientSection";
|
import ClientSection from "./ClientSection";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { AnchorStatus } from "../../Folder/FolderInformation";
|
||||||
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
import OfficeFolderAnchors from "@Front/Api/LeCoffreApi/Notary/OfficeFolderAnchors/OfficeFolderAnchors";
|
||||||
|
import Loader from "@Front/Components/DesignSystem/Loader";
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
|
|
||||||
type IPropsClass = IProps & {
|
type IPropsClass = IProps & {
|
||||||
router: NextRouter;
|
router: NextRouter;
|
||||||
selectedFolderUid: string;
|
selectedFolderUid: string;
|
||||||
|
isLoading: boolean;
|
||||||
|
isAnchored: AnchorStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
type IState = {
|
type IState = {
|
||||||
@ -46,6 +52,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
.modules.pages.Folder.pages.EditCollaborators.props.path.replace("[folderUid]", this.props.selectedFolderUid);
|
.modules.pages.Folder.pages.EditCollaborators.props.path.replace("[folderUid]", this.props.selectedFolderUid);
|
||||||
return (
|
return (
|
||||||
<DefaultNotaryDashboard title={"Dossier"} onSelectedFolder={this.onSelectedFolder} isArchived={true}>
|
<DefaultNotaryDashboard title={"Dossier"} onSelectedFolder={this.onSelectedFolder} isArchived={true}>
|
||||||
|
{!this.props.isLoading && (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
{this.state.selectedFolder ? (
|
{this.state.selectedFolder ? (
|
||||||
<div className={classes["folder-informations"]}>
|
<div className={classes["folder-informations"]}>
|
||||||
@ -61,12 +68,14 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.state.selectedFolder}
|
folder={this.state.selectedFolder}
|
||||||
isArchived
|
isArchived
|
||||||
type={EFolderBoxInformationType.INFORMATIONS}
|
type={EFolderBoxInformationType.INFORMATIONS}
|
||||||
/>
|
/>
|
||||||
<div className={classes["second-box"]}>
|
<div className={classes["second-box"]}>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.state.selectedFolder}
|
folder={this.state.selectedFolder}
|
||||||
isArchived
|
isArchived
|
||||||
type={EFolderBoxInformationType.DESCRIPTION}
|
type={EFolderBoxInformationType.DESCRIPTION}
|
||||||
@ -74,6 +83,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</div>
|
</div>
|
||||||
<div className={classes["second-box"]}>
|
<div className={classes["second-box"]}>
|
||||||
<FolderBoxInformation
|
<FolderBoxInformation
|
||||||
|
anchorStatus={this.props.isAnchored}
|
||||||
folder={this.state.selectedFolder}
|
folder={this.state.selectedFolder}
|
||||||
isArchived
|
isArchived
|
||||||
type={EFolderBoxInformationType.ARCHIVED_DESCRIPTION}
|
type={EFolderBoxInformationType.ARCHIVED_DESCRIPTION}
|
||||||
@ -83,10 +93,10 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
<div className={classes["progress-bar"]}>
|
<div className={classes["progress-bar"]}>
|
||||||
<QuantityProgressBar title="Complétion du dossier" total={100} currentNumber={0} />
|
<QuantityProgressBar title="Complétion du dossier" total={100} currentNumber={0} />
|
||||||
</div>
|
</div>
|
||||||
{this.doesFolderHaveCustomer() && <ClientSection folder={this.state.selectedFolder} />}
|
{this.doesFolderHaveCustomer() && <ClientSection folder={this.state.selectedFolder} anchorStatus={this.props.isAnchored} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!this.doesFolderHaveCustomer() && <ClientSection folder={this.state.selectedFolder} />}
|
{!this.doesFolderHaveCustomer() && <ClientSection folder={this.state.selectedFolder} anchorStatus={this.props.isAnchored} />}
|
||||||
|
|
||||||
<div className={classes["button-container"]}>
|
<div className={classes["button-container"]}>
|
||||||
<Button variant={EButtonVariant.GHOST} onClick={this.restoreFolder}>
|
<Button variant={EButtonVariant.GHOST} onClick={this.restoreFolder}>
|
||||||
@ -105,6 +115,14 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
{this.props.isLoading && (
|
||||||
|
<div className={classes["loader-container"]}>
|
||||||
|
<div className={classes["loader"]}>
|
||||||
|
<Loader />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</DefaultNotaryDashboard>
|
</DefaultNotaryDashboard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -123,9 +141,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
private async restoreFolder() {
|
private async restoreFolder() {
|
||||||
if (!this.state.selectedFolder) return;
|
if (!this.state.selectedFolder) return;
|
||||||
const ressourceFolder = OfficeFolder.hydrate<OfficeFolder>(this.state.selectedFolder);
|
await Folders.getInstance().restore(this.state.selectedFolder.uid ?? "");
|
||||||
ressourceFolder.archived_description = null;
|
|
||||||
await Folders.getInstance().restore(this.state.selectedFolder.uid ?? "", ressourceFolder);
|
|
||||||
this.props.router.push(
|
this.props.router.push(
|
||||||
Module.getInstance()
|
Module.getInstance()
|
||||||
.get()
|
.get()
|
||||||
@ -156,7 +172,69 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
export default function FolderInformation(props: IProps) {
|
export default function FolderInformation(props: IProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [isAnchored, setIsAnchored] = useState<AnchorStatus>(AnchorStatus.NOT_ANCHORED);
|
||||||
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||||
|
const [selectedFolder, setSelectedFolder] = useState<OfficeFolder | null>(null);
|
||||||
|
|
||||||
let { folderUid } = router.query;
|
let { folderUid } = router.query;
|
||||||
folderUid = folderUid as string;
|
folderUid = folderUid as string;
|
||||||
return <FolderInformationClass {...props} selectedFolderUid={folderUid} router={router} />;
|
|
||||||
|
const getAnchoringStatus = useCallback(async () => {
|
||||||
|
if(!folderUid) return;
|
||||||
|
setIsLoading(true);
|
||||||
|
try {
|
||||||
|
const anchorStatus = await OfficeFolderAnchors.getInstance().getByUid(folderUid as string);
|
||||||
|
setIsAnchored(anchorStatus.status === "VERIFIED_ON_CHAIN" ? AnchorStatus.VERIFIED_ON_CHAIN : AnchorStatus.ANCHORING);
|
||||||
|
} catch (e) {
|
||||||
|
setIsAnchored(AnchorStatus.NOT_ANCHORED);
|
||||||
|
}
|
||||||
|
setIsLoading(false);
|
||||||
|
}, [folderUid]);
|
||||||
|
|
||||||
|
const getFolder = useCallback(async () => {
|
||||||
|
if (!folderUid) return;
|
||||||
|
setIsLoading(true);
|
||||||
|
const query = {
|
||||||
|
q: {
|
||||||
|
deed: { include: { deed_type: true } },
|
||||||
|
office: true,
|
||||||
|
customers: {
|
||||||
|
include: {
|
||||||
|
contact: true,
|
||||||
|
documents: {
|
||||||
|
include: {
|
||||||
|
folder: true,
|
||||||
|
document_type: true,
|
||||||
|
files: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
documents: {
|
||||||
|
include: {
|
||||||
|
depositor: {
|
||||||
|
include: {
|
||||||
|
contact: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
folder_anchor: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const folder = await Folders.getInstance().getByUid(folderUid as string, query);
|
||||||
|
if (folder) {
|
||||||
|
setSelectedFolder(folder);
|
||||||
|
getAnchoringStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsLoading(false);
|
||||||
|
}, [folderUid, getAnchoringStatus]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setIsLoading(true);
|
||||||
|
getFolder();
|
||||||
|
}, [getFolder]);
|
||||||
|
|
||||||
|
return <FolderInformationClass {...props} selectedFolderUid={folderUid} router={router} isLoading={isLoading} isAnchored={isAnchored} />;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ export default function LoginCallBack() {
|
|||||||
if (!code) return;
|
if (!code) return;
|
||||||
try {
|
try {
|
||||||
const token = await Auth.getInstance().getIdnotJwt(code as string);
|
const token = await Auth.getInstance().getIdnotJwt(code as string);
|
||||||
|
if (!token) return router.push(Module.getInstance().get().modules.pages.Login.props.path);
|
||||||
await UserStore.instance.connect(token.accessToken, token.refreshToken);
|
await UserStore.instance.connect(token.accessToken, token.refreshToken);
|
||||||
return router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
return router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -165,7 +165,7 @@ export default function UserInformations(props: IProps) {
|
|||||||
let vote = Vote.hydrate<Vote>({
|
let vote = Vote.hydrate<Vote>({
|
||||||
appointment: Appointment.hydrate<Appointment>({
|
appointment: Appointment.hydrate<Appointment>({
|
||||||
uid: currentAppointment?.uid ?? undefined,
|
uid: currentAppointment?.uid ?? undefined,
|
||||||
targeted_user: User.hydrate<User>({
|
user: User.hydrate<User>({
|
||||||
uid: userSelected.uid,
|
uid: userSelected.uid,
|
||||||
}),
|
}),
|
||||||
choice: superAdminModalType === "add" ? EVote.NOMINATE : EVote.DISMISS,
|
choice: superAdminModalType === "add" ? EVote.NOMINATE : EVote.DISMISS,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user