✨ Fixing build and creating default dashboard
This commit is contained in:
parent
6870ffd47c
commit
f6130e00b8
@ -1,14 +0,0 @@
|
|||||||
@import "@Themes/constants.scss";
|
|
||||||
|
|
||||||
.root {
|
|
||||||
height: calc(100vh - 290px);
|
|
||||||
overflow-y: scroll;
|
|
||||||
|
|
||||||
&.archived {
|
|
||||||
height: calc(100vh - 220px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
background-color: var(--color-neutral-200);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,76 +0,0 @@
|
|||||||
import Module from "@Front/Config/Module";
|
|
||||||
import classNames from "classnames";
|
|
||||||
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
|
||||||
import { EDocumentStatus } from "le-coffre-resources/dist/Notary/Document";
|
|
||||||
import Link from "next/link";
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
import FolderContainer from "../FolderContainer";
|
|
||||||
import classes from "./classes.module.scss";
|
|
||||||
|
|
||||||
type IProps = {
|
|
||||||
folders: OfficeFolder[];
|
|
||||||
isArchived: boolean;
|
|
||||||
onSelectedFolder?: (folder: OfficeFolder) => void;
|
|
||||||
onCloseLeftSide?: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
type IPropsClass = IProps & {
|
|
||||||
selectedFolder: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type IState = {};
|
|
||||||
|
|
||||||
class FolderListClass extends React.Component<IPropsClass, IState> {
|
|
||||||
private redirectPath: string = this.props.isArchived
|
|
||||||
? 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 <div className={classNames(classes["root"], this.props.isArchived ? classes["archived"] : "")}>{this.renderFolders()}</div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
private renderFolders(): JSX.Element[] {
|
|
||||||
const pendingFolders = this.props.folders
|
|
||||||
.filter((folder) => {
|
|
||||||
const pendingDocuments = (folder.documents ?? []).filter(
|
|
||||||
(document) => document.document_status === EDocumentStatus.DEPOSITED,
|
|
||||||
);
|
|
||||||
return pendingDocuments.length >= 1;
|
|
||||||
})
|
|
||||||
.sort((folder1, folder2) => {
|
|
||||||
return folder1.created_at! > folder2.created_at! ? -1 : 1;
|
|
||||||
});
|
|
||||||
|
|
||||||
const otherFolders = this.props.folders
|
|
||||||
.filter((folder) => {
|
|
||||||
const pendingDocuments = (folder.documents ?? []).filter(
|
|
||||||
(document) => document.document_status === EDocumentStatus.DEPOSITED,
|
|
||||||
);
|
|
||||||
return pendingDocuments.length === 0;
|
|
||||||
})
|
|
||||||
.sort((folder1, folder2) => {
|
|
||||||
return folder1.created_at! > folder2.created_at! ? -1 : 1;
|
|
||||||
});
|
|
||||||
|
|
||||||
return [...pendingFolders, ...otherFolders].map((folder) => {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
onClick={this.props.onCloseLeftSide}
|
|
||||||
key={folder.uid}
|
|
||||||
className={folder.uid === this.props.selectedFolder ? classes["active"] : ""}>
|
|
||||||
<Link href={this.redirectPath.replace("[folderUid]", folder.uid ?? "")}>
|
|
||||||
<FolderContainer folder={folder} onSelectedFolder={this.props.onSelectedFolder} />;
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function FolderList(props: IProps) {
|
|
||||||
const router = useRouter();
|
|
||||||
let { folderUid } = router.query;
|
|
||||||
folderUid = folderUid as string;
|
|
||||||
return <FolderListClass {...props} selectedFolder={folderUid} />;
|
|
||||||
}
|
|
@ -11,8 +11,6 @@ import SearchBlockList from "../SearchBlockList";
|
|||||||
type IProps = {
|
type IProps = {
|
||||||
folders: OfficeFolder[];
|
folders: OfficeFolder[];
|
||||||
isArchived: boolean;
|
isArchived: boolean;
|
||||||
onSelectedFolder?: (folder: OfficeFolder) => void;
|
|
||||||
onCloseLeftSide?: () => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function FolderListContainer(props: IProps) {
|
export default function FolderListContainer(props: IProps) {
|
||||||
@ -64,10 +62,8 @@ export default function FolderListContainer(props: IProps) {
|
|||||||
const [blocks, setBlocks] = React.useState<IBlock[]>(getBlocks(folders));
|
const [blocks, setBlocks] = React.useState<IBlock[]>(getBlocks(folders));
|
||||||
|
|
||||||
const onSelectedFolder = (block: IBlock) => {
|
const onSelectedFolder = (block: IBlock) => {
|
||||||
props.onCloseLeftSide && props.onCloseLeftSide();
|
|
||||||
const folder = folders.find((folder) => folder.uid === block.id);
|
const folder = folders.find((folder) => folder.uid === block.id);
|
||||||
if (!folder) return;
|
if (!folder) return;
|
||||||
props.onSelectedFolder && props.onSelectedFolder(folder);
|
|
||||||
const path = redirectPath.replace("[folderUid]", folder.uid ?? "");
|
const path = redirectPath.replace("[folderUid]", folder.uid ?? "");
|
||||||
router.push(path);
|
router.push(path);
|
||||||
};
|
};
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
import Header from "@Front/Components/DesignSystem/Header";
|
||||||
|
import Version from "@Front/Components/DesignSystem/Version";
|
||||||
|
import BackArrow from "@Front/Components/Elements/BackArrow";
|
||||||
|
import React, { ReactNode } from "react";
|
||||||
|
|
||||||
|
import classes from "./classes.module.scss";
|
||||||
|
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
||||||
|
import SearchBlockList from "@Front/Components/DesignSystem/SearchBlockList";
|
||||||
|
|
||||||
|
export type IPropsDashboardWithList = {
|
||||||
|
title?: string;
|
||||||
|
children?: ReactNode;
|
||||||
|
isArchived?: boolean;
|
||||||
|
hasBackArrow?: boolean;
|
||||||
|
backArrowUrl?: string;
|
||||||
|
mobileBackText?: string;
|
||||||
|
blocksList: IBlock[];
|
||||||
|
onSelectedBlock: (block: IBlock) => void;
|
||||||
|
headerConnected?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function DefaultDashboardWithList(props: IPropsDashboardWithList) {
|
||||||
|
const { hasBackArrow, backArrowUrl, children, blocksList, onSelectedBlock, headerConnected = true } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classes["root"]}>
|
||||||
|
<Header isUserConnected={headerConnected} />
|
||||||
|
<div className={classes["content"]}>
|
||||||
|
<SearchBlockList blocks={blocksList} onSelectedBlock={onSelectedBlock} />
|
||||||
|
<div className={classes["right-side"]}>
|
||||||
|
{hasBackArrow && (
|
||||||
|
<div className={classes["back-arrow-desktop"]}>
|
||||||
|
<BackArrow url={backArrowUrl ?? ""} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Version />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -13,14 +13,13 @@ type IProps = {
|
|||||||
title: string;
|
title: string;
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
isArchived?: boolean;
|
isArchived?: boolean;
|
||||||
onSelectedFolder?: (folder: OfficeFolder) => void;
|
|
||||||
hasBackArrow?: boolean;
|
hasBackArrow?: boolean;
|
||||||
backArrowUrl?: string;
|
backArrowUrl?: string;
|
||||||
mobileBackText?: string;
|
mobileBackText?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function DefaultNotaryDashboard(props: IProps) {
|
export default function DefaultNotaryDashboard(props: IProps) {
|
||||||
const { hasBackArrow, onSelectedFolder, backArrowUrl, children, isArchived } = props;
|
const { hasBackArrow, backArrowUrl, children, isArchived } = props;
|
||||||
|
|
||||||
const [folders, setFolders] = React.useState<OfficeFolder[]>([]);
|
const [folders, setFolders] = React.useState<OfficeFolder[]>([]);
|
||||||
|
|
||||||
@ -67,7 +66,7 @@ export default function DefaultNotaryDashboard(props: IProps) {
|
|||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<Header isUserConnected={true} />
|
<Header isUserConnected={true} />
|
||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
<FolderListContainer folders={folders} onSelectedFolder={onSelectedFolder} isArchived={isArchived ?? false} />
|
<FolderListContainer folders={folders} isArchived={isArchived ?? false} />
|
||||||
<div className={classes["right-side"]}>
|
<div className={classes["right-side"]}>
|
||||||
{hasBackArrow && (
|
{hasBackArrow && (
|
||||||
<div className={classes["back-arrow-desktop"]}>
|
<div className={classes["back-arrow-desktop"]}>
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
@import "@Themes/constants.scss";
|
|
||||||
|
|
||||||
.root {
|
|
||||||
width: calc(100vh - 83px);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.header {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchbar {
|
|
||||||
padding: 40px 24px 24px 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.folderlist-container {
|
|
||||||
max-height: 100vh;
|
|
||||||
height: 100vh;
|
|
||||||
overflow: auto;
|
|
||||||
border-right: 1px solid var(--color-neutral-200);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
import Module from "@Front/Config/Module";
|
|
||||||
import { Office } from "le-coffre-resources/dist/SuperAdmin";
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import React, { useCallback } from "react";
|
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
|
||||||
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
|
||||||
import SearchBlockList from "@Front/Components/DesignSystem/SearchBlockList";
|
|
||||||
|
|
||||||
type IProps = {
|
|
||||||
offices: Office[];
|
|
||||||
onSelectedOffice?: (office: Office) => void;
|
|
||||||
onCloseLeftSide?: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function OfficeListContainer(props: IProps) {
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const { officeUid } = router.query;
|
|
||||||
|
|
||||||
const onSelectedBlock = useCallback(
|
|
||||||
(block: IBlock) => {
|
|
||||||
props.onCloseLeftSide && props.onCloseLeftSide();
|
|
||||||
const redirectPath = Module.getInstance().get().modules.pages.Offices.pages.OfficesInformations.props.path;
|
|
||||||
router.push(redirectPath.replace("[uid]", block.id));
|
|
||||||
},
|
|
||||||
[props, router],
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={classes["root"]}>
|
|
||||||
<SearchBlockList
|
|
||||||
blocks={props.offices.map((office) => {
|
|
||||||
return {
|
|
||||||
primaryText: office.crpcen + " - " + office.name,
|
|
||||||
id: office.uid!,
|
|
||||||
isActive: office.uid === officeUid,
|
|
||||||
};
|
|
||||||
})}
|
|
||||||
onSelectedBlock={onSelectedBlock}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,116 +0,0 @@
|
|||||||
@import "@Themes/constants.scss";
|
|
||||||
|
|
||||||
@keyframes growWidth {
|
|
||||||
0% {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
100% {
|
|
||||||
width: 200%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.root {
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
overflow: hidden;
|
|
||||||
height: calc(100vh - var(--header-height));
|
|
||||||
|
|
||||||
.overlay {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: var(--color-generic-white);
|
|
||||||
opacity: 0.5;
|
|
||||||
z-index: 2;
|
|
||||||
transition: all 0.3s $custom-easing;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left-side {
|
|
||||||
background-color: var(--color-generic-white);
|
|
||||||
z-index: 3;
|
|
||||||
display: flex;
|
|
||||||
width: 336px;
|
|
||||||
min-width: 336px;
|
|
||||||
transition: all 0.3s $custom-easing;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
@media (max-width: ($screen-m - 1px)) {
|
|
||||||
width: 56px;
|
|
||||||
min-width: 56px;
|
|
||||||
transform: translateX(-389px);
|
|
||||||
|
|
||||||
&.opened {
|
|
||||||
transform: translateX(0px);
|
|
||||||
width: 336px;
|
|
||||||
min-width: 336px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $screen-s) {
|
|
||||||
width: 0px;
|
|
||||||
min-width: 0px;
|
|
||||||
|
|
||||||
&.opened {
|
|
||||||
width: 100vw;
|
|
||||||
min-width: 100vw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.closable-left-side {
|
|
||||||
position: absolute;
|
|
||||||
background-color: var(--color-generic-white);
|
|
||||||
z-index: 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
min-width: 56px;
|
|
||||||
max-width: 56px;
|
|
||||||
height: calc(100vh - var(--header-height));
|
|
||||||
border-right: 1px var(--color-neutral-200) solid;
|
|
||||||
|
|
||||||
@media (min-width: $screen-m) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chevron-icon {
|
|
||||||
margin-top: 21px;
|
|
||||||
transform: rotate(180deg);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $screen-s) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right-side {
|
|
||||||
min-width: calc(100vw - 389px);
|
|
||||||
padding: 24px;
|
|
||||||
overflow-y: auto;
|
|
||||||
|
|
||||||
@media (max-width: ($screen-m - 1px)) {
|
|
||||||
min-width: calc(100vw - 56px);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $screen-s) {
|
|
||||||
flex: 1;
|
|
||||||
min-width: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-arrow-mobile {
|
|
||||||
display: none;
|
|
||||||
@media (max-width: $screen-s) {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-arrow-desktop {
|
|
||||||
@media (max-width: $screen-s) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,112 +1,42 @@
|
|||||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
import { Office } from "le-coffre-resources/dist/SuperAdmin";
|
||||||
|
import React, { useEffect } from "react";
|
||||||
|
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import Module from "@Front/Config/Module";
|
||||||
|
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
||||||
|
import DefaultDashboardWithList, { IPropsDashboardWithList } from "../DefaultDashboardWithList";
|
||||||
import Offices from "@Front/Api/LeCoffreApi/SuperAdmin/Offices/Offices";
|
import Offices from "@Front/Api/LeCoffreApi/SuperAdmin/Offices/Offices";
|
||||||
import Button, { EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
|
||||||
import Header from "@Front/Components/DesignSystem/Header";
|
|
||||||
import Version from "@Front/Components/DesignSystem/Version";
|
|
||||||
import BackArrow from "@Front/Components/Elements/BackArrow";
|
|
||||||
import WindowStore from "@Front/Stores/WindowStore";
|
|
||||||
import classNames from "classnames";
|
|
||||||
import { Office } from "le-coffre-resources/dist/Notary";
|
|
||||||
import Image from "next/image";
|
|
||||||
import React, { ReactNode } from "react";
|
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
type IProps = IPropsDashboardWithList;
|
||||||
import OfficeListContainer from "./OfficeListContainer";
|
|
||||||
import { ChevronLeftIcon } from "@heroicons/react/24/outline";
|
|
||||||
|
|
||||||
type IProps = {
|
export default function DefaultOfficeDashboard(props: IProps) {
|
||||||
title: string;
|
const [offices, setOffices] = React.useState<Office[] | null>(null);
|
||||||
children?: ReactNode;
|
const router = useRouter();
|
||||||
onSelectedOffice: (office: Office) => void;
|
const { officeUid } = router.query;
|
||||||
hasBackArrow: boolean;
|
useEffect(() => {
|
||||||
backArrowUrl?: string;
|
Offices.getInstance()
|
||||||
mobileBackText?: string;
|
.get()
|
||||||
};
|
.then((offices) => setOffices(offices));
|
||||||
type IState = {
|
}, []);
|
||||||
offices: Office[] | null;
|
|
||||||
isLeftSideOpen: boolean;
|
const onSelectedBlock = (block: IBlock) => {
|
||||||
leftSideCanBeClosed: boolean;
|
router.push(Module.getInstance().get().modules.pages.Offices.pages.OfficesInformations.props.path.replace("[uid]", block.id));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class DefaultOfficeDashboard extends React.Component<IProps, IState> {
|
|
||||||
private onWindowResize = () => {};
|
|
||||||
public static defaultProps: Partial<IProps> = {
|
|
||||||
hasBackArrow: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
public constructor(props: IProps) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
offices: null,
|
|
||||||
isLeftSideOpen: false,
|
|
||||||
leftSideCanBeClosed: typeof window !== "undefined" ? window.innerWidth < 1024 : false,
|
|
||||||
};
|
|
||||||
this.onOpenLeftSide = this.onOpenLeftSide.bind(this);
|
|
||||||
this.onCloseLeftSide = this.onCloseLeftSide.bind(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override render(): JSX.Element {
|
|
||||||
return (
|
return (
|
||||||
<div className={classes["root"]}>
|
<DefaultDashboardWithList
|
||||||
<Header isUserConnected={true} />
|
{...props}
|
||||||
<div className={classes["content"]}>
|
onSelectedBlock={onSelectedBlock}
|
||||||
{this.state.isLeftSideOpen && <div className={classes["overlay"]} onClick={this.onCloseLeftSide} />}
|
blocksList={
|
||||||
<div className={classNames(classes["left-side"], this.state.isLeftSideOpen && classes["opened"])}>
|
offices
|
||||||
{this.state.offices && <OfficeListContainer offices={this.state.offices} onCloseLeftSide={this.onCloseLeftSide} />}
|
? offices.map((office) => ({
|
||||||
</div>
|
id: office.uid!,
|
||||||
<div className={classNames(classes["closable-left-side"])}>
|
primaryText: office.name,
|
||||||
<Image alt="open side menu" src={ChevronIcon} className={classes["chevron-icon"]} onClick={this.onOpenLeftSide} />
|
isActive: office.uid === officeUid,
|
||||||
</div>
|
secondaryText: office.crpcen,
|
||||||
|
}))
|
||||||
<div className={classes["right-side"]}>
|
: []
|
||||||
{this.props.hasBackArrow && (
|
}
|
||||||
<div className={classes["back-arrow-desktop"]}>
|
/>
|
||||||
<BackArrow url={this.props.backArrowUrl ?? ""} />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{this.props.mobileBackText && (
|
|
||||||
<div className={classes["back-arrow-mobile"]}>
|
|
||||||
<Button
|
|
||||||
leftIcon={<ChevronLeftIcon />}
|
|
||||||
variant={EButtonVariant.PRIMARY}
|
|
||||||
styletype={EButtonstyletype.TEXT}
|
|
||||||
onClick={this.onOpenLeftSide}>
|
|
||||||
{this.props.mobileBackText ?? "Retour"}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{this.props.children}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Version />
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async componentDidMount() {
|
|
||||||
this.onWindowResize = WindowStore.getInstance().onResize((window) => this.onResize(window));
|
|
||||||
const offices = await Offices.getInstance().get();
|
|
||||||
this.setState({ offices });
|
|
||||||
}
|
|
||||||
|
|
||||||
public override componentWillUnmount() {
|
|
||||||
this.onWindowResize();
|
|
||||||
}
|
|
||||||
|
|
||||||
private onOpenLeftSide() {
|
|
||||||
this.setState({ isLeftSideOpen: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
private onCloseLeftSide() {
|
|
||||||
if (!this.state.leftSideCanBeClosed) return;
|
|
||||||
this.setState({ isLeftSideOpen: false });
|
|
||||||
}
|
|
||||||
|
|
||||||
private onResize(window: Window) {
|
|
||||||
if (window.innerWidth > 1023) {
|
|
||||||
if (!this.state.leftSideCanBeClosed) return;
|
|
||||||
this.setState({ leftSideCanBeClosed: false });
|
|
||||||
}
|
|
||||||
this.setState({ leftSideCanBeClosed: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
@import "@Themes/constants.scss";
|
|
||||||
|
|
||||||
.root {
|
|
||||||
width: calc(100vh - 83px);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.header {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchbar {
|
|
||||||
padding: 40px 24px 24px 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.folderlist-container {
|
|
||||||
max-height: 100vh;
|
|
||||||
height: 100vh;
|
|
||||||
overflow: auto;
|
|
||||||
border-right: 1px solid var(--color-neutral-200);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
import Module from "@Front/Config/Module";
|
|
||||||
import User from "le-coffre-resources/dist/Notary";
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import React, { useCallback } from "react";
|
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
|
||||||
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
|
||||||
import SearchBlockList from "@Front/Components/DesignSystem/SearchBlockList";
|
|
||||||
|
|
||||||
type IProps = {
|
|
||||||
users: User[];
|
|
||||||
onSelectedUser?: (user: User) => void;
|
|
||||||
onCloseLeftSide?: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function UserListContainer(props: IProps) {
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const { userUid } = router.query;
|
|
||||||
|
|
||||||
const onSelectedBlock = useCallback(
|
|
||||||
(block: IBlock) => {
|
|
||||||
props.onCloseLeftSide && props.onCloseLeftSide();
|
|
||||||
const redirectPath = Module.getInstance().get().modules.pages.Users.pages.UsersInformations.props.path;
|
|
||||||
router.push(redirectPath.replace("[uid]", block.id));
|
|
||||||
},
|
|
||||||
[props, router],
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={classes["root"]}>
|
|
||||||
<SearchBlockList
|
|
||||||
blocks={props.users.map((user) => {
|
|
||||||
return {
|
|
||||||
primaryText: user.contact?.first_name + " " + user.contact?.last_name,
|
|
||||||
id: user.uid!,
|
|
||||||
isActive: user.uid === userUid,
|
|
||||||
};
|
|
||||||
})}
|
|
||||||
onSelectedBlock={onSelectedBlock}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,27 +1,18 @@
|
|||||||
import Users, { IGetUsersparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
import Users, { IGetUsersparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
||||||
import Header from "@Front/Components/DesignSystem/Header";
|
|
||||||
import Version from "@Front/Components/DesignSystem/Version";
|
|
||||||
import BackArrow from "@Front/Components/Elements/BackArrow";
|
|
||||||
import User from "le-coffre-resources/dist/SuperAdmin";
|
import User from "le-coffre-resources/dist/SuperAdmin";
|
||||||
import React, { ReactNode, useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
|
||||||
import SearchBlockList from "@Front/Components/DesignSystem/SearchBlockList";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import Module from "@Front/Config/Module";
|
import Module from "@Front/Config/Module";
|
||||||
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
import { IBlock } from "@Front/Components/DesignSystem/SearchBlockList/BlockList/Block";
|
||||||
|
import DefaultDashboardWithList, { IPropsDashboardWithList } from "../DefaultDashboardWithList";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = IPropsDashboardWithList;
|
||||||
title: string;
|
|
||||||
children?: ReactNode;
|
|
||||||
hasBackArrow?: boolean;
|
|
||||||
backArrowUrl?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function DefaultUserDashboard(props: IProps) {
|
export default function DefaultUserDashboard(props: IProps) {
|
||||||
const { hasBackArrow, children, backArrowUrl } = props;
|
|
||||||
const [users, setUsers] = React.useState<User[] | null>(null);
|
const [users, setUsers] = React.useState<User[] | null>(null);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { userUid } = router.query;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const query: IGetUsersparams = {
|
const query: IGetUsersparams = {
|
||||||
include: { contact: true },
|
include: { contact: true },
|
||||||
@ -37,31 +28,19 @@ export default function DefaultUserDashboard(props: IProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes["root"]}>
|
<DefaultDashboardWithList
|
||||||
<Header isUserConnected={true} />
|
{...props}
|
||||||
<div className={classes["content"]}>
|
|
||||||
{users && (
|
|
||||||
<SearchBlockList
|
|
||||||
blocks={users.map((user) => {
|
|
||||||
return {
|
|
||||||
id: user.uid,
|
|
||||||
primaryText: user.contact?.first_name + " " + user.contact?.last_name,
|
|
||||||
secondaryText: user.contact?.email,
|
|
||||||
} as IBlock;
|
|
||||||
})}
|
|
||||||
onSelectedBlock={onSelectedBlock}
|
onSelectedBlock={onSelectedBlock}
|
||||||
|
blocksList={
|
||||||
|
users
|
||||||
|
? users.map((user) => ({
|
||||||
|
id: user.uid!,
|
||||||
|
primaryText: user.contact?.first_name + " " + user.contact?.last_name,
|
||||||
|
isActive: user.uid === userUid,
|
||||||
|
secondaryText: user.contact?.email,
|
||||||
|
}))
|
||||||
|
: []
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
<div className={classes["right-side"]}>
|
|
||||||
{hasBackArrow && (
|
|
||||||
<div className={classes["back-arrow-desktop"]}>
|
|
||||||
<BackArrow url={backArrowUrl ?? ""} />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Version />
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ class AskDocumentsClass extends BasePage<IPropsClass, IState> {
|
|||||||
.modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid);
|
.modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.folderUid);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DefaultNotaryDashboard title={"Demander des documents"} onSelectedFolder={() => {}}>
|
<DefaultNotaryDashboard title={"Demander des documents"}>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<BackArrow url={backUrl} />
|
<BackArrow url={backUrl} />
|
||||||
<Typography typo={ETypo.DISPLAY_LARGE} color={ETypoColor.COLOR_GENERIC_BLACK} className={classes["title"]}>
|
<Typography typo={ETypo.DISPLAY_LARGE} color={ETypoColor.COLOR_GENERIC_BLACK} className={classes["title"]}>
|
||||||
|
@ -74,7 +74,7 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
|||||||
|
|
||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<DefaultNotaryDashboard title={"Ajouter client(s)"} onSelectedFolder={this.onSelectedFolder}>
|
<DefaultNotaryDashboard title={"Ajouter client(s)"}>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["back-arrow"]}>
|
<div className={classes["back-arrow"]}>
|
||||||
<BackArrow url={this.backwardPath} />
|
<BackArrow url={this.backwardPath} />
|
||||||
|
@ -6,10 +6,10 @@ import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNot
|
|||||||
import Module from "@Front/Config/Module";
|
import Module from "@Front/Config/Module";
|
||||||
import JwtService from "@Front/Services/JwtService/JwtService";
|
import JwtService from "@Front/Services/JwtService/JwtService";
|
||||||
import { DocumentIcon } from "@heroicons/react/24/outline";
|
import { DocumentIcon } from "@heroicons/react/24/outline";
|
||||||
import User, { OfficeFolder } from "le-coffre-resources/dist/Notary";
|
import User from "le-coffre-resources/dist/Notary";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import Folders from "@Front/Api/LeCoffreApi/Notary/Folders/Folders";
|
import Folders from "@Front/Api/LeCoffreApi/Notary/Folders/Folders";
|
||||||
@ -17,14 +17,10 @@ import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
export default function Folder() {
|
export default function Folder() {
|
||||||
const [_folder, setFolder] = useState<OfficeFolder | null>(null);
|
|
||||||
const [_isArchivedModalOpen, _setIsArchivedModalOpen] = useState(true);
|
const [_isArchivedModalOpen, _setIsArchivedModalOpen] = useState(true);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const [activeUser, setActiveUser] = useState<User | null>();
|
const [activeUser, setActiveUser] = useState<User | null>();
|
||||||
const onSelectedFolder = useCallback((folder: OfficeFolder): void => {
|
|
||||||
setFolder(folder);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const decodedJwt = JwtService.getInstance().decodeJwt();
|
const decodedJwt = JwtService.getInstance().decodeJwt();
|
||||||
@ -59,7 +55,7 @@ export default function Folder() {
|
|||||||
}, [router]);
|
}, [router]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DefaultNotaryDashboard title={"Dossier"} onSelectedFolder={onSelectedFolder} mobileBackText={"Liste des dossiers"}>
|
<DefaultNotaryDashboard title={"Dossier"} mobileBackText={"Liste des dossiers"}>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["content"]}>
|
<div className={classes["content"]}>
|
||||||
<div className={classes["title-container"]}>
|
<div className={classes["title-container"]}>
|
||||||
|
@ -39,7 +39,7 @@ class UpdateFolderMetadataClass extends BasePage<IProps, IState> {
|
|||||||
.get()
|
.get()
|
||||||
.modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.selectedFolderUid);
|
.modules.pages.Folder.pages.FolderInformation.props.path.replace("[folderUid]", this.props.selectedFolderUid);
|
||||||
return (
|
return (
|
||||||
<DefaultNotaryDashboard title={"Ajouter client(s)"} onSelectedFolder={this.onSelectedFolder}>
|
<DefaultNotaryDashboard title={"Ajouter client(s)"}>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["back-arrow"]}>
|
<div className={classes["back-arrow"]}>
|
||||||
<BackArrow url={backwardPath} />
|
<BackArrow url={backwardPath} />
|
||||||
|
@ -23,11 +23,7 @@ export default class FolderArchived extends BasePage<IProps, IState> {
|
|||||||
// TODO: Message if the user has not created any folder yet
|
// TODO: Message if the user has not created any folder yet
|
||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<DefaultNotaryDashboard
|
<DefaultNotaryDashboard title={"Dossier"} isArchived mobileBackText={"Liste des dossiers"}>
|
||||||
title={"Dossier"}
|
|
||||||
onSelectedFolder={this.onSelectedFolder}
|
|
||||||
isArchived
|
|
||||||
mobileBackText={"Liste des dossiers"}>
|
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["no-folder-selected"]}>
|
<div className={classes["no-folder-selected"]}>
|
||||||
<Typography typo={ETypo.TITLE_H1}>Informations du dossier</Typography>
|
<Typography typo={ETypo.TITLE_H1}>Informations du dossier</Typography>
|
||||||
|
@ -117,7 +117,7 @@ export default function OfficeInformations(props: IProps) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DefaultOfficeDashboard mobileBackText={"Liste des utilisateurs"}>
|
<DefaultOfficeDashboard>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["header"]}>
|
<div className={classes["header"]}>
|
||||||
<Typography typo={ETypo.TITLE_H1}>Office {officeSelected?.crpcen + " - " + officeSelected?.name}</Typography>
|
<Typography typo={ETypo.TITLE_H1}>Office {officeSelected?.crpcen + " - " + officeSelected?.name}</Typography>
|
||||||
|
@ -9,7 +9,7 @@ type IState = {};
|
|||||||
export default class Offices extends BasePage<IProps, IState> {
|
export default class Offices extends BasePage<IProps, IState> {
|
||||||
public override render(): JSX.Element {
|
public override render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<DefaultOfficeDashboard title={"Dossier"} mobileBackText={"Liste des offices"}>
|
<DefaultOfficeDashboard title={"Dossier"}>
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["no-folder-selected"]}>
|
<div className={classes["no-folder-selected"]}>
|
||||||
<Typography typo={ETypo.TITLE_H1}>Informations des offices</Typography>
|
<Typography typo={ETypo.TITLE_H1}>Informations des offices</Typography>
|
||||||
|
@ -210,7 +210,7 @@ export default function UserInformations(props: IProps) {
|
|||||||
}, [currentAppointment, getUser]);
|
}, [currentAppointment, getUser]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DefaultUserDashboard mobileBackText={"Liste des utilisateurs"}>
|
<DefaultUserDashboard>
|
||||||
{!isLoading && (
|
{!isLoading && (
|
||||||
<div className={classes["root"]}>
|
<div className={classes["root"]}>
|
||||||
<div className={classes["header"]}>
|
<div className={classes["header"]}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user