From 7960eae224d2da5279c971a848936964cf32dfb6 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 24 Jul 2023 16:58:03 +0200 Subject: [PATCH] :bug: Small fixes --- .../DefaultRoleDashboard/RoleListContainer/index.tsx | 12 +++++++----- .../DocumentTypes/DocumentTypesCreate/index.tsx | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/front/Components/LayoutTemplates/DefaultRoleDashboard/RoleListContainer/index.tsx b/src/front/Components/LayoutTemplates/DefaultRoleDashboard/RoleListContainer/index.tsx index c08475a5..ffb79fef 100644 --- a/src/front/Components/LayoutTemplates/DefaultRoleDashboard/RoleListContainer/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultRoleDashboard/RoleListContainer/index.tsx @@ -14,15 +14,17 @@ type IProps = { }; export default function RoleListContainer(props: IProps) { - const [filteredUsers, setFilteredUsers] = useState(props.roles); + const [filteredRoles, setFilteredRoles] = useState(props.roles); const router = useRouter(); + const { roleUid } = router.query; + const filterRoles = useCallback( (input: string) => { - const filteredUsers = props.roles.filter((role) => { + const filteredRoles = props.roles.filter((role) => { return role.name?.toLowerCase().includes(input.toLowerCase()); }); - setFilteredUsers(filteredUsers); + setFilteredRoles(filteredRoles); }, [props.roles], ); @@ -44,11 +46,11 @@ export default function RoleListContainer(props: IProps) {
{ + blocks={filteredRoles.map((role) => { return { name: role.name, id: role.uid!, - selected: false, + selected: role.uid === roleUid, }; })} onSelectedBlock={onSelectedBlock} diff --git a/src/front/Components/Layouts/DocumentTypes/DocumentTypesCreate/index.tsx b/src/front/Components/Layouts/DocumentTypes/DocumentTypesCreate/index.tsx index bb23d2bd..90bbd6d6 100644 --- a/src/front/Components/Layouts/DocumentTypes/DocumentTypesCreate/index.tsx +++ b/src/front/Components/Layouts/DocumentTypes/DocumentTypesCreate/index.tsx @@ -27,7 +27,6 @@ export default function DocumentTypesCreate(props: IProps) { uid: "6981326f-8a0a-4437-b15c-4cd5c4d80f6e", }), }); - console.log(documentToCreate); await validateOrReject(documentToCreate, { groups: ["createDocumentType"] }); const documentTypeCreated = await DocumentTypes.getInstance().post(documentToCreate);