✨ Page deed types created
This commit is contained in:
parent
f1d7d5aaab
commit
6a3748ea9b
49
src/front/Api/LeCoffreApi/Admin/DeedTypes/DeedTypes.ts
Normal file
49
src/front/Api/LeCoffreApi/Admin/DeedTypes/DeedTypes.ts
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
import { DeedType } from "le-coffre-resources/dist/Admin";
|
||||||
|
|
||||||
|
import BaseAdmin from "../BaseAdmin";
|
||||||
|
|
||||||
|
export type IGetDeedTypesParams = {
|
||||||
|
where?: {};
|
||||||
|
include?: {};
|
||||||
|
select?: {};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default class DeedTypes extends BaseAdmin {
|
||||||
|
private static instance: DeedTypes;
|
||||||
|
private readonly baseURl = this.namespaceUrl.concat("/deed-types");
|
||||||
|
|
||||||
|
private constructor() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static getInstance() {
|
||||||
|
if (!this.instance) {
|
||||||
|
return new DeedTypes();
|
||||||
|
} else {
|
||||||
|
return this.instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async get(q: IGetDeedTypesParams): Promise<DeedType[]> {
|
||||||
|
const url = new URL(this.baseURl);
|
||||||
|
const query = { q };
|
||||||
|
Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||||
|
try {
|
||||||
|
return await this.getRequest<DeedType[]>(url);
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getByUid(uid: string, q?: any): Promise<DeedType> {
|
||||||
|
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<DeedType>(url);
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
49
src/front/Api/LeCoffreApi/Admin/Deeds/Deeds.ts
Normal file
49
src/front/Api/LeCoffreApi/Admin/Deeds/Deeds.ts
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
import { Deed } from "le-coffre-resources/dist/Admin";
|
||||||
|
|
||||||
|
import BaseAdmin from "../BaseAdmin";
|
||||||
|
|
||||||
|
export type IGetDeedsParams = {
|
||||||
|
where?: {};
|
||||||
|
include?: {};
|
||||||
|
select?: {};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default class Deeds extends BaseAdmin {
|
||||||
|
private static instance: Deeds;
|
||||||
|
private readonly baseURl = this.namespaceUrl.concat("/deeds");
|
||||||
|
|
||||||
|
private constructor() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static getInstance() {
|
||||||
|
if (!this.instance) {
|
||||||
|
return new Deeds();
|
||||||
|
} else {
|
||||||
|
return this.instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async get(q: IGetDeedsParams): Promise<Deed[]> {
|
||||||
|
const url = new URL(this.baseURl);
|
||||||
|
const query = { q };
|
||||||
|
Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||||
|
try {
|
||||||
|
return await this.getRequest<Deed[]>(url);
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getByUid(uid: string, q?: any): Promise<Deed> {
|
||||||
|
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<Deed>(url);
|
||||||
|
} catch (err) {
|
||||||
|
this.onError(err);
|
||||||
|
return Promise.reject(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
@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 {
|
||||||
|
height: 100%;
|
||||||
|
border-right: 1px solid var(--grey-medium);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
import DeedTypes from "@Front/Api/LeCoffreApi/Admin/DeedTypes/DeedTypes";
|
||||||
|
import BlockList, { IBlock } from "@Front/Components/DesignSystem/BlockList";
|
||||||
|
import SearchBar from "@Front/Components/DesignSystem/SearchBar";
|
||||||
|
import Module from "@Front/Config/Module";
|
||||||
|
import { DeedType } from "le-coffre-resources/dist/Admin";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import React, { useCallback, useState } from "react";
|
||||||
|
|
||||||
|
import classes from "./classes.module.scss";
|
||||||
|
|
||||||
|
type IProps = {
|
||||||
|
deedTypes: DeedType[];
|
||||||
|
onSelectedDeed?: (deed: DeedTypes) => void;
|
||||||
|
onCloseLeftSide?: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function DeedListContainer(props: IProps) {
|
||||||
|
const [filteredUsers, setFilteredUsers] = useState<DeedType[]>(props.deedTypes);
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const filterDeeds = useCallback(
|
||||||
|
(input: string) => {
|
||||||
|
const filteredUsers = props.deedTypes.filter((deedType) => {
|
||||||
|
return deedType.name?.toLowerCase().includes(input.toLowerCase());
|
||||||
|
});
|
||||||
|
setFilteredUsers(filteredUsers);
|
||||||
|
},
|
||||||
|
[props.deedTypes],
|
||||||
|
);
|
||||||
|
|
||||||
|
const onSelectedBlock = useCallback(
|
||||||
|
(block: IBlock) => {
|
||||||
|
props.onCloseLeftSide && props.onCloseLeftSide();
|
||||||
|
const redirectPath = Module.getInstance().get().modules.pages.DeedTypes.pages.DeedTypesInformations.props.path;
|
||||||
|
router.push(redirectPath.replace("[uid]", block.id));
|
||||||
|
},
|
||||||
|
[props, router],
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classes["root"]}>
|
||||||
|
<div className={classes["header"]}>
|
||||||
|
<div className={classes["searchbar"]}>
|
||||||
|
<SearchBar onChange={filterDeeds} placeholder="Chercher un rôle" />
|
||||||
|
</div>
|
||||||
|
<div className={classes["folderlist-container"]}>
|
||||||
|
<BlockList
|
||||||
|
blocks={filteredUsers.map((deed) => {
|
||||||
|
return {
|
||||||
|
name: deed.name,
|
||||||
|
id: deed.uid!,
|
||||||
|
};
|
||||||
|
})}
|
||||||
|
onSelectedBlock={onSelectedBlock}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,117 @@
|
|||||||
|
@import "@Themes/constants.scss";
|
||||||
|
|
||||||
|
@keyframes growWidth {
|
||||||
|
0% {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
width: 200%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.root {
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
|
height: calc(100vh - 83px);
|
||||||
|
|
||||||
|
.overlay {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: var(--white);
|
||||||
|
opacity: 0.5;
|
||||||
|
z-index: 2;
|
||||||
|
transition: all 0.3s $custom-easing;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-side {
|
||||||
|
background-color: $white;
|
||||||
|
z-index: 3;
|
||||||
|
display: flex;
|
||||||
|
width: 389px;
|
||||||
|
min-width: 389px;
|
||||||
|
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: 389px;
|
||||||
|
min-width: 389px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: $screen-s) {
|
||||||
|
width: 0px;
|
||||||
|
min-width: 0px;
|
||||||
|
|
||||||
|
&.opened {
|
||||||
|
width: 100vw;
|
||||||
|
min-width: 100vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.closable-left-side {
|
||||||
|
position: absolute;
|
||||||
|
background-color: $white;
|
||||||
|
z-index: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
min-width: 56px;
|
||||||
|
max-width: 56px;
|
||||||
|
height: calc(100vh - 83px);
|
||||||
|
border-right: 1px $grey-medium 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: 64px 48px;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
@media (max-width: ($screen-m - 1px)) {
|
||||||
|
min-width: calc(100vw - 56px);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: $screen-s) {
|
||||||
|
padding: 40px 16px 64px 16px;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||||
|
import DeedTypes, { IGetDeedTypesParams } from "@Front/Api/LeCoffreApi/Admin/DeedTypes/DeedTypes";
|
||||||
|
import Button, { 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 { Deed, DeedType } from "le-coffre-resources/dist/Admin";
|
||||||
|
import Image from "next/image";
|
||||||
|
import React, { ReactNode } from "react";
|
||||||
|
|
||||||
|
import classes from "./classes.module.scss";
|
||||||
|
import DeedListContainer from "./DeedTypeListContainer";
|
||||||
|
|
||||||
|
type IProps = {
|
||||||
|
title: string;
|
||||||
|
children?: ReactNode;
|
||||||
|
onSelectedDeed: (deed: Deed) => void;
|
||||||
|
hasBackArrow: boolean;
|
||||||
|
backArrowUrl?: string;
|
||||||
|
mobileBackText?: string;
|
||||||
|
};
|
||||||
|
type IState = {
|
||||||
|
deedTypes: DeedType[] | null;
|
||||||
|
isLeftSideOpen: boolean;
|
||||||
|
leftSideCanBeClosed: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default class DefaultDeedTypesDashboard extends React.Component<IProps, IState> {
|
||||||
|
private onWindowResize = () => {};
|
||||||
|
public static defaultProps: Partial<IProps> = {
|
||||||
|
hasBackArrow: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
public constructor(props: IProps) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
deedTypes: 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 (
|
||||||
|
<div className={classes["root"]}>
|
||||||
|
<Header isUserConnected={true} />
|
||||||
|
<div className={classes["content"]}>
|
||||||
|
{this.state.isLeftSideOpen && <div className={classes["overlay"]} onClick={this.onCloseLeftSide} />}
|
||||||
|
<div className={classNames(classes["left-side"], this.state.isLeftSideOpen && classes["opened"])}>
|
||||||
|
{this.state.deedTypes && (
|
||||||
|
<DeedListContainer deedTypes={this.state.deedTypes} onCloseLeftSide={this.onCloseLeftSide} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className={classNames(classes["closable-left-side"])}>
|
||||||
|
<Image alt="open side menu" src={ChevronIcon} className={classes["chevron-icon"]} onClick={this.onOpenLeftSide} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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
|
||||||
|
icon={ChevronIcon}
|
||||||
|
iconposition={"left"}
|
||||||
|
iconstyle={{ transform: "rotate(180deg)", width: "22px", height: "22px" }}
|
||||||
|
variant={EButtonVariant.LINE}
|
||||||
|
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 query: IGetDeedTypesParams = {
|
||||||
|
include: { rules: true },
|
||||||
|
};
|
||||||
|
|
||||||
|
const deedTypes = await DeedTypes.getInstance().get(query);
|
||||||
|
this.setState({ deedTypes });
|
||||||
|
}
|
||||||
|
|
||||||
|
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 });
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
@import "@Themes/constants.scss";
|
||||||
|
|
||||||
|
.root {
|
||||||
|
.subtitle {
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rights-container {
|
||||||
|
margin-top: 32px;
|
||||||
|
padding: 32px 16px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
.select-all-container {
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rights {
|
||||||
|
margin-top: 32px;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
gap: 32px;
|
||||||
|
|
||||||
|
@media (max-width: $screen-m) {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.save-container {
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,122 @@
|
|||||||
|
import Roles from "@Front/Api/LeCoffreApi/Admin/Roles/Roles";
|
||||||
|
import Rules from "@Front/Api/LeCoffreApi/Admin/Rules/Rules";
|
||||||
|
import Button from "@Front/Components/DesignSystem/Button";
|
||||||
|
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
||||||
|
import Form from "@Front/Components/DesignSystem/Form";
|
||||||
|
import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography";
|
||||||
|
import DefaultDeedTypesDashboard from "@Front/Components/LayoutTemplates/DefaultDeedTypeDashboard";
|
||||||
|
import { Role, Rule } from "le-coffre-resources/dist/Admin";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
|
import classes from "./classes.module.scss";
|
||||||
|
|
||||||
|
type IProps = {};
|
||||||
|
type RuleCheckbox = Rule & {
|
||||||
|
checked: boolean;
|
||||||
|
};
|
||||||
|
export default function DeedTypesInformations(props: IProps) {
|
||||||
|
const router = useRouter();
|
||||||
|
let { roleUid } = router.query;
|
||||||
|
|
||||||
|
const [roleSelected, setRoleSelected] = useState<Role | null>(null);
|
||||||
|
const [rulesCheckboxes, setRulesCheckboxes] = useState<RuleCheckbox[]>([]);
|
||||||
|
const [selectAll, setSelectAll] = useState<boolean>(false);
|
||||||
|
useEffect(() => {
|
||||||
|
setSelectAll(false);
|
||||||
|
async function getUser() {
|
||||||
|
if (!roleUid) return;
|
||||||
|
const role = await Roles.getInstance().getByUid(roleUid as string, {
|
||||||
|
q: {
|
||||||
|
rules: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const rules = await Rules.getInstance().get({});
|
||||||
|
if (!role) return;
|
||||||
|
setRoleSelected(role);
|
||||||
|
if (!role.rules) return;
|
||||||
|
const rulesCheckboxes = rules
|
||||||
|
.map((rule) => {
|
||||||
|
if (role.rules?.find((r) => r.uid === rule.uid)) {
|
||||||
|
return { ...rule, checked: true };
|
||||||
|
}
|
||||||
|
return { ...rule, checked: false };
|
||||||
|
})
|
||||||
|
.sort((ruleA, ruleB) => (ruleA.name < ruleB.name ? 1 : -1))
|
||||||
|
.sort((rule) => (rule.checked ? -1 : 1));
|
||||||
|
|
||||||
|
const selectAll = rulesCheckboxes.every((rule) => rule.checked);
|
||||||
|
setSelectAll(selectAll);
|
||||||
|
setRulesCheckboxes(rulesCheckboxes);
|
||||||
|
}
|
||||||
|
|
||||||
|
getUser();
|
||||||
|
}, [roleUid]);
|
||||||
|
|
||||||
|
const handleSelectAllChange = useCallback(
|
||||||
|
(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setSelectAll(e.target.checked);
|
||||||
|
const checked = e.target.checked;
|
||||||
|
rulesCheckboxes.forEach((rule) => (rule.checked = checked));
|
||||||
|
setRulesCheckboxes([...rulesCheckboxes]);
|
||||||
|
},
|
||||||
|
[rulesCheckboxes],
|
||||||
|
);
|
||||||
|
|
||||||
|
const onSubmitHandler = useCallback(
|
||||||
|
async (e: React.FormEvent<HTMLFormElement> | null, values: { [key: string]: string }) => {
|
||||||
|
if (!roleSelected || !roleSelected.uid) return;
|
||||||
|
const rules = rulesCheckboxes.filter((rule) => rule.checked)?.map((rule) => Rule.hydrate<Rule>(rule));
|
||||||
|
const role = await Roles.getInstance().put(roleSelected.uid, {
|
||||||
|
rules,
|
||||||
|
});
|
||||||
|
if (!role) return;
|
||||||
|
setRoleSelected(role);
|
||||||
|
if (!role.rules) return;
|
||||||
|
setRulesCheckboxes(role.rules.map((rule) => ({ ...rule, checked: false })));
|
||||||
|
},
|
||||||
|
[roleSelected, rulesCheckboxes],
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<DefaultDeedTypesDashboard mobileBackText={"Liste des rôles"}>
|
||||||
|
<div className={classes["root"]}>
|
||||||
|
<div className={classes["header"]}>
|
||||||
|
<Typography typo={ITypo.H1Bis}>Gestion des rôles</Typography>
|
||||||
|
</div>
|
||||||
|
<div className={classes["subtitle"]}>
|
||||||
|
<Typography typo={ITypo.H3}>{roleSelected?.name}</Typography>
|
||||||
|
</div>
|
||||||
|
<div className={classes["rights-container"]}>
|
||||||
|
<div className={classes["rights-header"]}>
|
||||||
|
<Typography typo={ITypo.P_SB_18}>Modifier les droits</Typography>
|
||||||
|
</div>
|
||||||
|
<div className={classes["select-all-container"]}>
|
||||||
|
<CheckBox
|
||||||
|
option={{
|
||||||
|
label: "Tout sélectionner",
|
||||||
|
value: "all",
|
||||||
|
}}
|
||||||
|
toolTip="Tout sélectionner"
|
||||||
|
onChange={handleSelectAllChange}
|
||||||
|
checked={selectAll}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Form onSubmit={onSubmitHandler}>
|
||||||
|
<div className={classes["rights"]}>
|
||||||
|
{rulesCheckboxes.map((rule) => (
|
||||||
|
<div className={classes["right"]} key={rule.uid}>
|
||||||
|
<CheckBox option={{ label: rule.name, value: rule.uid }} checked={rule.checked} />
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className={classes["save-container"]}>
|
||||||
|
<Button type="submit">Enregistrer</Button>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DefaultDeedTypesDashboard>
|
||||||
|
);
|
||||||
|
}
|
17
src/front/Components/Layouts/DeedTypes/classes.module.scss
Normal file
17
src/front/Components/Layouts/DeedTypes/classes.module.scss
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@import "@Themes/constants.scss";
|
||||||
|
|
||||||
|
.root {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 100%;
|
||||||
|
|
||||||
|
.no-role-selected {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.choose-a-role {
|
||||||
|
margin-top: 96px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
src/front/Components/Layouts/DeedTypes/index.tsx
Normal file
26
src/front/Components/Layouts/DeedTypes/index.tsx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
|
import DefaultDeedTypesDashboard from "@Front/Components/LayoutTemplates/DefaultDeedTypeDashboard";
|
||||||
|
|
||||||
|
import BasePage from "../Base";
|
||||||
|
import classes from "./classes.module.scss";
|
||||||
|
|
||||||
|
type IProps = {};
|
||||||
|
type IState = {};
|
||||||
|
export default class DeedTypes extends BasePage<IProps, IState> {
|
||||||
|
public override render(): JSX.Element {
|
||||||
|
return (
|
||||||
|
<DefaultDeedTypesDashboard mobileBackText={"Liste des listes de pièces"}>
|
||||||
|
<div className={classes["root"]}>
|
||||||
|
<div className={classes["no-role-selected"]}>
|
||||||
|
<Typography typo={ITypo.H1Bis}>Gestion des rôles</Typography>
|
||||||
|
<div className={classes["choose-a-role"]}>
|
||||||
|
<Typography typo={ITypo.P_18} color={ITypoColor.GREY}>
|
||||||
|
Sélectionnez un rôle
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DefaultDeedTypesDashboard>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -151,6 +151,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"DeedTypes": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/deed-types",
|
||||||
|
"labelKey": "deedTypes"
|
||||||
|
},
|
||||||
|
"pages": {
|
||||||
|
"DeedTypesInformations": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/deed-types/[uid]",
|
||||||
|
"labelKey": "deedTypesInformations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"props": {
|
"props": {
|
||||||
|
@ -151,6 +151,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"DeedTypes": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/deed-types",
|
||||||
|
"labelKey": "deedTypes"
|
||||||
|
},
|
||||||
|
"pages": {
|
||||||
|
"DeedTypesInformations": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/deed-types/[uid]",
|
||||||
|
"labelKey": "deedTypesInformations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"props": {
|
"props": {
|
||||||
|
@ -151,6 +151,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"DeedTypes": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/deed-types",
|
||||||
|
"labelKey": "deedTypes"
|
||||||
|
},
|
||||||
|
"pages": {
|
||||||
|
"DeedTypesInformations": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/deed-types/[uid]",
|
||||||
|
"labelKey": "deedTypesInformations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"props": {
|
"props": {
|
||||||
|
@ -151,6 +151,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"DeedTypes": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/deed-types",
|
||||||
|
"labelKey": "deedTypes"
|
||||||
|
},
|
||||||
|
"pages": {
|
||||||
|
"DeedTypesInformations": {
|
||||||
|
"enabled": true,
|
||||||
|
"props": {
|
||||||
|
"path": "/deed-types/[uid]",
|
||||||
|
"labelKey": "deedTypesInformations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"props": {
|
"props": {
|
||||||
|
5
src/pages/deed-types/[deedTypeUid]/index.tsx
Normal file
5
src/pages/deed-types/[deedTypeUid]/index.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import Collaborators from "@Front/Components/Layouts/Collaborators";
|
||||||
|
|
||||||
|
export default function Route() {
|
||||||
|
return <Collaborators />;
|
||||||
|
}
|
5
src/pages/deed-types/index.tsx
Normal file
5
src/pages/deed-types/index.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import Collaborators from "@Front/Components/Layouts/Collaborators";
|
||||||
|
|
||||||
|
export default function Route() {
|
||||||
|
return <Collaborators />;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user