Skip to content

Commit 7e8a2ba

Browse files
committed
feat: integrate AddRoleButton into LibrariesUserManager for role assignment
1 parent 858153b commit 7e8a2ba

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/authz-module/components/AddRoleButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import React from 'react';
22
import { useIntl } from '@edx/frontend-platform/i18n';
33
import { Button } from '@openedx/paragon';
44
import { Plus } from '@openedx/paragon/icons';
5+
import { useNavigate } from 'react-router-dom';
56

67
import baseMessages from '@src/authz-module/messages';
7-
import { useNavigate } from 'react-router-dom';
8-
import { buildWizardPath } from 'authz-module/constants';
8+
import { buildWizardPath } from '@src/authz-module/constants';
99

1010
interface AddRoleButtonProps {
1111
presetUsername?: string;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Container, Skeleton } from '@openedx/paragon';
55
import { ROUTES } from '@src/authz-module/constants';
66
import { Role } from 'types';
77
import { useToastManager } from '@src/components/ToastManager/ToastManagerContext';
8+
import AddRoleButton from '@src/authz-module/components/AddRoleButton';
89
import AuthZLayout from '../components/AuthZLayout';
910
import { useLibraryAuthZ } from './context';
1011
import RoleCard from '../components/RoleCard';
@@ -153,8 +154,8 @@ const LibrariesUserManager = () => {
153154
activeLabel={user?.username || ''}
154155
pageTitle={user?.username || ''}
155156
pageSubtitle={user?.email || ''}
156-
actions={user && canManageTeam
157-
? <AddRoleButton from={pathname} users={user.username} />
157+
actions={(user && canManageTeam)
158+
? [<AddRoleButton from={pathname} presetUsername={user.username} />]
158159
: []}
159160
>
160161
<Container className="bg-light-200 p-5">

0 commit comments

Comments
 (0)