diff --git a/src/front/Assets/Icons/green-check.svg b/src/front/Assets/Icons/green-check.svg new file mode 100644 index 00000000..343eb84b --- /dev/null +++ b/src/front/Assets/Icons/green-check.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/front/Components/DesignSystem/DepositDocument/classes.module.scss b/src/front/Components/DesignSystem/DepositDocument/classes.module.scss index b270f875..9a4268f2 100644 --- a/src/front/Components/DesignSystem/DepositDocument/classes.module.scss +++ b/src/front/Components/DesignSystem/DepositDocument/classes.module.scss @@ -1,91 +1,104 @@ -.root { - padding: 24px; - background-color: var(--white); - border: 1px dashed #e7e7e7; +.container { - height: fit-content; - &[data-drag-over="true"] { - border: 1px dashed var(--grey); - } + .root { + padding: 24px; + background-color: var(--white); + border: 1px dashed #e7e7e7; - &.validated { - border: 1px dashed var(--green-flash); - } + height: fit-content; - .top-container { - display: flex; - align-items: center; - - .left { - margin-right: 28px; + &[data-drag-over="true"] { + border: 1px dashed var(--grey); } - .separator { - background-color: #939393; - width: 1px; - align-self: stretch; + &.validated { + border: 1px dashed var(--green-flash); } - .right { - margin-left: 18px; + .top-container { + display: flex; + align-items: center; - .refused-button { - font-size: 14px; - color: var(--re-hover); - margin-left: 8px; + .left { + margin-right: 28px; } - .title { + .separator { + background-color: #939393; + width: 1px; + align-self: stretch; + } + + .right { + margin-left: 18px; + + .validated { + color: var(--green-flash); + } + + .refused-button { + font-size: 14px; + color: var(--re-hover); + margin-left: 8px; + } + + .title { + display: flex; + align-items: center; + gap: 8px; + } + } + } + + .documents-container { + display: flex; + flex-direction: column; + gap: 16px; + margin-top: 16px; + + .file-container { display: flex; align-items: center; - gap: 8px; + justify-content: space-between; + + .left-part { + display: flex; + align-items: center; + gap: 8px; + } + + .cross { + cursor: pointer; + } } } + + .bottom-container { + margin-top: 16px; + + .add-button { + .add-document { + display: flex; + align-items: center; + gap: 14px; + } + } + } + + .text { + margin-bottom: 12px; + } } - .documents-container { + .modal-content { display: flex; flex-direction: column; gap: 16px; - margin-top: 16px; - - .file-container { - display: flex; - align-items: center; - justify-content: space-between; - - .left-part { - display: flex; - align-items: center; - gap: 8px; - } - - .cross { - cursor: pointer; - } - } } - .bottom-container { - margin-top: 16px; - - .add-button { - .add-document { - display: flex; - align-items: center; - gap: 14px; - } - } + .error-message { + color: var(--red-flash); + margin-top: 8px; } - - .text { - margin-bottom: 12px; - } -} - -.modal-content{ - display: flex; - flex-direction: column; - gap: 16px; } \ No newline at end of file diff --git a/src/front/Components/DesignSystem/DepositDocument/index.tsx b/src/front/Components/DesignSystem/DepositDocument/index.tsx index 80210dde..1c5a43be 100644 --- a/src/front/Components/DesignSystem/DepositDocument/index.tsx +++ b/src/front/Components/DesignSystem/DepositDocument/index.tsx @@ -15,6 +15,7 @@ import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; import classNames from "classnames"; import Confirm from "../Modal/Confirm"; import InputField from "../Form/Elements/InputField"; +import GreenCheckIcon from "@Assets/Icons/green-check.svg"; type IProps = { defaultFiles?: FileCustomer[]; @@ -65,87 +66,103 @@ export default class DepositDocument extends React.Component { public override render(): JSX.Element { return ( -
- -
-
- Deposit document -
-
-
- - {this.props.document.document_type?.name}{" "} - {this.props.document.document_type?.public_description !== "" && ( - - )} - - {this.props.document.document_status !== EDocumentStatus.VALIDATED && ( - - Sélectionnez des documents .jpg, .pdf ou .png - - )} - {this.props.document.document_history?.map((history) => ( -
{this.renderDocumentHistory(history)}
- ))} -
-
- {this.props.document.document_status !== EDocumentStatus.VALIDATED && this.state.files.length > 0 && ( -
- {this.state.files.map((file) => { - const fileObj = file.file; - if (file.archived) return; - return ( -
-
- Document check - - {this.shortName(fileObj.name)} - -
- Cross icon +
+
+ +
+
+ Deposit document +
+
+
+ +
+ {this.props.document.document_type?.name}
- ); - })} -
- )} - {this.props.document.document_status !== EDocumentStatus.VALIDATED && ( -
- + {this.props.document.document_status !== EDocumentStatus.VALIDATED && ( + + Sélectionnez des documents .jpg, .pdf ou .png + + )} + {this.props.document.document_history?.map((history) => ( +
{this.renderDocumentHistory(history)}
+ ))} +
+ {this.props.document.document_status !== EDocumentStatus.VALIDATED && this.state.files.length > 0 && ( +
+ {this.state.files.map((file) => { + const fileObj = file.file; + if (file.archived) return; + return ( +
+
+ Document check + + {this.shortName(fileObj.name)} + +
+ Cross icon +
+ ); + })} +
+ )} + {this.props.document.document_status !== EDocumentStatus.VALIDATED && ( +
+ +
+ )} + +
+ + Votre document a été refusé pour la raison suivante : + + +
+
+
+ {this.props.document.document_status === EDocumentStatus.REFUSED && ( + + Ce document n’est pas conforme. Veuillez le déposer à nouveau. + )} - -
- - Votre document a été refusé pour la raison suivante : - - -
-
); } diff --git a/src/front/Components/DesignSystem/FolderList/classes.module.scss b/src/front/Components/DesignSystem/FolderList/classes.module.scss index b6ca5e4f..d8013f29 100644 --- a/src/front/Components/DesignSystem/FolderList/classes.module.scss +++ b/src/front/Components/DesignSystem/FolderList/classes.module.scss @@ -2,7 +2,11 @@ .root { height: calc(100vh - 290px); - overflow: scroll; + overflow-y: scroll; + + &.archived{ + height: calc(100vh - 220px); + } .active { background-color: var(--grey-medium); diff --git a/src/front/Components/DesignSystem/FolderList/index.tsx b/src/front/Components/DesignSystem/FolderList/index.tsx index 871eb511..a472a435 100644 --- a/src/front/Components/DesignSystem/FolderList/index.tsx +++ b/src/front/Components/DesignSystem/FolderList/index.tsx @@ -7,6 +7,7 @@ import React from "react"; import FolderContainer from "../FolderContainer"; import classes from "./classes.module.scss"; +import classNames from "classnames"; type IProps = { folders: IDashBoardFolder[]; @@ -26,7 +27,7 @@ class FolderListClass extends React.Component { ? Module.getInstance().get().modules.pages.Folder.pages.FolderArchived.pages.FolderInformation.props.path : Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path; public override render(): JSX.Element { - return
{this.renderFolders()}
; + return
{this.renderFolders()}
; } private renderFolders(): JSX.Element[] { diff --git a/src/front/Components/DesignSystem/FolderListContainer/index.tsx b/src/front/Components/DesignSystem/FolderListContainer/index.tsx index 521122ba..2063cba5 100644 --- a/src/front/Components/DesignSystem/FolderListContainer/index.tsx +++ b/src/front/Components/DesignSystem/FolderListContainer/index.tsx @@ -1,4 +1,5 @@ import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; +import Module from "@Front/Config/Module"; import Link from "next/link"; import React from "react"; @@ -6,7 +7,6 @@ import Button from "../Button"; import FolderList from "../FolderList"; import SearchBar from "../SearchBar"; import classes from "./classes.module.scss"; -import Module from "@Front/Config/Module"; type IProps = { folders: IDashBoardFolder[]; @@ -44,13 +44,13 @@ export default class FolderListContainer extends React.Component />
-
- {!this.props.isArchived && ( + {!this.props.isArchived && ( +
- )} -
+
+ )}
); } diff --git a/src/front/Components/DesignSystem/UserFolder/index.tsx b/src/front/Components/DesignSystem/UserFolder/index.tsx index b3ce9b9d..2a95a9b8 100644 --- a/src/front/Components/DesignSystem/UserFolder/index.tsx +++ b/src/front/Components/DesignSystem/UserFolder/index.tsx @@ -49,7 +49,10 @@ export default class UserFolder extends React.Component { this.deleteAskedDocument = this.deleteAskedDocument.bind(this); } public override render(): JSX.Element { - const documentsAsked: Document[] | null = this.getDocumentsByStatus("ASKED"); + const documentsAsked: Document[] | null = [ + ...(this.getDocumentsByStatus("ASKED") ?? []), + ...(this.getDocumentsByStatus("REFUSED") ?? []), + ]; const otherDocuments: Document[] | null = this.getValidatedAndPendindDocuments(); const redirectPath = Module.getInstance() .get() @@ -111,9 +114,7 @@ export default class UserFolder extends React.Component { Demander un autre document{" "} - +
)}
diff --git a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx index c8835c17..6131e875 100644 --- a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx @@ -1,4 +1,7 @@ import PlusIcon from "@Assets/Icons/plus.svg"; +import Deeds from "@Front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds"; +import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; +import DocumentTypes from "@Front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes"; import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import CheckBox from "@Front/Components/DesignSystem/CheckBox"; @@ -9,16 +12,13 @@ import { IOption } from "@Front/Components/DesignSystem/Select"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; import BackArrow from "@Front/Components/Elements/BackArrow"; import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; +import Module from "@Front/Config/Module"; +import { OfficeFolder } from "le-coffre-resources/dist/Customer"; import { NextRouter, useRouter } from "next/router"; import React from "react"; import BasePage from "../../Base"; import classes from "./classes.module.scss"; -import Documents from "@Front/Api/LeCoffreApi/SuperAdmin/Documents/Documents"; -import Module from "@Front/Config/Module"; -import { OfficeFolder } from "le-coffre-resources/dist/Customer"; -import Deeds from "@Front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds"; -import DocumentTypes from "@Front/Api/LeCoffreApi/SuperAdmin/DocumentTypes/DocumentTypes"; type IProps = {}; type IPropsClass = IProps & { @@ -57,10 +57,13 @@ class AskDocumentsClass extends BasePage { } public override render(): JSX.Element { + const backUrl = Module.getInstance() + .get() + .modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid); return ( {}}>
- + Demander des documents @@ -87,9 +90,11 @@ class AskDocumentsClass extends BasePage {
- + + +
@@ -142,6 +147,12 @@ class AskDocumentsClass extends BasePage { }, }, office: true, + documents: { + include: { + depositor: true, + document_type: true, + }, + }, }, }); if (!folder) return; @@ -155,25 +166,29 @@ class AskDocumentsClass extends BasePage { } private async getAvailableDocuments(folder: OfficeFolder): Promise { - const documentTypes = await Deeds.getInstance().getByUid(folder.deed!.uid!, { - q: { - deed_has_document_types: { - include: { - document_type: true, - }, - }, - }, + const userDocumentTypesUids = folder + .documents!.filter((document) => document.depositor!.uid! === this.props.customerUid!) + .map((document) => { + return document.document_type!.uid!; + }); + const documentTypes = folder.deed!.deed_has_document_types!.filter((documentType) => { + if (userDocumentTypesUids.includes(documentType.document_type!.uid!)) return false; + return true; }); if (!documentTypes) return []; - const documentTypesOptions: IOption[] = documentTypes.deed_has_document_types!.map((documentType) => { - return { - label: documentType.document_type!.name!, - value: documentType.document_type!.uid!, - description: documentType.document_type!.private_description!, - }; - }); + const documentTypesOptions: IOption[] = documentTypes + .filter((documentType) => { + return true; + }) + .map((documentType) => { + return { + label: documentType.document_type!.name!, + value: documentType.document_type!.uid!, + description: documentType.document_type!.private_description!, + }; + }); return documentTypesOptions; } diff --git a/src/front/Components/Layouts/Folder/CreateFolder/background-image.jpeg b/src/front/Components/Layouts/Folder/CreateFolder/background-image.jpeg new file mode 100644 index 00000000..5e9b36e1 Binary files /dev/null and b/src/front/Components/Layouts/Folder/CreateFolder/background-image.jpeg differ diff --git a/src/front/Components/Layouts/Folder/CreateFolder/index.tsx b/src/front/Components/Layouts/Folder/CreateFolder/index.tsx index 205c61af..353784fc 100644 --- a/src/front/Components/Layouts/Folder/CreateFolder/index.tsx +++ b/src/front/Components/Layouts/Folder/CreateFolder/index.tsx @@ -1,4 +1,3 @@ -import RightImage from "@Front/Assets/images/create-folder/right-image.png"; import Button from "@Front/Components/DesignSystem/Button"; import Form from "@Front/Components/DesignSystem/Form"; import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"; @@ -19,6 +18,7 @@ import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; import User from "le-coffre-resources/dist/Notary"; import Folders, { IPostFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import { NextRouter, useRouter } from "next/router"; +import BackgroundImage from "./background-image.jpeg"; type IFormValues = { folder_number: string; @@ -73,7 +73,7 @@ class CreateFolderClass extends BasePage { public override render(): JSX.Element { return ( - +
@@ -137,11 +137,13 @@ class CreateFolderClass extends BasePage { const deedTypes = await DeedTypes.getInstance().get({ q: {} }); // TODO SETUP userStore and get the user's office membership -> Replace IwJ70M471c by the user's office membership uid - const usersMock = await Users.getInstance().get( { include: { office_membership: true } }); + const usersMock = await Users.getInstance().get({ include: { office_membership: true } }); const userMock = usersMock[0]; // ------------------- - const collaborators = await Users.getInstance().get( { where: { office_membership: { uid: userMock?.office_membership?.uid } }, include: { contact: true } }, - ); + const collaborators = await Users.getInstance().get({ + where: { office_membership: { uid: userMock?.office_membership?.uid } }, + include: { contact: true }, + }); this.setState({ deedTypes, deedTypesOptions: this.mapDeedOptions(deedTypes), @@ -222,7 +224,7 @@ class CreateFolderClass extends BasePage { /** * MOCK DATA */ - const usersMock = await Users.getInstance().get( { include: { office_membership: true }}); + const usersMock = await Users.getInstance().get({ include: { office_membership: true } }); const userMock = usersMock[0]; // ----- if (!selectedDeedTypeUid) return; diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index 402b8a52..589eadbd 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -123,7 +123,7 @@ class FolderInformationClass extends BasePage { Informations du dossier
- Vous n'avez aucun dossier archivés + Sélectionnez un dossier
diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index 677b0260..69c260a9 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -104,7 +104,7 @@ class ViewDocumentsClass extends BasePage { )}
- {this.state.document?.document_type?.name === "Carte d'identité" && ( + {this.state.document?.document_type?.name === "Document d'identité" && (
@@ -148,7 +148,7 @@ class ViewDocumentsClass extends BasePage { Anchoring animation
- +
)} diff --git a/src/front/Components/Layouts/Folder/index.tsx b/src/front/Components/Layouts/Folder/index.tsx index ce73a13d..89aed8ef 100644 --- a/src/front/Components/Layouts/Folder/index.tsx +++ b/src/front/Components/Layouts/Folder/index.tsx @@ -28,7 +28,7 @@ export default class Folder extends BasePage { Informations du dossier
- Vous n'avez aucun dossier archivés + Sélectionnez un dossier
diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index d17634ae..36d8aafc 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -93,7 +93,7 @@ class FolderInformationClass extends BasePage { Informations du dossier
- Vous n'avez aucun dossier archivés + Vous n'avez aucun dossier archivé
diff --git a/src/front/Components/Layouts/FolderArchived/index.tsx b/src/front/Components/Layouts/FolderArchived/index.tsx index f411b087..68c3b4a1 100644 --- a/src/front/Components/Layouts/FolderArchived/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/index.tsx @@ -31,7 +31,7 @@ export default class Folder extends BasePage { Informations du dossier
- Vous n'avez aucun dossier archivés + Vous n'avez aucun dossier archivé
diff --git a/src/front/Components/Layouts/Login/index.tsx b/src/front/Components/Layouts/Login/index.tsx index 59a9cc2f..d404a76e 100644 --- a/src/front/Components/Layouts/Login/index.tsx +++ b/src/front/Components/Layouts/Login/index.tsx @@ -3,7 +3,7 @@ import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; import BasePage from "../Base"; import classes from "./classes.module.scss"; import CoffreIcon from "@Assets/Icons/coffre.svg"; -import LandingImage from "./landing-connect.png"; +import LandingImage from "./landing-connect.jpeg"; import Image from "next/image"; import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage"; import { FrontendVariables } from "@Front/Config/VariablesFront"; diff --git a/src/front/Components/Layouts/Login/landing-connect.jpeg b/src/front/Components/Layouts/Login/landing-connect.jpeg new file mode 100644 index 00000000..789e0ef3 Binary files /dev/null and b/src/front/Components/Layouts/Login/landing-connect.jpeg differ diff --git a/src/front/Components/Layouts/Login/landing-connect.png b/src/front/Components/Layouts/Login/landing-connect.png deleted file mode 100644 index 5fd6f853..00000000 Binary files a/src/front/Components/Layouts/Login/landing-connect.png and /dev/null differ diff --git a/src/front/Components/Layouts/LoginCustomer/index.tsx b/src/front/Components/Layouts/LoginCustomer/index.tsx index fe5938c8..7acb9c36 100644 --- a/src/front/Components/Layouts/LoginCustomer/index.tsx +++ b/src/front/Components/Layouts/LoginCustomer/index.tsx @@ -1,7 +1,7 @@ import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; import BasePage from "../Base"; import classes from "./classes.module.scss"; -import LandingImage from "./landing-connect.png"; +import LandingImage from "../Login/landing-connect.jpeg"; import Image from "next/image"; import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage"; import FranceConnectIcon from "./france-connect.svg"; @@ -42,7 +42,9 @@ export default class LoginCustomer extends BasePage { // variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST + (variables.FRONT_APP_PORT ? ":" + variables.FRONT_APP_PORT : ""); const authorizeEndPoint = variables.FC_AUTHORIZE_ENDPOINT; const clientId = variables.FC_CLIENT_ID; - const url = `${authorizeEndPoint}?client_id=${clientId}&redirect_uri=http://localhost:8080/login-callback&scope=openid&response_type=code&state=${cryptoRandomString({length: 64})}&nonce=${cryptoRandomString({length: 64})}&acr_values=eidas1`; + const url = `${authorizeEndPoint}?client_id=${clientId}&redirect_uri=http://localhost:8080/login-callback&scope=openid&response_type=code&state=${cryptoRandomString( + { length: 64 }, + )}&nonce=${cryptoRandomString({ length: 64 })}&acr_values=eidas1`; window.location.assign(url); } } diff --git a/src/front/Components/Layouts/LoginCustomer/landing-connect.png b/src/front/Components/Layouts/LoginCustomer/landing-connect.png deleted file mode 100644 index 5fd6f853..00000000 Binary files a/src/front/Components/Layouts/LoginCustomer/landing-connect.png and /dev/null differ diff --git a/src/front/Components/Layouts/PageNotFound/index.tsx b/src/front/Components/Layouts/PageNotFound/index.tsx index 75b16d02..bdbd778f 100644 --- a/src/front/Components/Layouts/PageNotFound/index.tsx +++ b/src/front/Components/Layouts/PageNotFound/index.tsx @@ -2,15 +2,15 @@ import Button from "@Front/Components/DesignSystem/Button"; import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; import Module from "@Front/Config/Module"; import Link from "next/link"; -import RightImage from "@Assets/images/create-folder/right-image.png"; import BasePage from "../Base"; import classes from "./classes.module.scss"; import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage"; +import backgroundImage from "../Folder/CreateFolder/background-image.jpeg"; export default class PageNotFound extends BasePage { public override render(): JSX.Element { return ( - +
Erreur 404