Remove groupBy feature flag (#15281)
This commit is contained in:
@@ -1237,7 +1237,6 @@ export enum FeatureFlagKey {
|
||||
IS_CORE_VIEW_SYNCING_ENABLED = 'IS_CORE_VIEW_SYNCING_ENABLED',
|
||||
IS_DYNAMIC_SEARCH_FIELDS_ENABLED = 'IS_DYNAMIC_SEARCH_FIELDS_ENABLED',
|
||||
IS_EMAILING_DOMAIN_ENABLED = 'IS_EMAILING_DOMAIN_ENABLED',
|
||||
IS_GROUP_BY_ENABLED = 'IS_GROUP_BY_ENABLED',
|
||||
IS_IMAP_SMTP_CALDAV_ENABLED = 'IS_IMAP_SMTP_CALDAV_ENABLED',
|
||||
IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED',
|
||||
|
||||
@@ -1201,7 +1201,6 @@ export enum FeatureFlagKey {
|
||||
IS_CORE_VIEW_SYNCING_ENABLED = 'IS_CORE_VIEW_SYNCING_ENABLED',
|
||||
IS_DYNAMIC_SEARCH_FIELDS_ENABLED = 'IS_DYNAMIC_SEARCH_FIELDS_ENABLED',
|
||||
IS_EMAILING_DOMAIN_ENABLED = 'IS_EMAILING_DOMAIN_ENABLED',
|
||||
IS_GROUP_BY_ENABLED = 'IS_GROUP_BY_ENABLED',
|
||||
IS_IMAP_SMTP_CALDAV_ENABLED = 'IS_IMAP_SMTP_CALDAV_ENABLED',
|
||||
IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED',
|
||||
|
||||
-8
@@ -17,7 +17,6 @@ import {
|
||||
AuthExceptionCode,
|
||||
} from 'src/engine/core-modules/auth/auth.exception';
|
||||
import { type AuthContext } from 'src/engine/core-modules/auth/types/auth-context.type';
|
||||
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 { ObjectMetadataMaps } from 'src/engine/metadata-modules/types/object-metadata-maps';
|
||||
import { getResolverName } from 'src/engine/utils/get-resolver-name.util';
|
||||
@@ -116,15 +115,8 @@ export class WorkspaceResolverFactory {
|
||||
continue;
|
||||
}
|
||||
|
||||
const isGroupByEnabled =
|
||||
workspaceFeatureFlagsMap[FeatureFlagKey.IS_GROUP_BY_ENABLED];
|
||||
|
||||
// Generate query resolvers
|
||||
for (const methodName of workspaceResolverBuilderMethods.queries) {
|
||||
if (methodName === 'groupBy' && !isGroupByEnabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const resolverName = getResolverName(objectMetadata, methodName);
|
||||
const resolverFactory = factories.get(methodName);
|
||||
|
||||
|
||||
+2
-8
@@ -42,19 +42,13 @@ export class GqlTypeGenerator {
|
||||
private readonly mutationTypeGenerator: MutationTypeGenerator,
|
||||
) {}
|
||||
|
||||
async buildAndStore(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceId: string,
|
||||
) {
|
||||
async buildAndStore(objectMetadataCollection: ObjectMetadataEntity[]) {
|
||||
const compositeTypeCollection = [...compositeTypeDefinitions.values()];
|
||||
|
||||
this.buildAndStoreCompositeFieldMetadataGqlTypes(compositeTypeCollection);
|
||||
this.buildAndStoreDateFieldMetadataGroupByGqlTypes();
|
||||
this.buildAndStoreObjectMetadataGqlTypes(objectMetadataCollection);
|
||||
await this.queryTypeGenerator.buildAndStore(
|
||||
objectMetadataCollection,
|
||||
workspaceId,
|
||||
);
|
||||
await this.queryTypeGenerator.buildAndStore(objectMetadataCollection);
|
||||
this.mutationTypeGenerator.buildAndStore(objectMetadataCollection);
|
||||
}
|
||||
|
||||
|
||||
+2
-15
@@ -6,8 +6,6 @@ import { workspaceResolverBuilderMethodNames } from 'src/engine/api/graphql/work
|
||||
import { GqlOperation } from 'src/engine/api/graphql/workspace-schema-builder/enums/gql-operation.enum';
|
||||
import { RootTypeGenerator } from 'src/engine/api/graphql/workspace-schema-builder/graphql-type-generators/root-types/root-type.generator';
|
||||
import { GqlTypesStorage } from 'src/engine/api/graphql/workspace-schema-builder/storages/gql-types.storage';
|
||||
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 { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
|
||||
@Injectable()
|
||||
@@ -15,23 +13,12 @@ export class QueryTypeGenerator {
|
||||
constructor(
|
||||
private readonly rootTypeGenerator: RootTypeGenerator,
|
||||
private readonly gqlTypesStorage: GqlTypesStorage,
|
||||
private readonly featureFlagService: FeatureFlagService,
|
||||
) {}
|
||||
|
||||
async buildAndStore(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceId: string,
|
||||
) {
|
||||
const isGroupByEnabled = await this.featureFlagService.isFeatureEnabled(
|
||||
FeatureFlagKey.IS_GROUP_BY_ENABLED,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
async buildAndStore(objectMetadataCollection: ObjectMetadataEntity[]) {
|
||||
return this.rootTypeGenerator.buildAndStore(
|
||||
objectMetadataCollection,
|
||||
[...workspaceResolverBuilderMethodNames.queries].filter(
|
||||
(methodName) => methodName !== 'groupBy' || isGroupByEnabled,
|
||||
),
|
||||
workspaceResolverBuilderMethodNames.queries,
|
||||
GqlOperation.Query,
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ export class RootTypeGenerator {
|
||||
|
||||
buildAndStore(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceResolverMethodNames: WorkspaceResolverBuilderMethodNames[],
|
||||
workspaceResolverMethodNames: readonly WorkspaceResolverBuilderMethodNames[],
|
||||
objectTypeName: GqlOperation,
|
||||
) {
|
||||
if (workspaceResolverMethodNames.length === 0) {
|
||||
@@ -61,7 +61,7 @@ export class RootTypeGenerator {
|
||||
|
||||
private generateFields(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceResolverMethodNames: WorkspaceResolverBuilderMethodNames[],
|
||||
workspaceResolverMethodNames: readonly WorkspaceResolverBuilderMethodNames[],
|
||||
): GraphQLRootTypeFieldConfigMap {
|
||||
const fieldConfigMap: GraphQLRootTypeFieldConfigMap = {};
|
||||
|
||||
|
||||
+1
-5
@@ -19,12 +19,8 @@ export class WorkspaceGraphQLSchemaGenerator {
|
||||
|
||||
async generateSchema(
|
||||
objectMetadataCollection: ObjectMetadataEntity[],
|
||||
workspaceId: string,
|
||||
): Promise<GraphQLSchema> {
|
||||
await this.gqlTypeGenerator.buildAndStore(
|
||||
objectMetadataCollection,
|
||||
workspaceId,
|
||||
);
|
||||
await this.gqlTypeGenerator.buildAndStore(objectMetadataCollection);
|
||||
|
||||
// Assemble schema
|
||||
const schema = new GraphQLSchema({
|
||||
|
||||
@@ -108,7 +108,6 @@ export class WorkspaceSchemaFactory {
|
||||
const autoGeneratedSchema =
|
||||
await this.workspaceGraphQLSchemaGenerator.generateSchema(
|
||||
objectMetadataCollection,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
usedScalarNames =
|
||||
|
||||
-1
@@ -16,7 +16,6 @@ export enum FeatureFlagKey {
|
||||
IS_RECORD_PAGE_LAYOUT_ENABLED = 'IS_RECORD_PAGE_LAYOUT_ENABLED',
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED',
|
||||
IS_CALENDAR_VIEW_ENABLED = 'IS_CALENDAR_VIEW_ENABLED',
|
||||
IS_GROUP_BY_ENABLED = 'IS_GROUP_BY_ENABLED',
|
||||
IS_PUBLIC_DOMAIN_ENABLED = 'IS_PUBLIC_DOMAIN_ENABLED',
|
||||
IS_EMAILING_DOMAIN_ENABLED = 'IS_EMAILING_DOMAIN_ENABLED',
|
||||
IS_DYNAMIC_SEARCH_FIELDS_ENABLED = 'IS_DYNAMIC_SEARCH_FIELDS_ENABLED',
|
||||
|
||||
-2
@@ -139,7 +139,6 @@ describe('WorkspaceEntityManager', () => {
|
||||
IS_RECORD_PAGE_LAYOUT_ENABLED: false,
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED: false,
|
||||
IS_CALENDAR_VIEW_ENABLED: false,
|
||||
IS_GROUP_BY_ENABLED: true,
|
||||
IS_PUBLIC_DOMAIN_ENABLED: false,
|
||||
IS_EMAILING_DOMAIN_ENABLED: false,
|
||||
IS_DYNAMIC_SEARCH_FIELDS_ENABLED: false,
|
||||
@@ -171,7 +170,6 @@ describe('WorkspaceEntityManager', () => {
|
||||
IS_RECORD_PAGE_LAYOUT_ENABLED: false,
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED: false,
|
||||
IS_CALENDAR_VIEW_ENABLED: false,
|
||||
IS_GROUP_BY_ENABLED: false,
|
||||
IS_PUBLIC_DOMAIN_ENABLED: false,
|
||||
IS_EMAILING_DOMAIN_ENABLED: false,
|
||||
IS_DYNAMIC_SEARCH_FIELDS_ENABLED: false,
|
||||
|
||||
-5
@@ -81,11 +81,6 @@ export const seedFeatureFlags = async (
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_GROUP_BY_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_PUBLIC_DOMAIN_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
|
||||
Reference in New Issue
Block a user