remove isRichTextV2Enabled feature flag (#10562)
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import { QueryResultGetterHandlerInterface } from 'src/engine/api/graphql/workspace-query-runner/factories/query-result-getters/interfaces/query-result-getter-handler.interface';
|
||||
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
import { FileService } from 'src/engine/core-modules/file/services/file.service';
|
||||
import { NoteWorkspaceEntity } from 'src/modules/note/standard-objects/note.workspace-entity';
|
||||
@ -22,14 +21,7 @@ export class ActivityQueryResultGetterHandler
|
||||
activity: TaskWorkspaceEntity | NoteWorkspaceEntity,
|
||||
workspaceId: string,
|
||||
): Promise<TaskWorkspaceEntity | NoteWorkspaceEntity> {
|
||||
const isRichTextV2Enabled = await this.featureFlagService.isFeatureEnabled(
|
||||
FeatureFlagKey.IsRichTextV2Enabled,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
const blocknoteJson = isRichTextV2Enabled
|
||||
? activity.bodyV2?.blocknote
|
||||
: activity.body;
|
||||
const blocknoteJson = activity.bodyV2?.blocknote;
|
||||
|
||||
if (!activity.id || !blocknoteJson) {
|
||||
return activity;
|
||||
@ -44,7 +36,7 @@ export class ActivityQueryResultGetterHandler
|
||||
// TODO: Remove this once we have removed the old rich text
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
`Failed to parse body for activity ${activity.id} in workspace ${workspaceId}, for rich text version ${isRichTextV2Enabled ? 'v2' : 'v1'}`,
|
||||
`Failed to parse body for activity ${activity.id} in workspace ${workspaceId}, for rich text version 'v2'`,
|
||||
);
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(blocknoteJson);
|
||||
@ -76,19 +68,12 @@ export class ActivityQueryResultGetterHandler
|
||||
}),
|
||||
);
|
||||
|
||||
if (isRichTextV2Enabled) {
|
||||
return {
|
||||
...activity,
|
||||
bodyV2: {
|
||||
blocknote: JSON.stringify(blocknoteWithSignedPayload),
|
||||
markdown: activity.bodyV2?.markdown ?? null,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
...activity,
|
||||
body: JSON.stringify(blocknoteWithSignedPayload),
|
||||
bodyV2: {
|
||||
blocknote: JSON.stringify(blocknoteWithSignedPayload),
|
||||
markdown: activity.bodyV2?.markdown ?? null,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,6 +205,10 @@ export class QueryRunnerArgsFactory {
|
||||
}
|
||||
case FieldMetadataType.NUMBER:
|
||||
return [key, value === null ? null : Number(value)];
|
||||
case FieldMetadataType.RICH_TEXT:
|
||||
throw new Error(
|
||||
'Rich text is not supported, please use RICH_TEXT_V2 instead',
|
||||
);
|
||||
case FieldMetadataType.RICH_TEXT_V2: {
|
||||
const richTextV2Value = richTextV2ValueSchema.parse(value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user