Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): update description of the workspace member #6492

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { useUserSubscription } from '@affine/core/hooks/use-subscription';
import { WorkspaceFlavour } from '@affine/env/workspace';
import { Permission, SubscriptionPlan } from '@affine/graphql';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { ArrowRightBigIcon, MoreVerticalIcon } from '@blocksuite/icons';
import { MoreVerticalIcon } from '@blocksuite/icons';
import clsx from 'clsx';
import { useSetAtom } from 'jotai';
import type { ReactElement } from 'react';
Expand Down Expand Up @@ -81,7 +81,7 @@ export const CloudWorkspaceMembersPanel = ({
const quota = useWorkspaceQuota(workspaceId);
const [subscription] = useUserSubscription();
const plan = subscription?.plan ?? SubscriptionPlan.Free;
const isLimited = checkMemberCountLimit(memberCount, quota?.memberLimit);
const isLimited = checkMemberCountLimit(memberCount, quota.memberLimit);

const t = useAFFiNEI18N();
const { invite, isMutating } = useInviteMember(workspaceId);
Expand Down Expand Up @@ -151,27 +151,18 @@ export const CloudWorkspaceMembersPanel = ({

const desc = useMemo(() => {
if (!quota) return null;

const humanReadable = quota.humanReadable;
return (
<span>
{t['com.affine.payment.member.description']({
planName: humanReadable.name,
memberLimit: humanReadable.memberLimit,
})}
{t['com.affine.payment.member.description2']()}
{upgradable ? (
<>
,
<div
className={style.goUpgradeWrapper}
onClick={handleUpgradeConfirm}
>
<span className={style.goUpgrade}>
{t['com.affine.payment.member.description.go-upgrade']()}
</span>
<ArrowRightBigIcon className={style.arrowRight} />
</div>
</>
<div
className={style.goUpgradeWrapper}
onClick={handleUpgradeConfirm}
>
<span className={style.goUpgrade}>
{t['com.affine.payment.member.description.choose-plan']()}
</span>
</div>
) : null}
</span>
);
Expand All @@ -180,7 +171,7 @@ export const CloudWorkspaceMembersPanel = ({
return (
<>
<SettingRow
name={`${t['Members']()} (${memberCount})`}
name={`${t['Members']()} (${memberCount}/${quota.humanReadable.memberLimit})`}
desc={desc}
spreadCol={isOwner}
>
Expand All @@ -191,8 +182,8 @@ export const CloudWorkspaceMembersPanel = ({
<MemberLimitModal
isFreePlan={plan === SubscriptionPlan.Free}
open={open}
plan={quota?.humanReadable.name ?? ''}
quota={quota?.humanReadable.memberLimit ?? ''}
plan={quota.humanReadable.name}
quota={quota.humanReadable.memberLimit}
setOpen={setOpen}
onConfirm={handleUpgradeConfirm}
/>
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/i18n/src/resources/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{

Check warning on line 1 in packages/frontend/i18n/src/resources/en.json

View workflow job for this annotation

GitHub Actions / main

Inconsistent keys

com.affine.payment.billing-setting.current-plan

Check notice on line 1 in packages/frontend/i18n/src/resources/en.json

View workflow job for this annotation

GitHub Actions / main

New keys

Get in touch! Join our communities., It takes up little space on your device., It takes up more space on your device., com.affine.auth.open.affine.download-app, com.affine.auth.open.affine.prompt, com.affine.auth.open.affine.try-again, com.affine.auth.reset.password.message, com.affine.auth.reset.password.page.success, com.affine.auth.sent.change.email.hint, com.affine.auth.sent.reset.password.success.message, com.affine.auth.sent.set.password.hint, com.affine.auth.sent.set.password.success.message, com.affine.auth.set.password.save, com.affine.auth.sign.up.sent.email.subtitle, com.affine.auth.sign.up.success.title, com.affine.editCollection.rules.tips.highlight, com.affine.page-properties.add-property.menu.create, com.affine.page-properties.add-property.menu.header, com.affine.pageMode.all, com.affine.pageMode.edgeless, com.affine.pageMode.page, com.affine.setting.account.delete.message, com.affine.settings.appearance.border-style-description, com.affine.settings.appearance.start-week-description, com.affine.settings.email.action, com.affine.settings.password.action.change, com.affine.settings.password.action.set, com.affine.settings.password.message, com.affine.settings.profile.message, com.affine.settings.profile.placeholder, com.affine.settings.workspace.experimental-features, com.affine.settings.workspace.experimental-features.get-started, com.affine.settings.workspace.experimental-features.header.plugins, com.affine.settings.workspace.experimental-features.prompt-disclaimer, com.affine.settings.workspace.experimental-features.prompt-header, com.affine.settings.workspace.experimental-features.prompt-warning, com.affine.settings.workspace.experimental-features.prompt-warning-title, com.affine.settings.workspace.preferences, com.affine.settings.workspace.properties, com.affine.settings.workspace.properties.add_property, com.affine.settings.workspace.properties.all, com.affine.settings.workspace.properties.delete-property, com.affine.settings.workspace.properties.doc, com.affine.settings.workspace.properties.doc_others, com.affine.settings.workspace.properties.edit-property, com.affine.settings.workspace.properties.header.subtitle, com.affine.settings.workspace.properties.header.title, com.affine.settings.workspace.properties.in-use, com.affine.settings.workspace.properties.set-as-required, com.affine.settings.workspace.properties.unused, com.affine.settings.workspace.storage.tip, com.affine.storage.maximum-tips.pro, com.affine.workspace.cloud.description

Check warning on line 1 in packages/frontend/i18n/src/resources/en.json

View workflow job for this annotation

GitHub Actions / main

Inconsistent keys

com.affine.payment.billing-setting.current-plan

Check notice on line 1 in packages/frontend/i18n/src/resources/en.json

View workflow job for this annotation

GitHub Actions / main

New keys

Get in touch! Join our communities., It takes up little space on your device., It takes up more space on your device., com.affine.auth.open.affine.download-app, com.affine.auth.open.affine.prompt, com.affine.auth.open.affine.try-again, com.affine.auth.reset.password.message, com.affine.auth.reset.password.page.success, com.affine.auth.sent.change.email.hint, com.affine.auth.sent.reset.password.success.message, com.affine.auth.sent.set.password.hint, com.affine.auth.sent.set.password.success.message, com.affine.auth.set.password.save, com.affine.auth.sign.up.sent.email.subtitle, com.affine.auth.sign.up.success.title, com.affine.editCollection.rules.tips.highlight, com.affine.page-properties.add-property.menu.create, com.affine.page-properties.add-property.menu.header, com.affine.pageMode.all, com.affine.pageMode.edgeless, com.affine.pageMode.page, com.affine.payment.member.description.choose-plan, com.affine.payment.member.description2, com.affine.setting.account.delete.message, com.affine.settings.appearance.border-style-description, com.affine.settings.appearance.start-week-description, com.affine.settings.email.action, com.affine.settings.password.action.change, com.affine.settings.password.action.set, com.affine.settings.password.message, com.affine.settings.profile.message, com.affine.settings.profile.placeholder, com.affine.settings.workspace.experimental-features, com.affine.settings.workspace.experimental-features.get-started, com.affine.settings.workspace.experimental-features.header.plugins, com.affine.settings.workspace.experimental-features.prompt-disclaimer, com.affine.settings.workspace.experimental-features.prompt-header, com.affine.settings.workspace.experimental-features.prompt-warning, com.affine.settings.workspace.experimental-features.prompt-warning-title, com.affine.settings.workspace.preferences, com.affine.settings.workspace.properties, com.affine.settings.workspace.properties.add_property, com.affine.settings.workspace.properties.all, com.affine.settings.workspace.properties.delete-property, com.affine.settings.workspace.properties.doc, com.affine.settings.workspace.properties.doc_others, com.affine.settings.workspace.properties.edit-property, com.affine.settings.workspace.properties.header.subtitle, com.affine.settings.workspace.properties.header.title, com.affine.settings.workspace.properties.in-use, com.affine.settings.workspace.properties.set-as-required, com.affine.settings.workspace.properties.unused, com.affine.settings.workspace.storage.tip, com.affine.storage.maximum-tips.pro, com.affine.workspace.cloud.description
"404 - Page Not Found": "404 - Page Not Found",
"404.back": "Back to My Content",
"404.hint": "Sorry, you do not have access or this content does not exist...",
Expand Down Expand Up @@ -970,6 +970,8 @@
"com.affine.payment.member-limit.title": "You have reached the limit",
"com.affine.payment.member.description": "Manage members here. {{planName}} Users can invite up to {{memberLimit}}",
"com.affine.payment.member.description.go-upgrade": "go upgrade",
"com.affine.payment.member.description.choose-plan": "Choose your plan",
"com.affine.payment.member.description2": "Looking to collaborate with more people?",
"com.affine.payment.modal.change.cancel": "Cancel",
"com.affine.payment.modal.change.confirm": "Change",
"com.affine.payment.modal.change.title": "Change your subscription",
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/i18n/src/resources/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,8 @@
"com.affine.payment.member-limit.title": "成员数量已达到极限",
"com.affine.payment.member.description": "在此处管理成员。{{planName}} 用户可以邀请最多 {{memberLimit}} 人",
"com.affine.payment.member.description.go-upgrade": "前往升级",
"com.affine.payment.member.description.choose-plan": "选择你的计划",
"com.affine.payment.member.description2": "希望与更多人协作?",
"com.affine.payment.modal.change.cancel": "取消",
"com.affine.payment.modal.change.confirm": "更改",
"com.affine.payment.modal.change.title": "更改您的订阅",
Expand Down
Loading