mirror of
https://github.com/umami-software/umami.git
synced 2026-02-23 14:05:35 +01:00
add team member edit and remove confirmation
This commit is contained in:
parent
5ae04291af
commit
c7e9190c95
7 changed files with 182 additions and 19 deletions
|
|
@ -2,6 +2,7 @@ import { GridColumn, GridTable, useBreakpoint } from 'react-basics';
|
|||
import { useMessages, useLogin } from 'components/hooks';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import TeamMemberRemoveButton from './TeamMemberRemoveButton';
|
||||
import TeamMemberEditButton from './TeamMemberEditButton';
|
||||
|
||||
export function TeamMembersTable({
|
||||
data = [],
|
||||
|
|
@ -19,6 +20,7 @@ export function TeamMembersTable({
|
|||
const roles = {
|
||||
[ROLES.teamOwner]: formatMessage(labels.teamOwner),
|
||||
[ROLES.teamMember]: formatMessage(labels.teamMember),
|
||||
[ROLES.teamViewOnly]: formatMessage(labels.viewOnly),
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -35,7 +37,14 @@ export function TeamMembersTable({
|
|||
allowEdit &&
|
||||
row?.role !== ROLES.teamOwner &&
|
||||
user?.id !== row?.id && (
|
||||
<TeamMemberRemoveButton teamId={teamId} userId={row?.user?.id} />
|
||||
<>
|
||||
<TeamMemberEditButton teamId={teamId} userId={row?.user?.id} role={row?.role} />
|
||||
<TeamMemberRemoveButton
|
||||
teamId={teamId}
|
||||
userId={row?.user?.id}
|
||||
userName={row?.user?.username}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
);
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue