chore(editor): add feature flag to embed doc with alias (#11797)

This commit is contained in:
L-Sun
2025-04-18 07:39:16 +00:00
parent 9c02512d7c
commit 3264e65980
6 changed files with 38 additions and 5 deletions

View File

@@ -2,11 +2,17 @@ import { type Framework } from '@toeverything/infra';
import { DocsService } from '../doc';
import { EditorSettingService } from '../editor-setting';
import { FeatureFlagService } from '../feature-flag';
import { WorkspaceScope, WorkspaceService } from '../workspace';
import { DndService } from './services';
export function configureDndModule(framework: Framework) {
framework
.scope(WorkspaceScope)
.service(DndService, [DocsService, WorkspaceService, EditorSettingService]);
.service(DndService, [
DocsService,
WorkspaceService,
EditorSettingService,
FeatureFlagService,
]);
}

View File

@@ -18,6 +18,7 @@ import { Service } from '@toeverything/infra';
import type { DocsService } from '../../doc';
import type { EditorSettingService } from '../../editor-setting';
import type { FeatureFlagService } from '../../feature-flag';
import { resolveLinkToDoc } from '../../navigation';
import type { WorkspaceService } from '../../workspace';
@@ -34,7 +35,8 @@ export class DndService extends Service {
constructor(
private readonly docsService: DocsService,
private readonly workspaceService: WorkspaceService,
private readonly editorSettingService: EditorSettingService
private readonly editorSettingService: EditorSettingService,
private readonly featureFlagService: FeatureFlagService
) {
super();
@@ -185,7 +187,9 @@ export class DndService extends Service {
return false;
},
onDropTargetChange: (args: MonitorDragEvent<MixedDNDData>) => {
changeDocCardView(args);
if (this.featureFlagService.flags.enable_embed_doc_with_alias.value) {
changeDocCardView(args);
}
},
})
);

View File

@@ -260,6 +260,15 @@ export const AFFINE_FLAGS = {
'https://discord.com/channels/959027316334407691/1358384103925350542',
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,
},
} satisfies { [key in string]: FlagInfo };
// oxlint-disable-next-line no-redeclare