From 7c42c843986fc0f7e6660baaf04bbec9edacca58 Mon Sep 17 00:00:00 2001 From: Martin Schuhmacher <55735359+MartinSchuhmacher@users.noreply.github.com> Date: Thu, 22 Aug 2024 13:35:29 +0200 Subject: [PATCH] BC-7822 - Implement new sidebar option for rooms (#5177) * add rooms feature flag * set FEATURE_ROOMS_ENABLED on local --- apps/server/src/modules/server/api/dto/config.response.ts | 4 ++++ apps/server/src/modules/server/api/test/server.api.spec.ts | 1 + apps/server/src/modules/server/server.config.ts | 2 ++ config/default.schema.json | 5 +++++ config/development.json | 3 ++- 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/server/src/modules/server/api/dto/config.response.ts b/apps/server/src/modules/server/api/dto/config.response.ts index 3af23653e34..2642d2d6761 100644 --- a/apps/server/src/modules/server/api/dto/config.response.ts +++ b/apps/server/src/modules/server/api/dto/config.response.ts @@ -218,6 +218,9 @@ export class ConfigResponse { @ApiProperty() FEATURE_AI_TUTOR_ENABLED: boolean; + @ApiProperty() + FEATURE_ROOMS_ENABLED: boolean; + constructor(config: ServerConfig) { this.ACCESSIBILITY_REPORT_EMAIL = config.ACCESSIBILITY_REPORT_EMAIL; this.ADMIN_TABLES_DISPLAY_CONSENT_COLUMN = config.ADMIN_TABLES_DISPLAY_CONSENT_COLUMN; @@ -289,5 +292,6 @@ export class ConfigResponse { this.BOARD_COLLABORATION_URI = config.BOARD_COLLABORATION_URI; this.FEATURE_SCHULCONNEX_MEDIA_LICENSE_ENABLED = config.FEATURE_SCHULCONNEX_MEDIA_LICENSE_ENABLED; this.FEATURE_AI_TUTOR_ENABLED = config.FEATURE_AI_TUTOR_ENABLED; + this.FEATURE_ROOMS_ENABLED = config.FEATURE_ROOMS_ENABLED; } } diff --git a/apps/server/src/modules/server/api/test/server.api.spec.ts b/apps/server/src/modules/server/api/test/server.api.spec.ts index d75b5d81cb0..58fe1d2f799 100644 --- a/apps/server/src/modules/server/api/test/server.api.spec.ts +++ b/apps/server/src/modules/server/api/test/server.api.spec.ts @@ -100,6 +100,7 @@ describe('Server Controller (API)', () => { 'BOARD_COLLABORATION_URI', 'FEATURE_SCHULCONNEX_MEDIA_LICENSE_ENABLED', 'FEATURE_AI_TUTOR_ENABLED', + 'FEATURE_ROOMS_ENABLED', ]; expect(response.status).toEqual(HttpStatus.OK); diff --git a/apps/server/src/modules/server/server.config.ts b/apps/server/src/modules/server/server.config.ts index 6d89546906e..147ad77b200 100644 --- a/apps/server/src/modules/server/server.config.ts +++ b/apps/server/src/modules/server/server.config.ts @@ -122,6 +122,7 @@ export interface ServerConfig SCHULCONNEX_CLIENT__CLIENT_ID: string | undefined; SCHULCONNEX_CLIENT__CLIENT_SECRET: string | undefined; FEATURE_AI_TUTOR_ENABLED: boolean; + FEATURE_ROOMS_ENABLED: boolean; } const config: ServerConfig = { @@ -288,6 +289,7 @@ const config: ServerConfig = { ) as boolean, FEATURE_SANIS_GROUP_PROVISIONING_ENABLED: Configuration.get('FEATURE_SANIS_GROUP_PROVISIONING_ENABLED') as boolean, FEATURE_AI_TUTOR_ENABLED: Configuration.get('FEATURE_AI_TUTOR_ENABLED') as boolean, + FEATURE_ROOMS_ENABLED: Configuration.get('FEATURE_ROOMS_ENABLED') as boolean, }; export const serverConfig = () => config; diff --git a/config/default.schema.json b/config/default.schema.json index 352ac7a3dbc..7b28b3ff4fc 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -1660,6 +1660,11 @@ "type": "boolean", "default": false, "description": "Enables the AI Tutor" + }, + "FEATURE_ROOMS_ENABLED": { + "type": "boolean", + "default": "false", + "description": "Enables the rooms feature" } }, "required": [] diff --git a/config/development.json b/config/development.json index d7ca49e6e14..d51a82784be 100644 --- a/config/development.json +++ b/config/development.json @@ -90,5 +90,6 @@ "ADMIN_API": { "ALLOWED_API_KEYS": "thisisasupersecureapikeythatisabsolutelysave" }, - "TRAINING_URL": "https://lernen.dbildungscloud.de" + "TRAINING_URL": "https://lernen.dbildungscloud.de", + "FEATURE_ROOMS_ENABLED": true }