mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
chore(editor): remove feature flag of embed doc with alias (#12620)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Toolbar actions related to embedding and duplicating documents are now always available without restrictions. - **Chores** - Removed the feature flag controlling embed document alias features for a simpler user experience. - **Tests** - Updated test setup to remove reliance on the deprecated feature flag. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
|||||||
ActionPlacement,
|
ActionPlacement,
|
||||||
DocDisplayMetaProvider,
|
DocDisplayMetaProvider,
|
||||||
EditorSettingProvider,
|
EditorSettingProvider,
|
||||||
FeatureFlagService,
|
|
||||||
type LinkEventType,
|
type LinkEventType,
|
||||||
type OpenDocMode,
|
type OpenDocMode,
|
||||||
type ToolbarAction,
|
type ToolbarAction,
|
||||||
@@ -216,12 +215,7 @@ const conversionsActionGroup = {
|
|||||||
run(ctx) {
|
run(ctx) {
|
||||||
const block = ctx.getCurrentBlockByType(EmbedLinkedDocBlockComponent);
|
const block = ctx.getCurrentBlockByType(EmbedLinkedDocBlockComponent);
|
||||||
|
|
||||||
if (
|
if (isGfxBlockComponent(block)) {
|
||||||
ctx.std
|
|
||||||
.get(FeatureFlagService)
|
|
||||||
.getFlag('enable_embed_doc_with_alias') &&
|
|
||||||
isGfxBlockComponent(block)
|
|
||||||
) {
|
|
||||||
const editorSetting = ctx.std.getOptional(EditorSettingProvider);
|
const editorSetting = ctx.std.getOptional(EditorSettingProvider);
|
||||||
editorSetting?.set?.(
|
editorSetting?.set?.(
|
||||||
'docCanvasPreferView',
|
'docCanvasPreferView',
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import { REFERENCE_NODE } from '@blocksuite/affine-shared/consts';
|
|||||||
import {
|
import {
|
||||||
ActionPlacement,
|
ActionPlacement,
|
||||||
EditorSettingProvider,
|
EditorSettingProvider,
|
||||||
FeatureFlagService,
|
|
||||||
type LinkEventType,
|
type LinkEventType,
|
||||||
type OpenDocMode,
|
type OpenDocMode,
|
||||||
type ToolbarAction,
|
type ToolbarAction,
|
||||||
@@ -163,12 +162,7 @@ const conversionsActionGroup = {
|
|||||||
label: 'Card view',
|
label: 'Card view',
|
||||||
run(ctx) {
|
run(ctx) {
|
||||||
const block = ctx.getCurrentBlockByType(EmbedSyncedDocBlockComponent);
|
const block = ctx.getCurrentBlockByType(EmbedSyncedDocBlockComponent);
|
||||||
if (
|
if (isGfxBlockComponent(block)) {
|
||||||
ctx.std
|
|
||||||
.get(FeatureFlagService)
|
|
||||||
.getFlag('enable_embed_doc_with_alias') &&
|
|
||||||
isGfxBlockComponent(block)
|
|
||||||
) {
|
|
||||||
const editorSetting = ctx.std.getOptional(EditorSettingProvider);
|
const editorSetting = ctx.std.getOptional(EditorSettingProvider);
|
||||||
editorSetting?.set?.(
|
editorSetting?.set?.(
|
||||||
'docCanvasPreferView',
|
'docCanvasPreferView',
|
||||||
@@ -296,8 +290,6 @@ const builtinSurfaceToolbarConfig = {
|
|||||||
label: 'Insert to page',
|
label: 'Insert to page',
|
||||||
tooltip: 'Insert to page',
|
tooltip: 'Insert to page',
|
||||||
icon: InsertIntoPageIcon(),
|
icon: InsertIntoPageIcon(),
|
||||||
when: ({ std }) =>
|
|
||||||
std.get(FeatureFlagService).getFlag('enable_embed_doc_with_alias'),
|
|
||||||
run: ctx => {
|
run: ctx => {
|
||||||
const model = ctx.getCurrentModelByType(EmbedSyncedDocModel);
|
const model = ctx.getCurrentModelByType(EmbedSyncedDocModel);
|
||||||
if (!model) return;
|
if (!model) return;
|
||||||
@@ -334,8 +326,6 @@ const builtinSurfaceToolbarConfig = {
|
|||||||
tooltip:
|
tooltip:
|
||||||
'Duplicate as note to create an editable copy, the original remains unchanged.',
|
'Duplicate as note to create an editable copy, the original remains unchanged.',
|
||||||
icon: DuplicateIcon(),
|
icon: DuplicateIcon(),
|
||||||
when: ({ std }) =>
|
|
||||||
std.get(FeatureFlagService).getFlag('enable_embed_doc_with_alias'),
|
|
||||||
run: ctx => {
|
run: ctx => {
|
||||||
const { gfx } = ctx;
|
const { gfx } = ctx;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export interface BlockSuiteFlags {
|
|||||||
enable_callout: boolean;
|
enable_callout: boolean;
|
||||||
enable_edgeless_scribbled_style: boolean;
|
enable_edgeless_scribbled_style: boolean;
|
||||||
enable_table_virtual_scroll: boolean;
|
enable_table_virtual_scroll: boolean;
|
||||||
enable_embed_doc_with_alias: boolean;
|
|
||||||
enable_turbo_renderer: boolean;
|
enable_turbo_renderer: boolean;
|
||||||
enable_dom_renderer: boolean;
|
enable_dom_renderer: boolean;
|
||||||
}
|
}
|
||||||
@@ -45,7 +44,6 @@ export class FeatureFlagService extends StoreExtension {
|
|||||||
enable_callout: false,
|
enable_callout: false,
|
||||||
enable_edgeless_scribbled_style: false,
|
enable_edgeless_scribbled_style: false,
|
||||||
enable_table_virtual_scroll: false,
|
enable_table_virtual_scroll: false,
|
||||||
enable_embed_doc_with_alias: false,
|
|
||||||
enable_turbo_renderer: false,
|
enable_turbo_renderer: false,
|
||||||
enable_dom_renderer: false,
|
enable_dom_renderer: false,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,17 +2,11 @@ import { type Framework } from '@toeverything/infra';
|
|||||||
|
|
||||||
import { DocsService } from '../doc';
|
import { DocsService } from '../doc';
|
||||||
import { EditorSettingService } from '../editor-setting';
|
import { EditorSettingService } from '../editor-setting';
|
||||||
import { FeatureFlagService } from '../feature-flag';
|
|
||||||
import { WorkspaceScope, WorkspaceService } from '../workspace';
|
import { WorkspaceScope, WorkspaceService } from '../workspace';
|
||||||
import { DndService } from './services';
|
import { DndService } from './services';
|
||||||
|
|
||||||
export function configureDndModule(framework: Framework) {
|
export function configureDndModule(framework: Framework) {
|
||||||
framework
|
framework
|
||||||
.scope(WorkspaceScope)
|
.scope(WorkspaceScope)
|
||||||
.service(DndService, [
|
.service(DndService, [DocsService, WorkspaceService, EditorSettingService]);
|
||||||
DocsService,
|
|
||||||
WorkspaceService,
|
|
||||||
EditorSettingService,
|
|
||||||
FeatureFlagService,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import { Service } from '@toeverything/infra';
|
|||||||
|
|
||||||
import type { DocsService } from '../../doc';
|
import type { DocsService } from '../../doc';
|
||||||
import type { EditorSettingService } from '../../editor-setting';
|
import type { EditorSettingService } from '../../editor-setting';
|
||||||
import type { FeatureFlagService } from '../../feature-flag';
|
|
||||||
import { resolveLinkToDoc } from '../../navigation';
|
import { resolveLinkToDoc } from '../../navigation';
|
||||||
import type { WorkspaceService } from '../../workspace';
|
import type { WorkspaceService } from '../../workspace';
|
||||||
|
|
||||||
@@ -35,8 +34,7 @@ export class DndService extends Service {
|
|||||||
constructor(
|
constructor(
|
||||||
private readonly docsService: DocsService,
|
private readonly docsService: DocsService,
|
||||||
private readonly workspaceService: WorkspaceService,
|
private readonly workspaceService: WorkspaceService,
|
||||||
private readonly editorSettingService: EditorSettingService,
|
private readonly editorSettingService: EditorSettingService
|
||||||
private readonly featureFlagService: FeatureFlagService
|
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@@ -186,9 +184,7 @@ export class DndService extends Service {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
onDropTargetChange: (args: MonitorDragEvent<MixedDNDData>) => {
|
onDropTargetChange: (args: MonitorDragEvent<MixedDNDData>) => {
|
||||||
if (this.featureFlagService.flags.enable_embed_doc_with_alias.value) {
|
changeDocCardView(args);
|
||||||
changeDocCardView(args);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -259,15 +259,6 @@ export const AFFINE_FLAGS = {
|
|||||||
configurable: isCanaryBuild,
|
configurable: isCanaryBuild,
|
||||||
defaultState: false,
|
defaultState: false,
|
||||||
},
|
},
|
||||||
// TODO(@L-Sun): remove this flag after the feature is released
|
|
||||||
enable_embed_doc_with_alias: {
|
|
||||||
category: 'blocksuite',
|
|
||||||
bsFlag: 'enable_embed_doc_with_alias',
|
|
||||||
displayName: 'Embed doc with alias',
|
|
||||||
description: 'Embed doc with alias',
|
|
||||||
configurable: isCanaryBuild,
|
|
||||||
defaultState: isCanaryBuild,
|
|
||||||
},
|
|
||||||
enable_setting_subpage_animation: {
|
enable_setting_subpage_animation: {
|
||||||
category: 'affine',
|
category: 'affine',
|
||||||
displayName: 'Enable Setting Subpage Animation',
|
displayName: 'Enable Setting Subpage Animation',
|
||||||
|
|||||||
@@ -142,14 +142,6 @@ test.describe('Embed synced doc in edgeless mode', () => {
|
|||||||
{ title: 'Page 1', content: 'hello page 1', inEdgeless: true },
|
{ title: 'Page 1', content: 'hello page 1', inEdgeless: true },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// TODO(@L-Sun): remove this after this feature is released
|
|
||||||
await page.evaluate(() => {
|
|
||||||
const { FeatureFlagService } = window.$blocksuite.services;
|
|
||||||
window.editor.std
|
|
||||||
.get(FeatureFlagService)
|
|
||||||
.setFlag('enable_embed_doc_with_alias', true);
|
|
||||||
});
|
|
||||||
|
|
||||||
await switchEditorMode(page);
|
await switchEditorMode(page);
|
||||||
|
|
||||||
const edgelessEmbedSyncedBlock = page.locator(
|
const edgelessEmbedSyncedBlock = page.locator(
|
||||||
|
|||||||
Reference in New Issue
Block a user