-
-
-
-
- {isSubMenuOpened && (
-
- {props.subElements.map((element, index) => {
- return ;
- })}
-
- )}
-
- );
-}
diff --git a/src/front/Components/Elements/Rules/index.tsx b/src/front/Components/Elements/Rules/index.tsx
index ecf66840..7f0defba 100644
--- a/src/front/Components/Elements/Rules/index.tsx
+++ b/src/front/Components/Elements/Rules/index.tsx
@@ -26,7 +26,7 @@ export default function Rules(props: IProps) {
if (props.mode === RulesMode.NECESSARY) {
return props.rules.every((rule) => JwtService.getInstance().hasRule(rule.name, rule.action));
}
- return !!props.rules.find((rule) => JwtService.getInstance().hasRule(rule.name, rule.action));
+ return props.rules.length === 0 || !!props.rules.find((rule) => JwtService.getInstance().hasRule(rule.name, rule.action));
}, [props.mode, props.rules]);
useEffect(() => {
diff --git a/src/front/Components/Layouts/DesignSystem/index.tsx b/src/front/Components/Layouts/DesignSystem/index.tsx
index 4da7b128..13d4ae9f 100644
--- a/src/front/Components/Layouts/DesignSystem/index.tsx
+++ b/src/front/Components/Layouts/DesignSystem/index.tsx
@@ -27,7 +27,7 @@ import {
import { useCallback, useMemo, useState } from "react";
import classes from "./classes.module.scss";
-import ButtonWithSubMenu from "@Front/Components/Elements/ButtonWithSubMenu";
+import Menu from "@Front/Components/DesignSystem/Menu";
export default function DesignSystem() {
const { isOpen, open, close } = useOpenable();
@@ -80,9 +80,8 @@ export default function DesignSystem() {
Button icon with menu
- }
- subElements={[
+
,
text: "Modifier les collaborateurs",
@@ -101,8 +100,9 @@ export default function DesignSystem() {
link: "/",
color: ETypoColor.ERROR_WEAK_CONTRAST,
},
- ]}
- />
+ ]}>
+ } variant={EIconButtonVariant.NEUTRAL} />
+
Inputs
Number picker avec min à 1 et max à 10
{}} min={1} max={10} />
diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx
index 4cd16cce..882aaaaf 100644
--- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx
+++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/ClientBox/index.tsx
@@ -1,17 +1,18 @@
import Button, { EButtonSize, EButtonstyletype, EButtonVariant } from "@Front/Components/DesignSystem/Button";
+import IconButton, { EIconButtonVariant } from "@Front/Components/DesignSystem/IconButton";
+import Menu from "@Front/Components/DesignSystem/Menu";
+import Modal from "@Front/Components/DesignSystem/Modal";
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
+import Module from "@Front/Config/Module";
import useOpenable from "@Front/Hooks/useOpenable";
import { PencilSquareIcon, TrashIcon, UsersIcon } from "@heroicons/react/24/outline";
+import { Note } from "le-coffre-resources/dist/Customer";
+import { useCallback } from "react";
import { ICustomer } from "..";
import { AnchorStatus } from "../..";
import classes from "./classes.module.scss";
import DeleteCustomerModal from "./DeleteCustomerModal";
-import Module from "@Front/Config/Module";
-import { useCallback } from "react";
-import { Note } from "le-coffre-resources/dist/Customer";
-import ButtonWithSubMenu from "@Front/Components/Elements/ButtonWithSubMenu";
-import Modal from "@Front/Components/DesignSystem/Modal";
type IProps = {
customer: ICustomer;
@@ -56,10 +57,9 @@ export default function ClientBox(props: IProps) {
{customer.contact?.first_name} {customer.contact?.last_name}
{anchorStatus === AnchorStatus.NOT_ANCHORED && (
- }
+ ,
text: "Modifier les informations",
@@ -74,12 +74,9 @@ export default function ClientBox(props: IProps) {
text: "Modifier la note",
link: createOrUpdateNotePath,
},
- ]}
- />
- //
- //
- //
+ ]}>
+ } variant={EIconButtonVariant.NEUTRAL} />
+
)}
diff --git a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx
index 4e60f216..ef264e44 100644
--- a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx
+++ b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx
@@ -1,15 +1,16 @@
import CircleProgress from "@Front/Components/DesignSystem/CircleProgress";
+import IconButton, { EIconButtonVariant } from "@Front/Components/DesignSystem/IconButton";
+import Menu, { IItem } from "@Front/Components/DesignSystem/Menu";
import Tag, { ETagColor } from "@Front/Components/DesignSystem/Tag";
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
import Module from "@Front/Config/Module";
import { ArchiveBoxIcon, EllipsisHorizontalIcon, PencilSquareIcon, UsersIcon } from "@heroicons/react/24/outline";
import { OfficeFolder } from "le-coffre-resources/dist/Notary";
-
-import classes from "./classes.module.scss";
-import { AnchorStatus } from "..";
-import ButtonWithSubMenu, { ISubElement } from "@Front/Components/Elements/ButtonWithSubMenu";
import { useCallback } from "react";
+import { AnchorStatus } from "..";
+import classes from "./classes.module.scss";
+
type IProps = {
folder: OfficeFolder | null;
progress: number;
@@ -22,7 +23,7 @@ export default function InformationSection(props: IProps) {
const { folder, progress, onArchive, anchorStatus, isArchived } = props;
const getSubMenuElement = useCallback(() => {
- let elements: ISubElement[] = [];
+ let elements: IItem[] = [];
// Creating the three elements and adding them conditionnally
const modifyCollaboratorsElement = {
@@ -86,7 +87,9 @@ export default function InformationSection(props: IProps) {
- } subElements={getSubMenuElement()} />
+
+ } variant={EIconButtonVariant.NEUTRAL} />
+