feat: redirect to Plan Required page if subscription status is not active (#2981)

* feat: redirect to Plan Required page if subscription status is not active

Closes #2934

* feat: navigate to Plan Required in PageChangeEffect

* feat: add Twenty logo to Plan Required modal

* test: add Storybook story

* Fix lint

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Thaïs
2023-12-14 12:39:22 +01:00
committed by GitHub
parent 8916dee352
commit a10f353a4c
37 changed files with 285 additions and 110 deletions

View File

@ -116,6 +116,7 @@ export class AuthService {
displayName: '',
domainName: '',
inviteHash: v4(),
subscriptionStatus: 'incomplete',
});
workspace = await this.workspaceRepository.save(workspaceToCreate);

View File

@ -21,6 +21,15 @@ class Telemetry {
anonymizationEnabled: boolean;
}
@ObjectType()
class Billing {
@Field(() => Boolean)
isBillingEnabled: boolean;
@Field(() => String)
billingUrl: string;
}
@ObjectType()
class Support {
@Field(() => String)
@ -38,6 +47,9 @@ export class ClientConfig {
@Field(() => Telemetry, { nullable: false })
telemetry: Telemetry;
@Field(() => Billing, { nullable: false })
billing: Billing;
@Field(() => Boolean)
signInPrefilled: boolean;

View File

@ -21,6 +21,10 @@ export class ClientConfigResolver {
anonymizationEnabled:
this.environmentService.isTelemetryAnonymizationEnabled(),
},
billing: {
isBillingEnabled: this.environmentService.isBillingEnabled(),
billingUrl: this.environmentService.getBillingUrl(),
},
signInPrefilled: this.environmentService.isSignInPrefilled(),
debugMode: this.environmentService.isDebugMode(),
support: {

View File

@ -58,4 +58,8 @@ export class Workspace {
@OneToMany(() => FeatureFlagEntity, (featureFlag) => featureFlag.workspace)
featureFlags: FeatureFlagEntity[];
@Field()
@Column({ default: 'incomplete' })
subscriptionStatus: 'incomplete' | 'active' | 'canceled';
}