Skip to content

Commit a92dbd5

Browse files
committed
feat: add Assign Role button to LibrariesTeamManager for enhanced role management
1 parent 2390bea commit a92dbd5

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

src/authz-module/libraries-manager/LibrariesTeamManager.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
import { useMemo } from 'react';
22
import { useIntl } from '@edx/frontend-platform/i18n';
33
import {
4-
Container, Skeleton, Tab, Tabs,
4+
Button, Container, Skeleton, Tab, Tabs,
55
} from '@openedx/paragon';
6+
import { Plus } from '@openedx/paragon/icons';
67
import { useLibrary } from '@src/authz-module/data/hooks';
7-
import { useLocation } from 'react-router-dom';
8-
import { ROUTES } from '@src/authz-module/constants';
8+
import { useLocation, useNavigate } from 'react-router-dom';
9+
import { buildWizardPath, ROUTES } from '@src/authz-module/constants';
910
import TeamTable from './components/TeamTable';
1011
import AuthZLayout from '../components/AuthZLayout';
1112
import RoleCard from '../components/RoleCard';
1213
import PermissionTable from '../components/PermissionTable';
1314
import { useLibraryAuthZ } from './context';
14-
import { AddNewTeamMemberTrigger } from './components/AddNewTeamMemberModal';
1515
import { buildPermissionMatrixByResource, buildPermissionMatrixByRole } from './utils';
1616

1717
import messages from './messages';
1818

1919
const LibrariesTeamManager = () => {
2020
const intl = useIntl();
21-
const { hash } = useLocation();
21+
const navigate = useNavigate();
22+
const { hash, pathname } = useLocation();
2223
const {
2324
libraryId, canManageTeam, roles, permissions, resources,
2425
} = useLibraryAuthZ();
@@ -51,7 +52,16 @@ const LibrariesTeamManager = () => {
5152
pageSubtitle={libraryId}
5253
actions={
5354
[
54-
...(canManageTeam ? [<AddNewTeamMemberTrigger libraryId={libraryId} key="add-new-member" />] : []),
55+
...(canManageTeam ? [
56+
<Button
57+
key="assign-role-wizard"
58+
iconBefore={Plus}
59+
variant="primary"
60+
onClick={() => navigate(buildWizardPath({ from: pathname }))}
61+
>
62+
{intl.formatMessage(messages['library.authz.manage.assign.role.wizard.button'])}
63+
</Button>,
64+
] : []),
5565
]
5666
}
5767
>

0 commit comments

Comments
 (0)