✨ Fixing roles everywhere
This commit is contained in:
parent
6c5be9061c
commit
0d9e2f95d9
@ -1,18 +1,18 @@
|
|||||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||||
|
import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles";
|
||||||
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
||||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||||
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
||||||
import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
||||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
import DefaultCollaboratorDashboard from "@Front/Components/LayoutTemplates/DefaultCollaboratorDashboard";
|
import DefaultCollaboratorDashboard from "@Front/Components/LayoutTemplates/DefaultCollaboratorDashboard";
|
||||||
|
import Module from "@Front/Config/Module";
|
||||||
import User from "le-coffre-resources/dist/Notary";
|
import User from "le-coffre-resources/dist/Notary";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import Module from "@Front/Config/Module";
|
|
||||||
import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles";
|
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
export default function CollaboratorInformations(props: IProps) {
|
export default function CollaboratorInformations(props: IProps) {
|
||||||
@ -29,6 +29,7 @@ export default function CollaboratorInformations(props: IProps) {
|
|||||||
q: {
|
q: {
|
||||||
contact: true,
|
contact: true,
|
||||||
office_role: true,
|
office_role: true,
|
||||||
|
role: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!user) return;
|
if (!user) return;
|
||||||
@ -96,8 +97,8 @@ export default function CollaboratorInformations(props: IProps) {
|
|||||||
name="role"
|
name="role"
|
||||||
options={availableRoles}
|
options={availableRoles}
|
||||||
selectedOption={{
|
selectedOption={{
|
||||||
value: userSelected?.office_role?.uid,
|
value: userSelected?.office_role ? userSelected?.office_role?.uid : userSelected?.role?.uid,
|
||||||
label: userSelected?.office_role?.name!,
|
label: userSelected?.office_role ? userSelected?.office_role?.name : userSelected?.role?.name!,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
|
import WarningIcon from "@Assets/images/warning.png";
|
||||||
|
import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles";
|
||||||
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
import Users from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users";
|
||||||
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
import CheckBox from "@Front/Components/DesignSystem/CheckBox";
|
||||||
import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
||||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||||
import DefaultUserDashboard from "@Front/Components/LayoutTemplates/DefaultUserDashboard";
|
import DefaultUserDashboard from "@Front/Components/LayoutTemplates/DefaultUserDashboard";
|
||||||
import User from "le-coffre-resources/dist/Notary";
|
import User from "le-coffre-resources/dist/Notary";
|
||||||
|
import Image from "next/image";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import OfficeRoles from "@Front/Api/LeCoffreApi/Admin/OfficeRoles/OfficeRoles";
|
|
||||||
import WarningIcon from "@Assets/images/warning.png";
|
|
||||||
import Image from "next/image";
|
|
||||||
|
|
||||||
type IProps = {};
|
type IProps = {};
|
||||||
export default function UserInformations(props: IProps) {
|
export default function UserInformations(props: IProps) {
|
||||||
@ -27,6 +28,7 @@ export default function UserInformations(props: IProps) {
|
|||||||
contact: true,
|
contact: true,
|
||||||
office_role: true,
|
office_role: true,
|
||||||
office_membership: true,
|
office_membership: true,
|
||||||
|
role: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!user) return;
|
if (!user) return;
|
||||||
@ -87,8 +89,8 @@ export default function UserInformations(props: IProps) {
|
|||||||
name="role"
|
name="role"
|
||||||
options={availableRoles}
|
options={availableRoles}
|
||||||
selectedOption={{
|
selectedOption={{
|
||||||
value: userSelected?.office_role?.uid,
|
value: userSelected?.office_role ? userSelected?.office_role?.uid : userSelected?.role?.uid,
|
||||||
label: userSelected?.office_role?.name!,
|
label: userSelected?.office_role ? userSelected?.office_role?.name : userSelected?.role?.name!,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user