mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-03 19:23:37 +03:00
parent
0fdf2c4905
commit
7ff24e9c1c
@ -69,6 +69,9 @@ export const ModalContent = ({
|
||||
/>
|
||||
),
|
||||
value: 'link',
|
||||
style: {
|
||||
cursor: 'not-allowed',
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
@ -62,6 +62,7 @@ export const CloudWorkspaceMembersPanel = ({
|
||||
const permissionService = useService(WorkspacePermissionService);
|
||||
const isOwner = useLiveData(permissionService.permission.isOwner$);
|
||||
const isAdmin = useLiveData(permissionService.permission.isAdmin$);
|
||||
const isOwnerOrAdmin = isOwner || isAdmin;
|
||||
useEffect(() => {
|
||||
permissionService.permission.revalidate();
|
||||
}, [permissionService]);
|
||||
@ -233,8 +234,8 @@ export const CloudWorkspaceMembersPanel = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingRow name={title} desc={desc} spreadCol={!!isOwner}>
|
||||
{isOwner ? (
|
||||
<SettingRow name={title} desc={desc} spreadCol={!!isOwnerOrAdmin}>
|
||||
{isOwnerOrAdmin ? (
|
||||
<>
|
||||
<Button onClick={openInviteModal}>{t['Invite Members']()}</Button>
|
||||
{!isTeam ? (
|
||||
|
@ -210,7 +210,7 @@ const MemberItem = ({
|
||||
</div>
|
||||
<div
|
||||
className={clsx(styles.roleOrStatus, {
|
||||
pending: !member.accepted,
|
||||
pending: member.status !== WorkspaceMemberStatus.Accepted,
|
||||
})}
|
||||
>
|
||||
{t.t(memberStatus)}
|
||||
|
@ -193,14 +193,17 @@ export const MemberOptions = ({
|
||||
label: t['com.affine.payment.member.team.remove'](),
|
||||
onClick: handleRemove,
|
||||
show:
|
||||
(isAdmin || isOwner) &&
|
||||
member.status === WorkspaceMemberStatus.Accepted,
|
||||
(isOwner && member.status === WorkspaceMemberStatus.Accepted) ||
|
||||
(isAdmin &&
|
||||
member.status === WorkspaceMemberStatus.Accepted &&
|
||||
member.permission !== Permission.Owner &&
|
||||
member.permission !== Permission.Admin),
|
||||
},
|
||||
{
|
||||
label: t['com.affine.payment.member.team.change.collaborator'](),
|
||||
onClick: handleChangeToCollaborator,
|
||||
show:
|
||||
(isAdmin || isOwner) &&
|
||||
isOwner &&
|
||||
member.status === WorkspaceMemberStatus.Accepted &&
|
||||
member.permission === Permission.Admin,
|
||||
},
|
||||
|
@ -8,7 +8,6 @@ query getMembersByWorkspaceId($workspaceId: String!, $skip: Int!, $take: Int!) {
|
||||
avatarUrl
|
||||
permission
|
||||
inviteId
|
||||
accepted
|
||||
emailVerified
|
||||
status
|
||||
}
|
||||
|
@ -469,7 +469,6 @@ query getMembersByWorkspaceId($workspaceId: String!, $skip: Int!, $take: Int!) {
|
||||
avatarUrl
|
||||
permission
|
||||
inviteId
|
||||
accepted
|
||||
emailVerified
|
||||
status
|
||||
}
|
||||
|
@ -1844,7 +1844,6 @@ export type GetMembersByWorkspaceIdQuery = {
|
||||
avatarUrl: string | null;
|
||||
permission: Permission;
|
||||
inviteId: string;
|
||||
accepted: boolean;
|
||||
emailVerified: boolean | null;
|
||||
status: WorkspaceMemberStatus;
|
||||
}>;
|
||||
|
Loading…
Reference in New Issue
Block a user