mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-23 20:18:42 +08:00
chore: temporarily hide link invitation (#9193)
close AF-1992 AF-1995 AF-1979 AF-1997 chore: temporarily hide link invitation fix(core): only team workspace can assign admin fix(core): member options in member list do not match expectations
This commit is contained in:
+3
-3
@@ -15,7 +15,7 @@ export const ModalContent = ({
|
|||||||
inviteEmail,
|
inviteEmail,
|
||||||
setInviteEmail,
|
setInviteEmail,
|
||||||
inviteMethod,
|
inviteMethod,
|
||||||
onInviteMethodChange,
|
// onInviteMethodChange,
|
||||||
handleConfirm,
|
handleConfirm,
|
||||||
isMutating,
|
isMutating,
|
||||||
isValidEmail,
|
isValidEmail,
|
||||||
@@ -48,7 +48,7 @@ export const ModalContent = ({
|
|||||||
<RadioGroup
|
<RadioGroup
|
||||||
width={'100%'}
|
width={'100%'}
|
||||||
value={inviteMethod}
|
value={inviteMethod}
|
||||||
onChange={onInviteMethodChange}
|
// onChange={onInviteMethodChange}
|
||||||
items={[
|
items={[
|
||||||
{
|
{
|
||||||
label: (
|
label: (
|
||||||
@@ -65,7 +65,7 @@ export const ModalContent = ({
|
|||||||
label: (
|
label: (
|
||||||
<RadioItem
|
<RadioItem
|
||||||
icon={<LinkIcon className={styles.iconStyle} />}
|
icon={<LinkIcon className={styles.iconStyle} />}
|
||||||
label={t['com.affine.payment.member.team.invite.invite-link']()}
|
label={`${t['com.affine.payment.member.team.invite.invite-link']()}(Coming soon)`}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
value: 'link',
|
value: 'link',
|
||||||
|
|||||||
+34
-1
@@ -102,6 +102,30 @@ export const MemberList = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getShouldShow = ({
|
||||||
|
member,
|
||||||
|
currentAccountId,
|
||||||
|
isOwner,
|
||||||
|
isAdmin,
|
||||||
|
}: {
|
||||||
|
member: Member;
|
||||||
|
currentAccountId: string;
|
||||||
|
isOwner: boolean;
|
||||||
|
isAdmin: boolean;
|
||||||
|
}) => {
|
||||||
|
if (
|
||||||
|
member.id === currentAccountId ||
|
||||||
|
member.permission === Permission.Owner
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
} else if (isOwner) {
|
||||||
|
return true;
|
||||||
|
} else if (isAdmin) {
|
||||||
|
return member.permission !== Permission.Admin;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
const MemberItem = ({
|
const MemberItem = ({
|
||||||
member,
|
member,
|
||||||
isOwner,
|
isOwner,
|
||||||
@@ -122,7 +146,16 @@ const MemberItem = ({
|
|||||||
const permission = useService(WorkspacePermissionService).permission;
|
const permission = useService(WorkspacePermissionService).permission;
|
||||||
const isEquals = workspaceName === inputValue;
|
const isEquals = workspaceName === inputValue;
|
||||||
|
|
||||||
const show = isOwner && currentAccount.id !== member.id;
|
const show = useMemo(
|
||||||
|
() =>
|
||||||
|
getShouldShow({
|
||||||
|
member,
|
||||||
|
currentAccountId: currentAccount.id,
|
||||||
|
isOwner,
|
||||||
|
isAdmin,
|
||||||
|
}),
|
||||||
|
[member, currentAccount, isOwner, isAdmin]
|
||||||
|
);
|
||||||
|
|
||||||
const handleOpenAssignModal = useCallback(() => {
|
const handleOpenAssignModal = useCallback(() => {
|
||||||
setInputValue('');
|
setInputValue('');
|
||||||
|
|||||||
+4
-1
@@ -6,7 +6,7 @@ import {
|
|||||||
} from '@affine/core/modules/permissions';
|
} from '@affine/core/modules/permissions';
|
||||||
import { Permission, WorkspaceMemberStatus } from '@affine/graphql';
|
import { Permission, WorkspaceMemberStatus } from '@affine/graphql';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
|
|
||||||
export const MemberOptions = ({
|
export const MemberOptions = ({
|
||||||
@@ -23,6 +23,7 @@ export const MemberOptions = ({
|
|||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const membersService = useService(WorkspaceMembersService);
|
const membersService = useService(WorkspaceMembersService);
|
||||||
const permission = useService(WorkspacePermissionService).permission;
|
const permission = useService(WorkspacePermissionService).permission;
|
||||||
|
const isTeam = useLiveData(permission.isTeam$);
|
||||||
const { openConfirmModal } = useConfirmModal();
|
const { openConfirmModal } = useConfirmModal();
|
||||||
|
|
||||||
const openRemoveConfirmModal = useCallback(
|
const openRemoveConfirmModal = useCallback(
|
||||||
@@ -207,6 +208,7 @@ export const MemberOptions = ({
|
|||||||
label: t['com.affine.payment.member.team.change.admin'](),
|
label: t['com.affine.payment.member.team.change.admin'](),
|
||||||
onClick: handleChangeToAdmin,
|
onClick: handleChangeToAdmin,
|
||||||
show:
|
show:
|
||||||
|
isTeam &&
|
||||||
isOwner &&
|
isOwner &&
|
||||||
member.permission !== Permission.Owner &&
|
member.permission !== Permission.Owner &&
|
||||||
member.permission !== Permission.Admin &&
|
member.permission !== Permission.Admin &&
|
||||||
@@ -228,6 +230,7 @@ export const MemberOptions = ({
|
|||||||
handleRevoke,
|
handleRevoke,
|
||||||
isAdmin,
|
isAdmin,
|
||||||
isOwner,
|
isOwner,
|
||||||
|
isTeam,
|
||||||
member,
|
member,
|
||||||
t,
|
t,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -42,11 +42,6 @@ export class Subscription extends Entity {
|
|||||||
? subscriptions.find(sub => sub.plan === SubscriptionPlan.AI)
|
? subscriptions.find(sub => sub.plan === SubscriptionPlan.AI)
|
||||||
: null
|
: null
|
||||||
);
|
);
|
||||||
team$ = this.subscription$.map(subscriptions =>
|
|
||||||
subscriptions
|
|
||||||
? subscriptions.find(sub => sub.plan === SubscriptionPlan.Team)
|
|
||||||
: null
|
|
||||||
);
|
|
||||||
isBeliever$ = this.pro$.map(
|
isBeliever$ = this.pro$.map(
|
||||||
sub => sub?.recurring === SubscriptionRecurring.Lifetime
|
sub => sub?.recurring === SubscriptionRecurring.Lifetime
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -896,7 +896,7 @@
|
|||||||
"com.affine.payment.cloud.team-workspace.benefit.g1-3": "500 MB of maximum file size.",
|
"com.affine.payment.cloud.team-workspace.benefit.g1-3": "500 MB of maximum file size.",
|
||||||
"com.affine.payment.cloud.team-workspace.benefit.g1-4": "Unlimited team members (10+ seats).",
|
"com.affine.payment.cloud.team-workspace.benefit.g1-4": "Unlimited team members (10+ seats).",
|
||||||
"com.affine.payment.cloud.team-workspace.benefit.g1-5": "Multiple admin roles.",
|
"com.affine.payment.cloud.team-workspace.benefit.g1-5": "Multiple admin roles.",
|
||||||
"com.affine.payment.cloud.team-workspace.benefit.g1-6": "Priority customer support",
|
"com.affine.payment.cloud.team-workspace.benefit.g1-6": "Priority customer support.",
|
||||||
"com.affine.payment.cloud.team-workspace.description": "Best for scalable teams.",
|
"com.affine.payment.cloud.team-workspace.description": "Best for scalable teams.",
|
||||||
"com.affine.payment.cloud.team-workspace.name": "Team Workspace",
|
"com.affine.payment.cloud.team-workspace.name": "Team Workspace",
|
||||||
"com.affine.payment.cloud.team-workspace.title.billed-yearly": "annually",
|
"com.affine.payment.cloud.team-workspace.title.billed-yearly": "annually",
|
||||||
|
|||||||
Reference in New Issue
Block a user