✨ Select utilisateur restreint on page utilisateurs
This commit is contained in:
parent
3efd0aa4df
commit
70732336c5
@ -81,7 +81,11 @@ export default function UserInformations(props: IProps) {
|
||||
|
||||
useEffect(() => {
|
||||
if (!userSelected) return;
|
||||
setCurrentAppointment(userSelected?.appointment?.find((appointment) => appointment.status === EAppointmentStatus.OPEN && appointment.votes?.length != 0) ?? null);
|
||||
setCurrentAppointment(
|
||||
userSelected?.appointment?.find(
|
||||
(appointment) => appointment.status === EAppointmentStatus.OPEN && appointment.votes?.length != 0,
|
||||
) ?? null,
|
||||
);
|
||||
}, [userSelected]);
|
||||
|
||||
/** Functions for the admin modal */
|
||||
@ -271,7 +275,7 @@ export default function UserInformations(props: IProps) {
|
||||
onChange={handleRoleChange}
|
||||
selectedOption={{
|
||||
value: userSelected?.office_role ? userSelected?.office_role?.uid : userSelected?.role?.uid,
|
||||
label: userSelected?.office_role ? userSelected?.office_role?.name : userSelected?.role?.label!,
|
||||
label: userSelected?.office_role ? userSelected?.office_role?.name : "Utilisateur restreint",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@ -282,7 +286,12 @@ export default function UserInformations(props: IProps) {
|
||||
</div>
|
||||
<div className={classes["second-line"]}>
|
||||
<Switch label="Admin de son office" checked={isAdminChecked} onChange={handleAdminChanged} />
|
||||
<Switch label="Super-admin LeCoffre.io" checked={isSuperAdminChecked} disabled={userHasVoted()} onChange={handleSuperAdminChanged} />
|
||||
<Switch
|
||||
label="Super-admin LeCoffre.io"
|
||||
checked={isSuperAdminChecked}
|
||||
disabled={userHasVoted()}
|
||||
onChange={handleSuperAdminChanged}
|
||||
/>
|
||||
{currentAppointment && (
|
||||
<div className={classes["votes-block"]}>
|
||||
<div className={classes["left"]}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user