Enable new record board and messaging for all workspaces except demo (#4243)

* Enable new record board and messaging for all workspaces except demo

* Fix according to PR
This commit is contained in:
Charles Bochet
2024-02-29 18:22:32 +01:00
committed by GitHub
parent 773f698faf
commit fb439e3045
16 changed files with 72 additions and 233 deletions

View File

@ -37,14 +37,25 @@ export class GoogleGmailAuthController {
const { workspaceMemberId, workspaceId } =
await this.tokenService.verifyTransientToken(transientToken);
await this.googleGmailService.saveConnectedAccount({
handle: email,
workspaceMemberId: workspaceMemberId,
workspaceId: workspaceId,
provider: 'gmail',
accessToken,
refreshToken,
});
const demoWorkspaceIds = this.environmentService.getDemoWorkspaceIds();
if (demoWorkspaceIds.includes(workspaceId)) {
throw new Error('Cannot connect Gmail account to demo workspace');
}
if (!workspaceId) {
throw new Error('Workspace not found');
}
if (workspaceId)
await this.googleGmailService.saveConnectedAccount({
handle: email,
workspaceMemberId: workspaceMemberId,
workspaceId: workspaceId,
provider: 'gmail',
accessToken,
refreshToken,
});
return res.redirect(
`${this.environmentService.getFrontBaseUrl()}/settings/accounts`,

View File

@ -16,10 +16,7 @@ import { Workspace } from 'src/core/workspace/workspace.entity';
export enum FeatureFlagKeys {
IsBlocklistEnabled = 'IS_BLOCKLIST_ENABLED',
IsCalendarEnabled = 'IS_CALENDAR_ENABLED',
IsMessagingEnabled = 'IS_MESSAGING_ENABLED',
IsNewRecordBoardEnabled = 'IS_NEW_RECORD_BOARD_ENABLED',
IsSelfBillingEnabled = 'IS_SELF_BILLING_ENABLED',
IsWorkspaceCleanable = 'IS_WORKSPACE_CLEANABLE',
}
@Entity({ name: 'featureFlag', schema: 'core' })