mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): remove plugins settings (#5337)
depend on https://github.com/toeverything/AFFiNE/pull/5324
This commit is contained in:
@@ -12,7 +12,6 @@ export const loading = style({
|
||||
[speedVar]: '1.5s',
|
||||
},
|
||||
textRendering: 'optimizeLegibility',
|
||||
WebkitFontSmoothing: 'antialiased',
|
||||
transform: 'rotate(-90deg)',
|
||||
animation: `${rotate} ${speedVar} infinite linear`,
|
||||
});
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
AppearanceIcon,
|
||||
InformationIcon,
|
||||
KeyboardIcon,
|
||||
PluginIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import type { ReactElement, SVGProps } from 'react';
|
||||
|
||||
@@ -14,13 +13,11 @@ import { AppearanceSettings } from './appearance';
|
||||
import { BillingSettings } from './billing';
|
||||
import { PaymentIcon, UpgradeIcon } from './icons';
|
||||
import { AFFiNECloudPlans } from './plans';
|
||||
import { Plugins } from './plugins';
|
||||
import { Shortcuts } from './shortcuts';
|
||||
|
||||
export type GeneralSettingKeys =
|
||||
| 'shortcuts'
|
||||
| 'appearance'
|
||||
| 'plugins'
|
||||
| 'about'
|
||||
| 'plans'
|
||||
| 'billing';
|
||||
@@ -52,12 +49,6 @@ export const useGeneralSettingList = (): GeneralSettingList => {
|
||||
icon: KeyboardIcon,
|
||||
testId: 'shortcuts-panel-trigger',
|
||||
},
|
||||
{
|
||||
key: 'plugins',
|
||||
title: 'Plugins',
|
||||
icon: PluginIcon,
|
||||
testId: 'plugins-panel-trigger',
|
||||
},
|
||||
{
|
||||
key: 'about',
|
||||
title: t['com.affine.aboutAFFiNE.title'](),
|
||||
@@ -96,8 +87,6 @@ export const GeneralSetting = ({ generalKey }: GeneralSettingProps) => {
|
||||
return <Shortcuts />;
|
||||
case 'appearance':
|
||||
return <AppearanceSettings />;
|
||||
case 'plugins':
|
||||
return <Plugins />;
|
||||
case 'about':
|
||||
return <AboutAffine />;
|
||||
case 'plans':
|
||||
|
||||
@@ -127,9 +127,6 @@ export const SettingSidebar = ({
|
||||
</div>
|
||||
<div className={sidebarItemsWrapper}>
|
||||
{generalSettingList.map(({ title, icon, key, testId }) => {
|
||||
if (!runtimeConfig.enablePlugin && key === 'plugins') {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className={clsx(sidebarSelectItem, {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { WorkspaceMetadata } from '@affine/workspace/metadata';
|
||||
|
||||
import { useIsWorkspaceOwner } from '../../../../hooks/affine/use-is-workspace-owner';
|
||||
import { WorkspaceSettingDetail } from '../../new-workspace-setting-detail';
|
||||
import { WorkspaceSettingDetail } from './new-workspace-setting-detail';
|
||||
|
||||
export const WorkspaceSetting = ({
|
||||
workspaceMetadata,
|
||||
|
||||
@@ -13,11 +13,11 @@ import { useAsyncCallback } from '@toeverything/hooks/affine-async-hooks';
|
||||
import { useAtomValue, useSetAtom } from 'jotai';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { openSettingModalAtom } from '../../../../atoms';
|
||||
import { openSettingModalAtom } from '../../../../../../atoms';
|
||||
import {
|
||||
RouteLogic,
|
||||
useNavigateHelper,
|
||||
} from '../../../../hooks/use-navigate-helper';
|
||||
} from '../../../../../../hooks/use-navigate-helper';
|
||||
import type { WorkspaceSettingDetailProps } from '../types';
|
||||
import { WorkspaceDeleteModal } from './delete';
|
||||
|
||||
@@ -10,10 +10,10 @@ import { useWorkspaceInfo } from '@toeverything/hooks/use-workspace-info';
|
||||
import { useAtomValue, useSetAtom } from 'jotai';
|
||||
import { useState } from 'react';
|
||||
|
||||
import { openSettingModalAtom } from '../../../atoms';
|
||||
import { useNavigateHelper } from '../../../hooks/use-navigate-helper';
|
||||
import { EnableAffineCloudModal } from '../enable-affine-cloud-modal';
|
||||
import { TmpDisableAffineCloudModal } from '../tmp-disable-affine-cloud-modal';
|
||||
import { openSettingModalAtom } from '../../../../../atoms';
|
||||
import { useNavigateHelper } from '../../../../../hooks/use-navigate-helper';
|
||||
import { EnableAffineCloudModal } from '../../../enable-affine-cloud-modal';
|
||||
import { TmpDisableAffineCloudModal } from '../../../tmp-disable-affine-cloud-modal';
|
||||
import type { WorkspaceSettingDetailProps } from './types';
|
||||
|
||||
export interface PublishPanelProps extends WorkspaceSettingDetailProps {
|
||||
@@ -3,12 +3,12 @@ import {
|
||||
SettingRow,
|
||||
SettingWrapper,
|
||||
} from '@affine/component/setting-components';
|
||||
import { useSelfHosted } from '@affine/core/hooks/affine/use-server-config';
|
||||
import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useWorkspace } from '@toeverything/hooks/use-workspace';
|
||||
import { useWorkspaceInfo } from '@toeverything/hooks/use-workspace-info';
|
||||
|
||||
import { useSelfHosted } from '../../../hooks/affine/use-server-config';
|
||||
import { DeleteLeaveWorkspace } from './delete-leave-workspace';
|
||||
import { EnableCloudPanel } from './enable-cloud';
|
||||
import { ExportPanel } from './export';
|
||||
@@ -29,15 +29,18 @@ import {
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
import { openSettingModalAtom } from '../../../atoms';
|
||||
import type { CheckedUser } from '../../../hooks/affine/use-current-user';
|
||||
import { useCurrentUser } from '../../../hooks/affine/use-current-user';
|
||||
import { useInviteMember } from '../../../hooks/affine/use-invite-member';
|
||||
import { useMemberCount } from '../../../hooks/affine/use-member-count';
|
||||
import { type Member, useMembers } from '../../../hooks/affine/use-members';
|
||||
import { useRevokeMemberPermission } from '../../../hooks/affine/use-revoke-member-permission';
|
||||
import { useUserQuota } from '../../../hooks/use-quota';
|
||||
import { AffineErrorBoundary } from '../affine-error-boundary';
|
||||
import { openSettingModalAtom } from '../../../../../atoms';
|
||||
import type { CheckedUser } from '../../../../../hooks/affine/use-current-user';
|
||||
import { useCurrentUser } from '../../../../../hooks/affine/use-current-user';
|
||||
import { useInviteMember } from '../../../../../hooks/affine/use-invite-member';
|
||||
import { useMemberCount } from '../../../../../hooks/affine/use-member-count';
|
||||
import {
|
||||
type Member,
|
||||
useMembers,
|
||||
} from '../../../../../hooks/affine/use-members';
|
||||
import { useRevokeMemberPermission } from '../../../../../hooks/affine/use-revoke-member-permission';
|
||||
import { useUserQuota } from '../../../../../hooks/use-quota';
|
||||
import { AffineErrorBoundary } from '../../../affine-error-boundary';
|
||||
import * as style from './style.css';
|
||||
import type { WorkspaceSettingDetailProps } from './types';
|
||||
|
||||
@@ -2,6 +2,8 @@ import { FlexWrapper, Input, Wrapper } from '@affine/component';
|
||||
import { pushNotificationAtom } from '@affine/component/notification-center';
|
||||
import { Avatar } from '@affine/component/ui/avatar';
|
||||
import { Button } from '@affine/component/ui/button';
|
||||
import { Upload } from '@affine/core/components/pure/file-upload';
|
||||
import { validateAndReduceImage } from '@affine/core/utils/reduce-image';
|
||||
import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { Workspace } from '@affine/workspace';
|
||||
@@ -19,9 +21,7 @@ import {
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
import { validateAndReduceImage } from '../../../utils/reduce-image';
|
||||
import { Upload } from '../../pure/file-upload';
|
||||
import * as styles from './style.css';
|
||||
import * as style from './style.css';
|
||||
import type { WorkspaceSettingDetailProps } from './types';
|
||||
|
||||
export interface ProfilePanelProps extends WorkspaceSettingDetailProps {
|
||||
@@ -165,7 +165,7 @@ export const ProfilePanel = ({ isOwner, workspace }: ProfilePanelProps) => {
|
||||
const canAdjustAvatar = !workspaceIsLoading && avatarUrl && isOwner;
|
||||
|
||||
return (
|
||||
<div className={styles.profileWrapper}>
|
||||
<div className={style.profileWrapper}>
|
||||
<Upload
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"
|
||||
fileChange={handleUploadAvatar}
|
||||
@@ -195,7 +195,7 @@ export const ProfilePanel = ({ isOwner, workspace }: ProfilePanelProps) => {
|
||||
</Upload>
|
||||
|
||||
<Wrapper marginLeft={20}>
|
||||
<div className={styles.label}>{t['Workspace Name']()}</div>
|
||||
<div className={style.label}>{t['Workspace Name']()}</div>
|
||||
<FlexWrapper alignItems="center" flexGrow="1">
|
||||
<Input
|
||||
disabled={workspaceIsLoading || !isOwner}
|
||||
@@ -1,48 +0,0 @@
|
||||
import { Avatar } from '@affine/component/ui/avatar';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { CloudWorkspaceIcon } from '@blocksuite/icons';
|
||||
import { useAsyncCallback } from '@toeverything/hooks/affine-async-hooks';
|
||||
|
||||
import { useCurrentLoginStatus } from '../../hooks/affine/use-current-login-status';
|
||||
import { useCurrentUser } from '../../hooks/affine/use-current-user';
|
||||
import { signInCloud } from '../../utils/cloud-utils';
|
||||
import { StyledSignInButton } from '../pure/footer/styles';
|
||||
|
||||
export const LoginCard = () => {
|
||||
const t = useAFFiNEI18N();
|
||||
const loginStatus = useCurrentLoginStatus();
|
||||
|
||||
const onSignInClick = useAsyncCallback(async () => {
|
||||
await signInCloud();
|
||||
}, []);
|
||||
|
||||
if (loginStatus === 'authenticated') {
|
||||
return <UserCard />;
|
||||
}
|
||||
return (
|
||||
<StyledSignInButton data-testid="sign-in-button" onClick={onSignInClick}>
|
||||
<div className="circle">
|
||||
<CloudWorkspaceIcon />
|
||||
</div>{' '}
|
||||
{t['Sign in']()}
|
||||
</StyledSignInButton>
|
||||
);
|
||||
};
|
||||
|
||||
const UserCard = () => {
|
||||
const user = useCurrentUser();
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<Avatar size={28} name={user.name} url={user.image} />
|
||||
<div style={{ marginLeft: '15px' }}>
|
||||
<div>{user.name}</div>
|
||||
<div>{user.email}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user