From a90c52167a84d47dae44d8d091757737c0e41368 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 27 Apr 2023 11:41:55 +0200 Subject: [PATCH 1/9] Get, getbyUid, restore folder and archive folder --- .../LeCoffreApi/SuperAdmin/Folders/Folders.ts | 127 ++++++++++++++++++ .../FolderBoxInformation/index.tsx | 1 + .../DefaultNotaryDashboard/index.tsx | 32 +++-- .../FolderInformation/ClientSection/index.tsx | 3 +- .../Folder/FolderInformation/index.tsx | 46 +++++-- .../FolderInformation/index.tsx | 43 ++++-- 6 files changed, 213 insertions(+), 39 deletions(-) create mode 100644 src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts new file mode 100644 index 00000000..5e0e41c9 --- /dev/null +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts @@ -0,0 +1,127 @@ +import { Service } from "typedi"; +import { OfficeFolder } from "le-coffre-resources/dist/Notary"; +import BaseSuperAdmin from "../BaseSuperAdmin"; +import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder"; + +// TODO Type get query params -> Where + inclue + orderby +export interface IGetFoldersParams { + q?: {}; +} + +// TODO Type getbyuid query params + +export type IPutFoldersParams = { + uid?: OfficeFolder["uid"]; + folder_number?: OfficeFolder["folder_number"]; + name?: OfficeFolder["name"]; + description?: OfficeFolder["description"]; + archived_description?: OfficeFolder["archived_description"]; + status?: OfficeFolder["status"]; +}; + +@Service() +export default class Folders extends BaseSuperAdmin { + private static instance: Folders; + private readonly baseURl = this.namespaceUrl.concat("/folders"); + + private constructor() { + super(); + } + + public static getInstance() { + if (!this.instance) { + return new this(); + } else { + return this.instance; + } + } + + /** + * @description : Get all folders + */ + public async get(q: IGetFoldersParams): Promise { + const url = new URL(this.baseURl); + Object.entries(q).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value))); + try { + return await this.getRequest(url); + } catch (err) { + this.onError(err); + return Promise.reject(err); + } + } + + /** + * @description : Get a folder by uid + */ + public async getByUid(uid: string, q?: any): Promise { + const url = new URL(this.baseURl.concat(`/${uid}`)); + if (q) Object.entries(q).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value))); + try { + return await this.getRequest(url); + } catch (err) { + this.onError(err); + return Promise.reject(err); + } + } + + /** + * @description : Create a folder + */ + // public async post(body: IPostFoldersParams): Promise { + // const url = new URL(this.baseURl); + // try { + // return await this.postRequest(url, body); + // } catch (err) { + // this.onError(err); + // return Promise.reject(err); + // } + // } + + /** + * @description : Update the folder description + */ + public async put(uid: string, body: IPutFoldersParams): Promise { + const url = new URL(this.baseURl.concat(`/${uid}`)); + try { + return await this.putRequest(url, body); + } catch (err) { + this.onError(err); + return Promise.reject(err); + } + } + + /** + * @description : Delete a folder only if the folder don't contains customers + */ + public async delete(uid: string): Promise { + const url = new URL(this.baseURl.concat(`/${uid}`)); + const targetedFolder = await this.getByUid(uid); + if (targetedFolder.office_folder_has_customers) return Promise.reject(`The folder ${uid} contains customers`); + try { + return await this.deleteRequest(url); + } catch (err) { + this.onError(err); + return Promise.reject(err); + } + } + + public async archive(uid: string, body: IPutFoldersParams): Promise { + body.status = EFolderStatus.ARCHIVED; + try { + return await this.put(uid, body); + } catch (err) { + this.onError(err); + return Promise.reject(err); + } + } + + public async restore(uid: string, body: IPutFoldersParams): Promise { + body.status = EFolderStatus.LIVE; + try { + return await this.put(uid, body); + } catch (err) { + this.onError(err); + return Promise.reject(err); + } + } +} diff --git a/src/front/Components/DesignSystem/FolderBoxInformation/index.tsx b/src/front/Components/DesignSystem/FolderBoxInformation/index.tsx index de2e85d5..ca63f75d 100644 --- a/src/front/Components/DesignSystem/FolderBoxInformation/index.tsx +++ b/src/front/Components/DesignSystem/FolderBoxInformation/index.tsx @@ -85,6 +85,7 @@ export default function FolderBoxInformation(props: IProps) { function formatDate(date: Date | null): string { if (!date) return "..."; + if (!(date instanceof Date)) date = new Date(date); return date.toLocaleDateString("fr-FR", { year: "numeric", month: "long", diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx index 1b20db23..8170b030 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx @@ -6,8 +6,6 @@ import FolderListContainer from "@Front/Components/DesignSystem/FolderListContai import Header from "@Front/Components/DesignSystem/Header"; import Version from "@Front/Components/DesignSystem/Version"; import BackArrow from "@Front/Components/Elements/BackArrow"; -import { folders } from "@Front/Components/Layouts/DesignSystem/dummyData"; -import { foldersArchived } from "@Front/Components/Layouts/DesignSystem/dummyData"; import WindowStore from "@Front/Stores/WindowStore"; import classNames from "classnames"; import { OfficeFolder } from "le-coffre-resources/dist/Customer"; @@ -15,7 +13,8 @@ import Image from "next/image"; import React, { ReactNode } from "react"; import classes from "./classes.module.scss"; - +import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; +import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder"; type IProps = { title: string; @@ -42,6 +41,7 @@ export type IDashBoardFolder = { created_at: OfficeFolder["created_at"]; office_folder_has_customers?: OfficeFolder["office_folder_has_customers"]; archived_description: OfficeFolder["archived_description"]; + status: OfficeFolder["status"]; }; export default class DefaultNotaryDashboard extends React.Component { @@ -108,17 +108,23 @@ export default class DefaultNotaryDashboard extends React.Component this.onResize(window)); - /** - * We set folders state according to the isArchived props - * TODO: Front connexion we need to get from bdd - */ - if (this.props.isArchived) { - this.setState({ folders: foldersArchived }); - } else { - this.setState({ folders: folders }); - } + let targetedStatus: EFolderStatus = EFolderStatus["LIVE" as keyof typeof EFolderStatus]; + if (this.props.isArchived) targetedStatus = EFolderStatus.ARCHIVED; + const query: IGetFoldersParams = { + q: { + where: { status: targetedStatus }, + include: { + deed: { include: { deed_type: true } }, + office: true, + office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, + }, + }, + }; + + const folders = await Folders.getInstance().get(query); + this.setState({ folders: folders }); } public override componentWillUnmount() { this.onWindowResize(); diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx index b0d4b830..6b6f6ac8 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx @@ -57,6 +57,7 @@ export default class ClientSection extends React.Component { } private doesFolderHaveCustomer(): boolean { - return this.props.folder.office_folder_has_customers !== undefined; + if (!this.props.folder?.office_folder_has_customers) return false; + return this.props.folder?.office_folder_has_customers!.length > 0; } } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index bc2ef367..e1ad4324 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -7,17 +7,20 @@ import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField" import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; import QuantityProgressBar from "@Front/Components/DesignSystem/QuantityProgressBar"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; -import { folders } from "@Front/Components/Layouts/DesignSystem/dummyData"; import DefaultNotaryDashboard, { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; import Module from "@Front/Config/Module"; import Link from "next/link"; -import { useRouter } from "next/router"; +import { NextRouter, useRouter } from "next/router"; import BasePage from "../../Base"; import classes from "./classes.module.scss"; import ClientSection from "./ClientSection"; +import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; +import { OfficeFolder } from "le-coffre-resources/dist/Customer"; +import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder"; - -type IProps = {}; +type IProps = { + router: NextRouter; +}; type IPropsClass = IProps & { selectedFolderUid: string; @@ -37,6 +40,7 @@ class FolderInformationClass extends BasePage { this.onSelectedFolder = this.onSelectedFolder.bind(this); this.openArchivedModal = this.openArchivedModal.bind(this); this.closeArchivedModal = this.closeArchivedModal.bind(this); + this.onArchivedModalAccepted = this.onArchivedModalAccepted.bind(this); } // TODO: Message if the user has not created any folder yet @@ -85,6 +89,7 @@ class FolderInformationClass extends BasePage { { ); } public override async componentDidMount() { - for (const folder of folders) { - if (folder.uid === this.props.selectedFolderUid) { - this.setState({ selectedFolder: folder }); - break; - } - } + this.setState({ + selectedFolder: await this.getFolder(), + }); } private doesFolderHaveCustomer(): boolean { - return this.state.selectedFolder?.office_folder_has_customers !== undefined; + if (!this.state.selectedFolder?.office_folder_has_customers) return false; + return this.state.selectedFolder?.office_folder_has_customers!.length > 0; } private onSelectedFolder(folder: IDashBoardFolder): void { @@ -134,11 +137,30 @@ class FolderInformationClass extends BasePage { private closeArchivedModal(): void { this.setState({ isArchivedModalOpen: false }); } + + private async onArchivedModalAccepted() { + if (!this.state.selectedFolder) return; + await Folders.getInstance().archive(this.state.selectedFolder.uid, this.state.selectedFolder); + this.closeArchivedModal(); + this.props.router.push(Module.getInstance().get().modules.pages.Folder.props.path); + } + + private async getFolder(): Promise { + const query = { + q: { + deed: { include: { deed_type: "true" } }, + office: "true", + office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, + }, + }; + const folder = await Folders.getInstance().getByUid(this.props.selectedFolderUid, query); + return folder; + } } export default function FolderInformation(props: IProps) { const router = useRouter(); let { folderUid } = router.query; folderUid = folderUid as string; - return ; + return ; } diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index 1e249bfb..2f8812c7 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -5,15 +5,20 @@ import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation"; import QuantityProgressBar from "@Front/Components/DesignSystem/QuantityProgressBar"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; -import { folders } from "@Front/Components/Layouts/DesignSystem/dummyData"; import DefaultNotaryDashboard, { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; -import { useRouter } from "next/router"; +import { NextRouter, useRouter } from "next/router"; import BasePage from "../../Base"; import classes from "./classes.module.scss"; import ClientSection from "./ClientSection"; +import { OfficeFolder } from "le-coffre-resources/dist/Customer"; +import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; +import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder"; +import Module from "@Front/Config/Module"; -type IProps = {}; +type IProps = { + router: NextRouter; +}; type IPropsClass = IProps & { selectedFolderUid: string; @@ -33,6 +38,7 @@ class FolderInformationClass extends BasePage { this.onSelectedFolder = this.onSelectedFolder.bind(this); this.openArchivedModal = this.openArchivedModal.bind(this); this.closeArchivedModal = this.closeArchivedModal.bind(this); + this.restoreFolder = this.restoreFolder.bind(this); } // TODO: Message if the user has not created any folder yet @@ -101,13 +107,8 @@ class FolderInformationClass extends BasePage { ); } public override async componentDidMount() { - // TODO : GET Current folder from the api - for (const folder of folders) { - if (folder.uid === this.props.selectedFolderUid) { - this.setState({ selectedFolder: folder }); - break; - } - } + const folder = await this.getFolder(); + this.setState({ selectedFolder: folder }); } private doesFolderHaveCustomer(): boolean { @@ -118,8 +119,12 @@ class FolderInformationClass extends BasePage { this.setState({ selectedFolder: folder }); } - private restoreFolder() {} - // should call the api to restore the folder + private async restoreFolder() { + if (!this.state.selectedFolder) return; + 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); + } + private openArchivedModal(): void { this.setState({ isArchivedModalOpen: true }); } @@ -127,11 +132,23 @@ class FolderInformationClass extends BasePage { private closeArchivedModal(): void { this.setState({ isArchivedModalOpen: false }); } + + private async getFolder(): Promise { + const query = { + q: { + deed: { include: { deed_type: "true" } }, + office: "true", + office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, + }, + }; + const folder = await Folders.getInstance().getByUid(this.props.selectedFolderUid, query); + return folder; + } } export default function FolderInformation(props: IProps) { const router = useRouter(); let { folderUid } = router.query; folderUid = folderUid as string; - return ; + return ; } From ef0667b7cf9226bc113d37865f4a46b5a666455a Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 27 Apr 2023 11:43:32 +0200 Subject: [PATCH 2/9] resolve build issues --- .../Components/Layouts/Folder/FolderInformation/index.tsx | 6 ++---- .../Layouts/FolderArchived/FolderInformation/index.tsx | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index e1ad4324..1a0af8c3 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -16,13 +16,11 @@ import classes from "./classes.module.scss"; import ClientSection from "./ClientSection"; import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import { OfficeFolder } from "le-coffre-resources/dist/Customer"; -import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder"; -type IProps = { - router: NextRouter; -}; +type IProps = {}; type IPropsClass = IProps & { + router: NextRouter; selectedFolderUid: string; }; diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index 2f8812c7..db23e6e6 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -13,14 +13,12 @@ import classes from "./classes.module.scss"; import ClientSection from "./ClientSection"; import { OfficeFolder } from "le-coffre-resources/dist/Customer"; import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; -import { EFolderStatus } from "le-coffre-resources/dist/Customer/OfficeFolder"; import Module from "@Front/Config/Module"; -type IProps = { - router: NextRouter; -}; +type IProps = {}; type IPropsClass = IProps & { + router: NextRouter; selectedFolderUid: string; }; From db2c09798daf659bf8c7f8c4890fdc59d50d64fc Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Thu, 27 Apr 2023 14:58:04 +0200 Subject: [PATCH 3/9] :bug: Removing console log --- src/front/Components/DesignSystem/FolderList/index.tsx | 2 +- .../DesignSystem/UserFolder/UserFolderHeader/index.tsx | 2 -- .../Components/Layouts/Folder/FolderInformation/index.tsx | 4 ++-- src/front/Components/Layouts/Folder/ViewDocuments/index.tsx | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/front/Components/DesignSystem/FolderList/index.tsx b/src/front/Components/DesignSystem/FolderList/index.tsx index cbb20bec..07bf0672 100644 --- a/src/front/Components/DesignSystem/FolderList/index.tsx +++ b/src/front/Components/DesignSystem/FolderList/index.tsx @@ -28,7 +28,7 @@ class FolderListClass extends React.Component { return (
{this.props.folders.sort((folder) => { - const pendingDocuments = folder.documents!.filter((document) => document.document_status === "PENDING"); + const pendingDocuments = (folder.documents ?? []).filter((document) => document.document_status === "PENDING"); return pendingDocuments.length >= 1 ? -1 : 1; }).map((folder) => { return ( diff --git a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx index 7c84edd4..86c1af88 100644 --- a/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/UserFolderHeader/index.tsx @@ -73,8 +73,6 @@ export default class UserFolderHeader extends React.Component { private hasPendingFiles(){ const documents = this.props.folder.documents?.filter((document) => document.depositor.contact.uid === this.props.contact.uid) ?? []; const notAskedDocuments = documents.filter((document) => document.document_status === "PENDING") ?? []; - console.log(this.props.contact.uid); - console.log(notAskedDocuments.length); return notAskedDocuments.length > 0; } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index 567cacc2..7227027d 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -158,8 +158,8 @@ class FolderInformationClass extends BasePage { private async getFolder(): Promise { const query = { q: { - deed: { include: { deed_type: "true" } }, - office: "true", + deed: { include: { deed_type: true } }, + office: true, office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, }, }; diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 811be98a..1744916c 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -280,7 +280,6 @@ export default function ViewDocuments(props: IProps) { let { folderUid, documentUid } = router.query; const folder = folders.find((folder) => folder.uid === folderUid) ?? null; - console.log(folder); const documents = folder?.documents!.filter((document) => document.document_status !== "ASKED") ?? []; const selectedDocument = documents.find((document) => document.uid === documentUid) ?? null; return ; From 699b85bc417b3c03979b7974a7db3c968e781368 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Thu, 27 Apr 2023 15:12:06 +0200 Subject: [PATCH 4/9] :sparkles: Replacing ' char --- .../Notifications/NotificationModal/index.tsx | 2 +- .../Components/Layouts/DesignSystem/index.tsx | 3 +- .../Layouts/Folder/CreateFolder/index.tsx | 2 +- .../FolderInformation/ClientSection/index.tsx | 2 +- .../UpdateFolderCollaborators/index.tsx | 2 +- .../Folder/UpdateFolderMetadata/index.tsx | 68 +++++++++++-------- .../UpdateFolderMetadata/index.tsx | 2 +- src/front/Components/Layouts/Login/index.tsx | 6 +- .../Layouts/LoginCallback/index.tsx | 4 +- 9 files changed, 51 insertions(+), 40 deletions(-) diff --git a/src/front/Components/DesignSystem/Header/Notifications/NotificationModal/index.tsx b/src/front/Components/DesignSystem/Header/Notifications/NotificationModal/index.tsx index 623bcdcf..183731ed 100644 --- a/src/front/Components/DesignSystem/Header/Notifications/NotificationModal/index.tsx +++ b/src/front/Components/DesignSystem/Header/Notifications/NotificationModal/index.tsx @@ -43,7 +43,7 @@ export default class NotificationModal extends React.Component { {Toasts.getInstance().toasts.length === 0 ? (
- Vous n’avez pas de notifications. + Vous n'avez pas de notifications.
) : ( diff --git a/src/front/Components/Layouts/DesignSystem/index.tsx b/src/front/Components/Layouts/DesignSystem/index.tsx index 18310c61..37765476 100644 --- a/src/front/Components/Layouts/DesignSystem/index.tsx +++ b/src/front/Components/Layouts/DesignSystem/index.tsx @@ -24,7 +24,6 @@ import Toasts, { IToast } from "@Front/Stores/Toasts"; import classes from "./classes.module.scss"; import { customer2, document, documentDeposited, documentPending, folder, folders, folderWithPendingDocument } from "./dummyData"; - type IState = { isModalDisplayed: boolean; selectedOption?: IOption; @@ -203,7 +202,7 @@ export default class DesignSystem extends BasePage { + - + defaultValue={this.state.selectedFolder?.created_at?.toString() as string} + /> */}
@@ -79,13 +87,27 @@ class UpdateFolderMetadataClass extends BasePage { ); } - public override componentDidMount(): void { + public override async componentDidMount() { + const folder = await this.getFolder(); this.setState({ + selectedFolder: folder, selectedOption: { - label: this.props.folder?.deed.deed_type?.name ?? "", - value: this.props.folder?.deed.deed_type?.uid ?? "", + label: folder?.deed.deed_type?.name ?? "", + value: folder?.deed.deed_type?.uid ?? "", }, - }); + }) + } + + private async getFolder(): Promise { + const query = { + q: { + deed: { include: { deed_type: true } }, + office: true, + office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, + }, + }; + const folder = await Folders.getInstance().getByUid(this.props.folderUid, query); + return folder; } private onSelectedOption(option: IOption) { @@ -99,19 +121,9 @@ class UpdateFolderMetadataClass extends BasePage { } } -export default function UpdateFolderMetadata() { +export default function UpdateFolderMetadata(props: IProps) { const router = useRouter(); let { folderUid } = router.query; folderUid = folderUid as string; - const folder = folders.find((folder) => folder.uid === folderUid) ?? null; - return ; -} - -function formatDate(date: Date | null): string { - if (!date) return "..."; - return date.toLocaleDateString("fr-FR", { - year: "numeric", - month: "long", - day: "numeric", - }); + return ; } diff --git a/src/front/Components/Layouts/FolderArchived/UpdateFolderMetadata/index.tsx b/src/front/Components/Layouts/FolderArchived/UpdateFolderMetadata/index.tsx index 21f3aa7f..710abc8b 100644 --- a/src/front/Components/Layouts/FolderArchived/UpdateFolderMetadata/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/UpdateFolderMetadata/index.tsx @@ -52,7 +52,7 @@ class UpdateFolderMetadataClass extends BasePage { }