mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
chore: remove multiple cloud server flag (#12531)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - The "Add Selfhosted" and "Add Server" options are now displayed whenever the build configuration is native, without relying on feature flags. - **Refactor** - Simplified conditional rendering for server addition buttons by replacing feature flag checks with build configuration checks. - **Chores** - Removed the "Multiple Cloud Servers" feature flag and its related localization strings, streamlining feature management and UI labels. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -10,7 +10,6 @@ import { OAuth } from '@affine/core/components/affine/auth/oauth';
|
|||||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||||
import { AuthService, ServerService } from '@affine/core/modules/cloud';
|
import { AuthService, ServerService } from '@affine/core/modules/cloud';
|
||||||
import type { AuthSessionStatus } from '@affine/core/modules/cloud/entities/session';
|
import type { AuthSessionStatus } from '@affine/core/modules/cloud/entities/session';
|
||||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
|
||||||
import { ServerDeploymentType } from '@affine/graphql';
|
import { ServerDeploymentType } from '@affine/graphql';
|
||||||
import { Trans, useI18n } from '@affine/i18n';
|
import { Trans, useI18n } from '@affine/i18n';
|
||||||
import {
|
import {
|
||||||
@@ -61,10 +60,6 @@ export const SignInStep = ({
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
const authService = useService(AuthService);
|
const authService = useService(AuthService);
|
||||||
const featureFlagService = useService(FeatureFlagService);
|
|
||||||
const enableMultipleCloudServers = useLiveData(
|
|
||||||
featureFlagService.flags.enable_multiple_cloud_servers.$
|
|
||||||
);
|
|
||||||
const [isMutating, setIsMutating] = useState(false);
|
const [isMutating, setIsMutating] = useState(false);
|
||||||
|
|
||||||
const [email, setEmail] = useState('');
|
const [email, setEmail] = useState('');
|
||||||
@@ -181,7 +176,7 @@ export const SignInStep = ({
|
|||||||
<div className={style.skipDividerLine} />
|
<div className={style.skipDividerLine} />
|
||||||
</div>
|
</div>
|
||||||
<div className={style.skipSection}>
|
<div className={style.skipSection}>
|
||||||
{BUILD_CONFIG.isElectron && enableMultipleCloudServers ? (
|
{BUILD_CONFIG.isNative ? (
|
||||||
<Button
|
<Button
|
||||||
variant="plain"
|
variant="plain"
|
||||||
className={style.addSelfhostedButton}
|
className={style.addSelfhostedButton}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import { Divider, MenuItem } from '@affine/component';
|
import { Divider, MenuItem } from '@affine/component';
|
||||||
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
||||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { PlusIcon } from '@blocksuite/icons/rc';
|
import { PlusIcon } from '@blocksuite/icons/rc';
|
||||||
import { useLiveData, useService } from '@toeverything/infra';
|
import { useService } from '@toeverything/infra';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -16,18 +15,15 @@ import { addServerDividerWrapper } from './index.css';
|
|||||||
export const AddServer = () => {
|
export const AddServer = () => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const globalDialogService = useService(GlobalDialogService);
|
const globalDialogService = useService(GlobalDialogService);
|
||||||
const featureFlagService = useService(FeatureFlagService);
|
|
||||||
const enableMultipleServer = useLiveData(
|
|
||||||
featureFlagService.flags.enable_multiple_cloud_servers.$
|
|
||||||
);
|
|
||||||
|
|
||||||
const onAddServer = useCallback(() => {
|
const onAddServer = useCallback(() => {
|
||||||
globalDialogService.open('sign-in', { step: 'addSelfhosted' });
|
globalDialogService.open('sign-in', { step: 'addSelfhosted' });
|
||||||
}, [globalDialogService]);
|
}, [globalDialogService]);
|
||||||
|
|
||||||
if (!enableMultipleServer) {
|
if (!BUILD_CONFIG.isNative) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={addServerDividerWrapper}>
|
<div className={addServerDividerWrapper}>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
ServersService,
|
ServersService,
|
||||||
} from '@affine/core/modules/cloud';
|
} from '@affine/core/modules/cloud';
|
||||||
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
||||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
|
||||||
import { GlobalContextService } from '@affine/core/modules/global-context';
|
import { GlobalContextService } from '@affine/core/modules/global-context';
|
||||||
import {
|
import {
|
||||||
type WorkspaceMetadata,
|
type WorkspaceMetadata,
|
||||||
@@ -262,18 +261,15 @@ const CloudWorkSpaceList = ({
|
|||||||
|
|
||||||
const AddServer = () => {
|
const AddServer = () => {
|
||||||
const globalDialogService = useService(GlobalDialogService);
|
const globalDialogService = useService(GlobalDialogService);
|
||||||
const featureFlagService = useService(FeatureFlagService);
|
|
||||||
const enableMultipleServer = useLiveData(
|
|
||||||
featureFlagService.flags.enable_multiple_cloud_servers.$
|
|
||||||
);
|
|
||||||
|
|
||||||
const onAddServer = useCallback(() => {
|
const onAddServer = useCallback(() => {
|
||||||
globalDialogService.open('sign-in', { step: 'addSelfhosted' });
|
globalDialogService.open('sign-in', { step: 'addSelfhosted' });
|
||||||
}, [globalDialogService]);
|
}, [globalDialogService]);
|
||||||
|
|
||||||
if (!enableMultipleServer) {
|
if (!BUILD_CONFIG.isNative) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <IconButton onClick={onAddServer} size="24" icon={<SelfhostIcon />} />;
|
return <IconButton onClick={onAddServer} size="24" icon={<SelfhostIcon />} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -209,15 +209,6 @@ export const AFFINE_FLAGS = {
|
|||||||
configurable: false,
|
configurable: false,
|
||||||
defaultState: isMobile,
|
defaultState: isMobile,
|
||||||
},
|
},
|
||||||
enable_multiple_cloud_servers: {
|
|
||||||
category: 'affine',
|
|
||||||
displayName:
|
|
||||||
'com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.name',
|
|
||||||
description:
|
|
||||||
'com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.description',
|
|
||||||
configurable: false,
|
|
||||||
defaultState: isDesktopEnvironment || BUILD_CONFIG.isIOS,
|
|
||||||
},
|
|
||||||
enable_mobile_edgeless_editing: {
|
enable_mobile_edgeless_editing: {
|
||||||
category: 'affine',
|
category: 'affine',
|
||||||
displayName:
|
displayName:
|
||||||
|
|||||||
@@ -5834,14 +5834,6 @@ export function useAFFiNEI18N(): {
|
|||||||
* `Once enabled, users can import and export blocksuite snapshots.`
|
* `Once enabled, users can import and export blocksuite snapshots.`
|
||||||
*/
|
*/
|
||||||
["com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.description"](): string;
|
["com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.description"](): string;
|
||||||
/**
|
|
||||||
* `Multiple Cloud Servers`
|
|
||||||
*/
|
|
||||||
["com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.name"](): string;
|
|
||||||
/**
|
|
||||||
* `Once enabled, users can connect to selfhosted cloud servers.`
|
|
||||||
*/
|
|
||||||
["com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.description"](): string;
|
|
||||||
/**
|
/**
|
||||||
* `Enable Edgeless Editing`
|
* `Enable Edgeless Editing`
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1456,8 +1456,6 @@
|
|||||||
"com.affine.settings.workspace.experimental-features.enable-mobile-linked-doc-menu.description": "Enables the mobile linked doc menu.",
|
"com.affine.settings.workspace.experimental-features.enable-mobile-linked-doc-menu.description": "Enables the mobile linked doc menu.",
|
||||||
"com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.name": "Enable Snapshot Import Export",
|
"com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.name": "Enable Snapshot Import Export",
|
||||||
"com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.description": "Once enabled, users can import and export blocksuite snapshots.",
|
"com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.description": "Once enabled, users can import and export blocksuite snapshots.",
|
||||||
"com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.name": "Multiple Cloud Servers",
|
|
||||||
"com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.description": "Once enabled, users can connect to selfhosted cloud servers.",
|
|
||||||
"com.affine.settings.workspace.experimental-features.enable-mobile-edgeless-editing.name": "Enable Edgeless Editing",
|
"com.affine.settings.workspace.experimental-features.enable-mobile-edgeless-editing.name": "Enable Edgeless Editing",
|
||||||
"com.affine.settings.workspace.experimental-features.enable-mobile-edgeless-editing.description": "Once enabled, users can edit edgeless canvas.",
|
"com.affine.settings.workspace.experimental-features.enable-mobile-edgeless-editing.description": "Once enabled, users can edit edgeless canvas.",
|
||||||
"com.affine.settings.workspace.experimental-features.enable-pdf-embed-preview.name": "PDF embed preview",
|
"com.affine.settings.workspace.experimental-features.enable-pdf-embed-preview.name": "PDF embed preview",
|
||||||
|
|||||||
Reference in New Issue
Block a user