From 3c92a0e9abd922149f824c84ec623a83fdba3800 Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Thu, 11 May 2023 16:10:51 +0200 Subject: [PATCH] :art: fix 4 client dashboard --- .../Layouts/ClientDashboard/index.tsx | 9 +++++---- .../Layouts/Folder/ViewDocuments/index.tsx | 17 +++++++++-------- src/pages/client-dashboard.tsx | 2 +- src/pages/client-dashboard1.tsx | 5 +++++ src/pages/client-dashboard2.tsx | 5 +++++ src/pages/client-dashboard3.tsx | 5 +++++ src/pages/login-callback.tsx | 2 +- 7 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 src/pages/client-dashboard1.tsx create mode 100644 src/pages/client-dashboard2.tsx create mode 100644 src/pages/client-dashboard3.tsx diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index f2ba8bf4..ca89171b 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -12,7 +12,9 @@ import Customers from "@Front/Api/LeCoffreApi/SuperAdmin/Customers/Customers"; import Customer, { Document } from "le-coffre-resources/dist/Customer"; import { document } from "./../../../Components/Layouts/DesignSystem/dummyData"; -type IProps = {}; +type IProps = { + targetedCustormer: string; // MOCK +}; type IState = { isAddDocumentModalVisible: boolean; documents: Document[]; @@ -20,7 +22,6 @@ type IState = { }; export default class ClientDashboard extends Base { - private currentClient: number = 14; public constructor(props: IProps) { super(props); this.state = { @@ -106,8 +107,8 @@ export default class ClientDashboard extends Base { public override async componentDidMount() { // TODO Get documents of the current customer according to userStore // REMOVE this mock - const mockedCustomers = await Customers.getInstance().get({}); - const mockedCustomer = mockedCustomers[this.currentClient]!; + const mockedCustomers = await Customers.getInstance().get({ where: { contact: { email: this.props.targetedCustormer } } }); + const mockedCustomer: Customer = mockedCustomers[0]!; const query: IGetDocumentsparams = { where: { depositor: { uid: mockedCustomer.uid } }, diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 9db8c4fd..68b41f2e 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -1,4 +1,3 @@ - import LeftArrowIcon from "@Assets/Icons/left-arrow.svg"; import RightArrowIcon from "@Assets/Icons/right-arrow.svg"; import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; @@ -22,7 +21,6 @@ import classes from "./classes.module.scss"; import OcrResult from "./OcrResult"; import Files from "@Front/Api/LeCoffreApi/SuperAdmin/Files/Files"; - type IProps = {}; type IPropsClass = { documentUid: string; @@ -76,7 +74,7 @@ class ViewDocumentsClass extends BasePage { {this.state.document && this.state.document.files && this.state.selectedFile && (
- App 23 rue Torus Toulon + {this.state.document.document_type?.name} {this.state.document.document_type?.name} @@ -91,7 +89,10 @@ class ViewDocumentsClass extends BasePage {
)}
- +
{this.state.document.files.length > 1 && (
{ return index < this.state.document!.files!.length; } - private async refuseDocument(){ - try{ + private async refuseDocument() { + try { await Documents.getInstance().put(this.props.documentUid, { document_status: EDocumentStatus.REFUSED, - refused_reason: this.state.refuseText + refused_reason: this.state.refuseText, }); this.props.router.push( @@ -280,7 +281,7 @@ class ViewDocumentsClass extends BasePage { .get() .modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid), ); - }catch(e){ + } catch (e) { console.error(e); } } diff --git a/src/pages/client-dashboard.tsx b/src/pages/client-dashboard.tsx index eb839556..931db6d5 100644 --- a/src/pages/client-dashboard.tsx +++ b/src/pages/client-dashboard.tsx @@ -1,5 +1,5 @@ import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; export default function Route() { - return ; + return ; } diff --git a/src/pages/client-dashboard1.tsx b/src/pages/client-dashboard1.tsx new file mode 100644 index 00000000..9c2082f6 --- /dev/null +++ b/src/pages/client-dashboard1.tsx @@ -0,0 +1,5 @@ +import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; + +export default function Route() { + return ; +} diff --git a/src/pages/client-dashboard2.tsx b/src/pages/client-dashboard2.tsx new file mode 100644 index 00000000..3f09fb4f --- /dev/null +++ b/src/pages/client-dashboard2.tsx @@ -0,0 +1,5 @@ +import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; + +export default function Route() { + return ; +} diff --git a/src/pages/client-dashboard3.tsx b/src/pages/client-dashboard3.tsx new file mode 100644 index 00000000..d4f29e4f --- /dev/null +++ b/src/pages/client-dashboard3.tsx @@ -0,0 +1,5 @@ +import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; + +export default function Route() { + return ; +} diff --git a/src/pages/login-callback.tsx b/src/pages/login-callback.tsx index eb839556..931db6d5 100644 --- a/src/pages/login-callback.tsx +++ b/src/pages/login-callback.tsx @@ -1,5 +1,5 @@ import ClientDashboard from "@Front/Components/Layouts/ClientDashboard"; export default function Route() { - return ; + return ; }