Fix ObjectType casing and conflict between Relation and RelationMetadata (#9849)
Fixes #9827 Also uncovered a conflict with `@objectType('Relation')` and `@objectType('relation)` I don't want to address it in this PR so I will create a followup issue when we close this but I think there's a confusion between Relation/RelationMetadata, it's unclear what is what --------- Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
This commit is contained in:
@ -4,13 +4,13 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { AdminPanelResolver } from 'src/engine/core-modules/admin-panel/admin-panel.resolver';
|
||||
import { AdminPanelService } from 'src/engine/core-modules/admin-panel/admin-panel.service';
|
||||
import { AuthModule } from 'src/engine/core-modules/auth/auth.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([User, Workspace, FeatureFlagEntity], 'core'),
|
||||
TypeOrmModule.forFeature([User, Workspace, FeatureFlag], 'core'),
|
||||
AuthModule,
|
||||
],
|
||||
providers: [AdminPanelResolver, AdminPanelService],
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
} from 'src/engine/core-modules/auth/auth.exception';
|
||||
import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import {
|
||||
FeatureFlagException,
|
||||
FeatureFlagExceptionCode,
|
||||
@ -29,8 +29,8 @@ export class AdminPanelService {
|
||||
private readonly userRepository: Repository<User>,
|
||||
@InjectRepository(Workspace, 'core')
|
||||
private readonly workspaceRepository: Repository<Workspace>,
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
) {}
|
||||
|
||||
async impersonate(userId: string, workspaceId: string) {
|
||||
@ -115,7 +115,7 @@ export class AdminPanelService {
|
||||
userWorkspace.workspace.featureFlags?.find(
|
||||
(flag) => flag.key === key,
|
||||
)?.value ?? false,
|
||||
})) as FeatureFlagEntity[],
|
||||
})) as FeatureFlag[],
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
} from 'src/engine/core-modules/auth/auth.exception';
|
||||
import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@ -49,7 +49,7 @@ describe('AdminPanelService', () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: getRepositoryToken(FeatureFlagEntity, 'core'),
|
||||
provide: getRepositoryToken(FeatureFlag, 'core'),
|
||||
useValue: {
|
||||
update: FeatureFlagUpdateMock,
|
||||
save: FeatureFlagSaveMock,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
|
||||
@ObjectType()
|
||||
class UserInfo {
|
||||
@ -37,8 +37,8 @@ class WorkspaceInfo {
|
||||
@Field(() => [UserInfo])
|
||||
users: UserInfo[];
|
||||
|
||||
@Field(() => [FeatureFlagEntity])
|
||||
featureFlags: FeatureFlagEntity[];
|
||||
@Field(() => [FeatureFlag])
|
||||
featureFlags: FeatureFlag[];
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
|
||||
@ -28,7 +28,7 @@ export enum AppTokenType {
|
||||
}
|
||||
|
||||
@Entity({ name: 'appToken', schema: 'core' })
|
||||
@ObjectType('AppToken')
|
||||
@ObjectType()
|
||||
@BeforeCreateOne(BeforeCreateOneAppToken)
|
||||
export class AppToken {
|
||||
@IDField(() => UUIDScalarType)
|
||||
|
||||
@ -26,7 +26,7 @@ import { TransientTokenService } from 'src/engine/core-modules/auth/token/servic
|
||||
import { TokenModule } from 'src/engine/core-modules/auth/token/token.module';
|
||||
import { DomainManagerModule } from 'src/engine/core-modules/domain-manager/domain-manager.module';
|
||||
import { EmailVerificationModule } from 'src/engine/core-modules/email-verification/email-verification.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { FileUploadModule } from 'src/engine/core-modules/file/file-upload/file-upload.module';
|
||||
import { JwtModule } from 'src/engine/core-modules/jwt/jwt.module';
|
||||
@ -67,7 +67,7 @@ import { JwtAuthStrategy } from './strategies/jwt.auth.strategy';
|
||||
Workspace,
|
||||
User,
|
||||
AppToken,
|
||||
FeatureFlagEntity,
|
||||
FeatureFlag,
|
||||
WorkspaceSSOIdentityProvider,
|
||||
KeyValuePair,
|
||||
],
|
||||
|
||||
@ -25,7 +25,7 @@ import { BillingWebhookPriceService } from 'src/engine/core-modules/billing/webh
|
||||
import { BillingWebhookProductService } from 'src/engine/core-modules/billing/webhooks/services/billing-webhook-product.service';
|
||||
import { BillingWebhookSubscriptionService } from 'src/engine/core-modules/billing/webhooks/services/billing-webhook-subscription.service';
|
||||
import { DomainManagerModule } from 'src/engine/core-modules/domain-manager/domain-manager.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
|
||||
import { MessageQueueModule } from 'src/engine/core-modules/message-queue/message-queue.module';
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
@ -48,7 +48,7 @@ import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
BillingEntitlement,
|
||||
Workspace,
|
||||
UserWorkspace,
|
||||
FeatureFlagEntity,
|
||||
FeatureFlag,
|
||||
],
|
||||
'core',
|
||||
),
|
||||
|
||||
@ -16,7 +16,7 @@ import { BillingEntitlement } from 'src/engine/core-modules/billing/entities/bil
|
||||
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
|
||||
|
||||
@Entity({ name: 'billingCustomer', schema: 'core' })
|
||||
@ObjectType('billingCustomer')
|
||||
@ObjectType()
|
||||
export class BillingCustomer {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
@ -17,7 +17,7 @@ import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/
|
||||
import { BillingCustomer } from 'src/engine/core-modules/billing/entities/billing-customer.entity';
|
||||
import { BillingEntitlementKey } from 'src/engine/core-modules/billing/enums/billing-entitlement-key.enum';
|
||||
@Entity({ name: 'billingEntitlement', schema: 'core' })
|
||||
@ObjectType('billingEntitlement')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnFeatureKeyAndWorkspaceIdUnique', ['key', 'workspaceId'])
|
||||
export class BillingEntitlement {
|
||||
@IDField(() => UUIDScalarType)
|
||||
|
||||
@ -30,7 +30,7 @@ registerEnumType(SubscriptionInterval, { name: 'SubscriptionInterval' });
|
||||
unique: true,
|
||||
where: `status IN ('trialing', 'active', 'past_due')`,
|
||||
})
|
||||
@ObjectType('BillingSubscription')
|
||||
@ObjectType()
|
||||
export class BillingSubscription {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ObjectType, Field } from '@nestjs/graphql';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('TimelineCalendarEventParticipant')
|
||||
@ObjectType()
|
||||
export class TimelineCalendarEventParticipant {
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
personId: string | null;
|
||||
|
||||
@ -4,7 +4,7 @@ import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/
|
||||
import { TimelineCalendarEventParticipant } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto';
|
||||
import { CalendarChannelVisibility } from 'src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity';
|
||||
|
||||
@ObjectType('LinkMetadata')
|
||||
@ObjectType()
|
||||
class LinkMetadata {
|
||||
@Field()
|
||||
label: string;
|
||||
@ -13,7 +13,7 @@ class LinkMetadata {
|
||||
url: string;
|
||||
}
|
||||
|
||||
@ObjectType('LinksMetadata')
|
||||
@ObjectType()
|
||||
export class LinksMetadata {
|
||||
@Field()
|
||||
primaryLinkLabel: string;
|
||||
@ -25,7 +25,7 @@ export class LinksMetadata {
|
||||
secondaryLinks: LinkMetadata[] | null;
|
||||
}
|
||||
|
||||
@ObjectType('TimelineCalendarEvent')
|
||||
@ObjectType()
|
||||
export class TimelineCalendarEvent {
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@ -2,7 +2,7 @@ import { Field, Int, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { TimelineCalendarEvent } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event.dto';
|
||||
|
||||
@ObjectType('TimelineCalendarEventsWithTotal')
|
||||
@ObjectType()
|
||||
export class TimelineCalendarEventsWithTotal {
|
||||
@Field(() => Int)
|
||||
totalNumberOfCalendarEvents: number;
|
||||
|
||||
@ -17,9 +17,9 @@ import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/featu
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@Entity({ name: 'featureFlag', schema: 'core' })
|
||||
@ObjectType('FeatureFlag')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnKeyAndWorkspaceIdUnique', ['key', 'workspaceId'])
|
||||
export class FeatureFlagEntity {
|
||||
export class FeatureFlag {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ -4,16 +4,14 @@ import { NestjsQueryGraphQLModule } from '@ptc-org/nestjs-query-graphql';
|
||||
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
|
||||
|
||||
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeORMModule,
|
||||
NestjsQueryGraphQLModule.forFeature({
|
||||
imports: [
|
||||
NestjsQueryTypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||
],
|
||||
imports: [NestjsQueryTypeOrmModule.forFeature([FeatureFlag], 'core')],
|
||||
services: [],
|
||||
resolvers: [],
|
||||
}),
|
||||
|
||||
@ -6,13 +6,13 @@ import { Repository } from 'typeorm';
|
||||
import { FeatureFlagMap } from 'src/engine/core-modules/feature-flag/interfaces/feature-flag-map.interface';
|
||||
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
|
||||
@Injectable()
|
||||
export class FeatureFlagService {
|
||||
constructor(
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
) {}
|
||||
|
||||
public async isFeatureEnabled(
|
||||
@ -30,7 +30,7 @@ export class FeatureFlagService {
|
||||
|
||||
public async getWorkspaceFeatureFlags(
|
||||
workspaceId: string,
|
||||
): Promise<FeatureFlagEntity[]> {
|
||||
): Promise<FeatureFlag[]> {
|
||||
return this.featureFlagRepository.find({ where: { workspaceId } });
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ export enum KeyValuePairType {
|
||||
}
|
||||
|
||||
@Entity({ name: 'keyValuePair', schema: 'core' })
|
||||
@ObjectType('KeyValuePair')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnKeyUserIdWorkspaceIdUnique', ['key', 'userId', 'workspaceId'])
|
||||
@Index('IndexOnKeyWorkspaceIdAndNullUserIdUnique', ['key', 'workspaceId'], {
|
||||
unique: true,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
import { LabResolver } from './lab.resolver';
|
||||
@ -9,7 +9,7 @@ import { LabResolver } from './lab.resolver';
|
||||
import { LabService } from './services/lab.service';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([FeatureFlagEntity, Workspace], 'core')],
|
||||
imports: [TypeOrmModule.forFeature([FeatureFlag, Workspace], 'core')],
|
||||
providers: [LabService, LabResolver],
|
||||
exports: [LabService],
|
||||
})
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
AuthExceptionCode,
|
||||
} from 'src/engine/core-modules/auth/auth.exception';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import {
|
||||
FeatureFlagException,
|
||||
FeatureFlagExceptionCode,
|
||||
@ -22,8 +22,8 @@ import { workspaceValidator } from 'src/engine/core-modules/workspace/workspace.
|
||||
@Injectable()
|
||||
export class LabService {
|
||||
constructor(
|
||||
@InjectRepository(FeatureFlagEntity, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||
@InjectRepository(FeatureFlag, 'core')
|
||||
private readonly featureFlagRepository: Repository<FeatureFlag>,
|
||||
@InjectRepository(Workspace, 'core')
|
||||
private readonly workspaceRepository: Repository<Workspace>,
|
||||
) {}
|
||||
|
||||
@ -2,7 +2,7 @@ import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
|
||||
@ObjectType('TimelineThreadParticipant')
|
||||
@ObjectType()
|
||||
export class TimelineThreadParticipant {
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
personId: string | null;
|
||||
|
||||
@ -4,7 +4,7 @@ import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/
|
||||
import { TimelineThreadParticipant } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
|
||||
import { MessageChannelVisibility } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
|
||||
|
||||
@ObjectType('TimelineThread')
|
||||
@ObjectType()
|
||||
export class TimelineThread {
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@ -2,7 +2,7 @@ import { Field, Int, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { TimelineThread } from 'src/engine/core-modules/messaging/dtos/timeline-thread.dto';
|
||||
|
||||
@ObjectType('TimelineThreadsWithTotal')
|
||||
@ObjectType()
|
||||
export class TimelineThreadsWithTotal {
|
||||
@Field(() => Int)
|
||||
totalNumberOfThreads: number;
|
||||
|
||||
@ -6,7 +6,7 @@ import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
|
||||
|
||||
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
import { BillingModule } from 'src/engine/core-modules/billing/billing.module';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { SSOService } from 'src/engine/core-modules/sso/services/sso.service';
|
||||
import { SSOResolver } from 'src/engine/core-modules/sso/sso.resolver';
|
||||
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||
@ -17,7 +17,7 @@ import { GuardRedirectModule } from 'src/engine/core-modules/guard-redirect/guar
|
||||
@Module({
|
||||
imports: [
|
||||
NestjsQueryTypeOrmModule.forFeature(
|
||||
[WorkspaceSSOIdentityProvider, User, AppToken, FeatureFlagEntity],
|
||||
[WorkspaceSSOIdentityProvider, User, AppToken, FeatureFlag],
|
||||
'core',
|
||||
),
|
||||
BillingModule,
|
||||
|
||||
@ -45,7 +45,7 @@ registerEnumType(SSOIdentityProviderStatus, {
|
||||
});
|
||||
|
||||
@Entity({ name: 'workspaceSSOIdentityProvider', schema: 'core' })
|
||||
@ObjectType('WorkspaceSSOIdentityProvider')
|
||||
@ObjectType()
|
||||
export class WorkspaceSSOIdentityProvider {
|
||||
// COMMON
|
||||
@IDField(() => UUIDScalarType)
|
||||
|
||||
@ -14,7 +14,7 @@ import {
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
|
||||
@Entity({ name: 'twoFactorMethod', schema: 'core' })
|
||||
@ObjectType('TwoFactorMethod')
|
||||
@ObjectType()
|
||||
export class TwoFactorMethod {
|
||||
@Field()
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
@ -20,7 +20,7 @@ import { User } from 'src/engine/core-modules/user/user.entity';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
@Entity({ name: 'userWorkspace', schema: 'core' })
|
||||
@ObjectType('UserWorkspace')
|
||||
@ObjectType()
|
||||
@Unique('IndexOnUserIdAndWorkspaceIdUnique', ['userId', 'workspaceId'])
|
||||
export class UserWorkspace {
|
||||
@IDField(() => UUIDScalarType)
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
WorkspaceMemberTimeFormatEnum,
|
||||
} from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
@ObjectType('FullName')
|
||||
@ObjectType()
|
||||
export class FullName {
|
||||
@Field({ nullable: false })
|
||||
firstName: string;
|
||||
@ -17,7 +17,7 @@ export class FullName {
|
||||
lastName: string;
|
||||
}
|
||||
|
||||
@ObjectType('WorkspaceMember')
|
||||
@ObjectType()
|
||||
export class WorkspaceMember {
|
||||
@IDField(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@ -27,7 +27,7 @@ registerEnumType(OnboardingStatus, {
|
||||
});
|
||||
|
||||
@Entity({ name: 'user', schema: 'core' })
|
||||
@ObjectType('User')
|
||||
@ObjectType()
|
||||
@Index('UQ_USER_EMAIL', ['email'], {
|
||||
unique: true,
|
||||
where: '"deletedAt" IS NULL',
|
||||
|
||||
@ -15,7 +15,7 @@ import {
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
||||
import { PostgresCredentials } from 'src/engine/core-modules/postgres-credentials/postgres-credentials.entity';
|
||||
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||
@ -26,7 +26,7 @@ registerEnumType(WorkspaceActivationStatus, {
|
||||
});
|
||||
|
||||
@Entity({ name: 'workspace', schema: 'core' })
|
||||
@ObjectType('Workspace')
|
||||
@ObjectType()
|
||||
export class Workspace {
|
||||
@IDField(() => UUIDScalarType)
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
@ -83,8 +83,8 @@ export class Workspace {
|
||||
@Column({ default: true })
|
||||
isPublicInviteLinkEnabled: boolean;
|
||||
|
||||
@OneToMany(() => FeatureFlagEntity, (featureFlag) => featureFlag.workspace)
|
||||
featureFlags: Relation<FeatureFlagEntity[]>;
|
||||
@OneToMany(() => FeatureFlag, (featureFlag) => featureFlag.workspace)
|
||||
featureFlags: Relation<FeatureFlag[]>;
|
||||
|
||||
@Field({ nullable: true })
|
||||
workspaceMembersCount: number;
|
||||
|
||||
@ -19,7 +19,7 @@ import { BillingSubscriptionService } from 'src/engine/core-modules/billing/serv
|
||||
import { DomainManagerService } from 'src/engine/core-modules/domain-manager/services/domain-manager.service';
|
||||
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
import { FileUploadService } from 'src/engine/core-modules/file/file-upload/services/file-upload.service';
|
||||
import { FileService } from 'src/engine/core-modules/file/services/file.service';
|
||||
@ -142,10 +142,8 @@ export class WorkspaceResolver {
|
||||
return `${paths[0]}?token=${workspaceLogoToken}`;
|
||||
}
|
||||
|
||||
@ResolveField(() => [FeatureFlagEntity], { nullable: true })
|
||||
async featureFlags(
|
||||
@Parent() workspace: Workspace,
|
||||
): Promise<FeatureFlagEntity[]> {
|
||||
@ResolveField(() => [FeatureFlag], { nullable: true })
|
||||
async featureFlags(@Parent() workspace: Workspace): Promise<FeatureFlag[]> {
|
||||
const featureFlags = await this.featureFlagService.getWorkspaceFeatureFlags(
|
||||
workspace.id,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user