Merge branch 'dev' into staging

This commit is contained in:
Hugo Lextrait 2023-05-11 16:11:11 +02:00
commit f9f1010d9e
7 changed files with 31 additions and 14 deletions

View File

@ -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<IProps, IState> {
private currentClient: number = 14;
public constructor(props: IProps) {
super(props);
this.state = {
@ -106,8 +107,8 @@ export default class ClientDashboard extends Base<IProps, IState> {
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 } },

View File

@ -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<IPropsClass, IState> {
{this.state.document && this.state.document.files && this.state.selectedFile && (
<div className={classes["root"]}>
<Typography typo={ITypo.H1} color={ITypoColor.BLACK} className={classes["title"]}>
App 23 rue Torus Toulon
{this.state.document.document_type?.name}
</Typography>
<Typography typo={ITypo.H3} color={ITypoColor.BLACK} className={classes["subtitle"]}>
{this.state.document.document_type?.name}
@ -91,7 +89,10 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
</div>
)}
<div className={classes["file-container"]}>
<FilePreview href={Files.getInstance().getUploadLink(this.state.selectedFile?.uid as string)} key={this.state.selectedFile.uid} />
<FilePreview
href={Files.getInstance().getUploadLink(this.state.selectedFile?.uid as string)}
key={this.state.selectedFile.uid}
/>
</div>
{this.state.document.files.length > 1 && (
<div
@ -268,11 +269,11 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
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<IPropsClass, IState> {
.get()
.modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid),
);
}catch(e){
} catch (e) {
console.error(e);
}
}

View File

@ -1,5 +1,5 @@
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
export default function Route() {
return <ClientDashboard />;
return <ClientDashboard targetedCustormer="kevin.hautefaye@gmail.com" />;
}

View File

@ -0,0 +1,5 @@
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
export default function Route() {
return <ClientDashboard targetedCustormer="manon.simon@gmail.com" />;
}

View File

@ -0,0 +1,5 @@
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
export default function Route() {
return <ClientDashboard targetedCustormer="vincent.brognard@gmail.com" />;
}

View File

@ -0,0 +1,5 @@
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
export default function Route() {
return <ClientDashboard targetedCustormer="maxime.lalo@gmail.com" />;
}

View File

@ -1,5 +1,5 @@
import ClientDashboard from "@Front/Components/Layouts/ClientDashboard";
export default function Route() {
return <ClientDashboard />;
return <ClientDashboard targetedCustormer="kevin.hautefaye@gmail.com" />;
}