mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
chore(editor): add feature flag to embed doc with alias (#11797)
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user