Skip to content

Commit aeda6f3

Browse files
fix: orgs and roles filter fixed to send correct values to API
1 parent 69e73c6 commit aeda6f3

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/authz-module/components/TableControlBar/OrgFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const OrgFilter = ({
1717
} = useOrgs(searchValue);
1818
const filterChoices = useMemo(() => orgsData?.results?.map((org) => ({
1919
displayName: org.name,
20-
value: org.id,
20+
value: org.shortName,
2121
})) || [], [orgsData]);
2222

2323
const handleSearchChange = (value: string) => {

src/authz-module/components/TableControlBar/RolesFilter.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,36 @@ const RolesFilter = ({
1313
// TODO: use a constant
1414
const filterChoices = useMemo(() => [
1515
{
16-
groupName: 'Global', groupIcon: Language, displayName: 'Super Admin', value: 'Super Admin',
16+
groupName: 'Global', groupIcon: Language, displayName: 'Super Admin', value: 'super_admin',
1717
},
1818
{
19-
groupName: 'Global', groupIcon: Language, displayName: 'Global Staff', value: 'Global Staff',
19+
groupName: 'Global', groupIcon: Language, displayName: 'Global Staff', value: 'global_staff',
2020
},
2121

2222
{
23-
groupName: 'Course', groupIcon: School, displayName: 'Course Admin', value: 'Course Admin',
23+
groupName: 'Course', groupIcon: School, displayName: 'Course Admin', value: 'course_admin',
2424
},
2525
{
26-
groupName: 'Course', groupIcon: School, displayName: 'Course Staff', value: 'Course Staff',
26+
groupName: 'Course', groupIcon: School, displayName: 'Course Staff', value: 'course_staff',
2727
},
2828
{
29-
groupName: 'Course', groupIcon: School, displayName: 'Course Editor', value: 'Course Editor',
29+
groupName: 'Course', groupIcon: School, displayName: 'Course Editor', value: 'course_editor',
3030
},
3131
{
32-
groupName: 'Course', groupIcon: School, displayName: 'Course Auditor', value: 'Course Auditor',
32+
groupName: 'Course', groupIcon: School, displayName: 'Course Auditor', value: 'course_auditor',
3333
},
3434

3535
{
36-
groupName: 'Library', groupIcon: LibraryBooks, displayName: 'Library Admin', value: 'Library Admin',
36+
groupName: 'Library', groupIcon: LibraryBooks, displayName: 'Library Admin', value: 'library_admin',
3737
},
3838
{
39-
groupName: 'Library', groupIcon: LibraryBooks, displayName: 'Library Author', value: 'Library Author',
39+
groupName: 'Library', groupIcon: LibraryBooks, displayName: 'Library Author', value: 'library_author',
4040
},
4141
{
42-
groupName: 'Library', groupIcon: LibraryBooks, displayName: 'Library Collaborator', value: 'Library Collaborator',
42+
groupName: 'Library', groupIcon: LibraryBooks, displayName: 'Library Collaborator', value: 'library_collaborator',
4343
},
4444
{
45-
groupName: 'Library', groupIcon: LibraryBooks, displayName: 'Library User', value: 'Library User',
45+
groupName: 'Library', groupIcon: LibraryBooks, displayName: 'Library User', value: 'library_user',
4646
},
4747
], []);
4848
return (

src/authz-module/data/api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ export const getUserAssignedRoles = async (username: string, querySettings: Quer
143143
if (querySettings.roles) {
144144
url.searchParams.set('roles', querySettings.roles);
145145
}
146+
if (querySettings.organizations) {
147+
url.searchParams.set('orgs', querySettings.organizations);
148+
}
146149
if (querySettings.search) {
147150
url.searchParams.set('search', querySettings.search);
148151
}

src/types.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,16 @@ export type PermissionMetadata = {
5151

5252
export type UserRole = {
5353
role: string;
54-
<<<<<<< HEAD
5554
org: string;
5655
scope: string;
5756
permissionCount: number;
58-
=======
5957
organization: string;
60-
scope: string;
61-
>>>>>>> ef7bf9b (feat: roles table for audit user page)
6258
};
6359

6460
export type Org = {
6561
id: string;
6662
name: string;
63+
shortName: string;
6764
};
6865

6966
export type Scope = {

0 commit comments

Comments
 (0)