🐛 Fixing every missing uid
This commit is contained in:
parent
f9cacdb2c1
commit
d8cbeb1178
778
package-lock.json
generated
778
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@
|
|||||||
"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",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.18",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.27",
|
||||||
"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,5 +1,5 @@
|
|||||||
import { Service } from "typedi";
|
import { Service } from "typedi";
|
||||||
import { Deed, DeedType } from "le-coffre-resources/dist/Notary";
|
import { DeedType } from "le-coffre-resources/dist/Notary";
|
||||||
import BaseSuperAdmin from "../BaseSuperAdmin";
|
import BaseSuperAdmin from "../BaseSuperAdmin";
|
||||||
|
|
||||||
// TODO Type get query params -> Where + inclue + orderby
|
// TODO Type get query params -> Where + inclue + orderby
|
||||||
|
@ -2,7 +2,6 @@ import { Service } from "typedi";
|
|||||||
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||||
import BaseSuperAdmin from "../BaseSuperAdmin";
|
import BaseSuperAdmin from "../BaseSuperAdmin";
|
||||||
import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder";
|
import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder";
|
||||||
import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
|
||||||
|
|
||||||
// TODO Type get query params -> Where + inclue + orderby
|
// TODO Type get query params -> Where + inclue + orderby
|
||||||
export interface IGetFoldersParams {
|
export interface IGetFoldersParams {
|
||||||
@ -69,11 +68,11 @@ export default class Folders extends BaseSuperAdmin {
|
|||||||
/**
|
/**
|
||||||
* @description : Get a folder by uid
|
* @description : Get a folder by uid
|
||||||
*/
|
*/
|
||||||
public async getByUid(uid: string, q?: any): Promise<IDashBoardFolder> {
|
public async getByUid(uid: string, q?: any): Promise<OfficeFolder> {
|
||||||
const url = new URL(this.baseURl.concat(`/${uid}`));
|
const url = new URL(this.baseURl.concat(`/${uid}`));
|
||||||
if (q) Object.entries(q).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
if (q) Object.entries(q).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||||
try {
|
try {
|
||||||
return await this.getRequest<IDashBoardFolder>(url);
|
return await this.getRequest<OfficeFolder>(url);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
|
@ -12,7 +12,7 @@ import classes from "./classes.module.scss";
|
|||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
document: {
|
document: {
|
||||||
uid: Document["uid"];
|
uid?: Document["uid"];
|
||||||
document_type: Document["document_type"];
|
document_type: Document["document_type"];
|
||||||
document_status: Document["document_status"];
|
document_status: Document["document_status"];
|
||||||
folder: Document["folder"];
|
folder: Document["folder"];
|
||||||
|
@ -25,10 +25,10 @@ export default function FolderBoxInformation(props: IProps) {
|
|||||||
const { isArchived = false, type } = props;
|
const { isArchived = false, type } = props;
|
||||||
const editDescriptionPath = Module.getInstance()
|
const editDescriptionPath = Module.getInstance()
|
||||||
.get()
|
.get()
|
||||||
.modules.pages.Folder.pages.EditDescription.props.path.replace("[folderUid]", props.folder.uid);
|
.modules.pages.Folder.pages.EditDescription.props.path.replace("[folderUid]", props.folder.uid ?? "");
|
||||||
const editInformationsPath = Module.getInstance()
|
const editInformationsPath = Module.getInstance()
|
||||||
.get()
|
.get()
|
||||||
.modules.pages.Folder.pages.EditInformations.props.path.replace("[folderUid]", props.folder.uid);
|
.modules.pages.Folder.pages.EditInformations.props.path.replace("[folderUid]", props.folder.uid ?? "");
|
||||||
|
|
||||||
const path = type === EFolderBoxInformationType.DESCRIPTION ? editDescriptionPath : editInformationsPath;
|
const path = type === EFolderBoxInformationType.DESCRIPTION ? editDescriptionPath : editInformationsPath;
|
||||||
return (
|
return (
|
||||||
|
@ -36,7 +36,7 @@ class FolderListClass extends React.Component<IPropsClass, IState> {
|
|||||||
onClick={this.props.onCloseLeftSide}
|
onClick={this.props.onCloseLeftSide}
|
||||||
key={folder.uid}
|
key={folder.uid}
|
||||||
className={folder.uid === this.props.selectedFolder ? classes["active"] : ""}>
|
className={folder.uid === this.props.selectedFolder ? classes["active"] : ""}>
|
||||||
<Link href={redirectPath.replace("[folderUid]", folder.uid)}>
|
<Link href={redirectPath.replace("[folderUid]", folder.uid ?? "")}>
|
||||||
<FolderContainer folder={folder} onSelectedFolder={this.props.onSelectedFolder} />;
|
<FolderContainer folder={folder} onSelectedFolder={this.props.onSelectedFolder} />;
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@ type IProps = {
|
|||||||
subtitle?: string;
|
subtitle?: string;
|
||||||
documents:
|
documents:
|
||||||
| {
|
| {
|
||||||
uid: Document["uid"];
|
uid?: Document["uid"];
|
||||||
document_type: Document["document_type"];
|
document_type: Document["document_type"];
|
||||||
document_status: Document["document_status"];
|
document_status: Document["document_status"];
|
||||||
folder: Document["folder"];
|
folder: Document["folder"];
|
||||||
|
@ -11,10 +11,10 @@ import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotar
|
|||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
contact: {
|
contact: {
|
||||||
uid: Contact["uid"];
|
uid?: Contact["uid"];
|
||||||
first_name: Contact["first_name"];
|
first_name: Contact["first_name"];
|
||||||
last_name: Contact["last_name"];
|
last_name: Contact["last_name"];
|
||||||
phone_number: Contact["phone_number"];
|
phone_number?: Contact["phone_number"];
|
||||||
cell_phone_number: Contact["cell_phone_number"];
|
cell_phone_number: Contact["cell_phone_number"];
|
||||||
email: Contact["email"];
|
email: Contact["email"];
|
||||||
};
|
};
|
||||||
@ -30,8 +30,8 @@ export default class UserFolderHeader extends React.Component<IProps, IState> {
|
|||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
const redirectPath = Module.getInstance()
|
const redirectPath = Module.getInstance()
|
||||||
.get()
|
.get()
|
||||||
.modules.pages.Folder.pages.EditClient.props.path.replace("[folderUid]", this.props.folder.uid)
|
.modules.pages.Folder.pages.EditClient.props.path.replace("[folderUid]", this.props.folder.uid ?? "")
|
||||||
.replace("[clientUid]", this.props.contact.uid);
|
.replace("[clientUid]", this.props.contact.uid ?? "");
|
||||||
return (
|
return (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
@ -48,7 +48,7 @@ export default class UserFolderHeader extends React.Component<IProps, IState> {
|
|||||||
<div className={classes["container"]}>
|
<div className={classes["container"]}>
|
||||||
<Typography typo={ITypo.NAV_INPUT_16}>Numéro de téléphone</Typography>
|
<Typography typo={ITypo.NAV_INPUT_16}>Numéro de téléphone</Typography>
|
||||||
<Typography typo={ITypo.P_18}>
|
<Typography typo={ITypo.P_18}>
|
||||||
{this.formatPhoneNumber(this.props.contact.phone_number) ??
|
{this.formatPhoneNumber(this.props.contact.phone_number ?? "") ??
|
||||||
this.formatPhoneNumber(this.props.contact.cell_phone_number)}
|
this.formatPhoneNumber(this.props.contact.cell_phone_number)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,7 +52,7 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
|||||||
const otherDocuments: Document[] | null = this.getValidatedAndPendindDocuments();
|
const otherDocuments: Document[] | null = this.getValidatedAndPendindDocuments();
|
||||||
const redirectPath = Module.getInstance()
|
const redirectPath = Module.getInstance()
|
||||||
.get()
|
.get()
|
||||||
.modules.pages.Folder.pages.AskDocument.props.path.replace("[folderUid]", this.props.folder.uid);
|
.modules.pages.Folder.pages.AskDocument.props.path.replace("[folderUid]", this.props.folder.uid ?? "");
|
||||||
return (
|
return (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<Confirm
|
<Confirm
|
||||||
@ -179,7 +179,7 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
|||||||
}, this.props.animationDelay);
|
}, this.props.animationDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
private openDeletionModal(uid: string): void {
|
private openDeletionModal(uid?: string): void {
|
||||||
// TODO: call API to delete document
|
// TODO: call API to delete document
|
||||||
this.setState({
|
this.setState({
|
||||||
isOpenDeletionModal: true,
|
isOpenDeletionModal: true,
|
||||||
|
@ -32,7 +32,7 @@ type IState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type IDashBoardFolder = {
|
export type IDashBoardFolder = {
|
||||||
uid: OfficeFolder["uid"];
|
uid?: OfficeFolder["uid"];
|
||||||
name: OfficeFolder["name"];
|
name: OfficeFolder["name"];
|
||||||
folder_number: OfficeFolder["folder_number"];
|
folder_number: OfficeFolder["folder_number"];
|
||||||
documents?: OfficeFolder["documents"];
|
documents?: OfficeFolder["documents"];
|
||||||
|
@ -72,6 +72,7 @@ export const docType: DocumentType = {
|
|||||||
public_description: "Acte de naissance public description",
|
public_description: "Acte de naissance public description",
|
||||||
private_description: "Acte de naissance private description",
|
private_description: "Acte de naissance private description",
|
||||||
archived_at: new Date(),
|
archived_at: new Date(),
|
||||||
|
office: office,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const identityDocType: DocumentType = {
|
export const identityDocType: DocumentType = {
|
||||||
@ -82,6 +83,7 @@ export const identityDocType: DocumentType = {
|
|||||||
public_description: "Carte d'identité public description",
|
public_description: "Carte d'identité public description",
|
||||||
private_description: "Carte d'identité private description",
|
private_description: "Carte d'identité private description",
|
||||||
archived_at: new Date(),
|
archived_at: new Date(),
|
||||||
|
office: office,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const customer: Customer = {
|
export const customer: Customer = {
|
||||||
|
@ -17,7 +17,7 @@ import { Deed, DeedType, OfficeFolder, OfficeFolderHasStakeholder } from "le-cof
|
|||||||
import DeedTypes from "@Front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes";
|
import DeedTypes from "@Front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes";
|
||||||
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
||||||
import User from "le-coffre-resources/dist/Notary";
|
import User from "le-coffre-resources/dist/Notary";
|
||||||
import Folders, { IPostFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||||
import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder";
|
import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder";
|
||||||
|
|
||||||
type IFormValues = {
|
type IFormValues = {
|
||||||
|
@ -17,7 +17,7 @@ export default class ClientSection extends React.Component<IProps, IState> {
|
|||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
const navigatePath = Module.getInstance()
|
const navigatePath = Module.getInstance()
|
||||||
.get()
|
.get()
|
||||||
.modules.pages.Folder.pages.AddClient.props.path.replace("[folderUid]", this.props.folder.uid);
|
.modules.pages.Folder.pages.AddClient.props.path.replace("[folderUid]", this.props.folder.uid ?? "");
|
||||||
return (
|
return (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
{this.doesFolderHaveCustomer() ? (
|
{this.doesFolderHaveCustomer() ? (
|
||||||
|
@ -150,7 +150,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
private async onArchivedModalAccepted() {
|
private async onArchivedModalAccepted() {
|
||||||
if (!this.state.selectedFolder) return;
|
if (!this.state.selectedFolder) return;
|
||||||
await Folders.getInstance().archive(this.state.selectedFolder.uid, this.state.selectedFolder);
|
await Folders.getInstance().archive(this.state.selectedFolder.uid ?? "", this.state.selectedFolder);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
private async restoreFolder() {
|
private async restoreFolder() {
|
||||||
if (!this.state.selectedFolder) return;
|
if (!this.state.selectedFolder) return;
|
||||||
await Folders.getInstance().restore(this.state.selectedFolder.uid, this.state.selectedFolder);
|
await Folders.getInstance().restore(this.state.selectedFolder.uid ?? "", this.state.selectedFolder);
|
||||||
this.props.router.push(Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.props.path);
|
this.props.router.push(Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.props.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user