diff --git a/backend/openapi/components/requestBodies/update-room-config-request.yaml b/backend/openapi/components/requestBodies/update-room-config-request.yaml index 860b82b..d411985 100644 --- a/backend/openapi/components/requestBodies/update-room-config-request.yaml +++ b/backend/openapi/components/requestBodies/update-room-config-request.yaml @@ -8,9 +8,9 @@ content: $ref: '../schemas/meet-room-config.yaml#/MeetRoomConfig' example: config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true diff --git a/backend/openapi/components/responses/success-get-room.yaml b/backend/openapi/components/responses/success-get-room.yaml index c11c272..67a2821 100644 --- a/backend/openapi/components/responses/success-get-room.yaml +++ b/backend/openapi/components/responses/success-get-room.yaml @@ -15,11 +15,11 @@ content: withMeeting: when_meeting_ends withRecordings: close config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true moderatorUrl: 'http://localhost:6080/room/room-123?secret=123456' speakerUrl: 'http://localhost:6080/room/room-123?secret=654321' @@ -39,11 +39,11 @@ content: creationDate: 1620000000000 autoDeletionDate: 1900000000000 config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true fields=moderatorUrl,speakerUrl: diff --git a/backend/openapi/components/responses/success-get-rooms.yaml b/backend/openapi/components/responses/success-get-rooms.yaml index cae8982..ffd1d07 100644 --- a/backend/openapi/components/responses/success-get-rooms.yaml +++ b/backend/openapi/components/responses/success-get-rooms.yaml @@ -24,11 +24,11 @@ content: withMeeting: when_meeting_ends withRecordings: close config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true moderatorUrl: 'http://localhost:6080/room/room-123?secret=123456' speakerUrl: 'http://localhost:6080/room/room-123?secret=654321' @@ -42,11 +42,11 @@ content: withMeeting: when_meeting_ends withRecordings: close config: - chatConfig: + chat: enabled: false - recordingConfig: + recording: enabled: true - virtualBackgroundConfig: + virtualBackground: enabled: false moderatorUrl: 'http://localhost:6080/room/room-456?secret=789012' speakerUrl: 'http://localhost:6080/room/room-456?secret=210987' @@ -74,22 +74,22 @@ content: creationDate: 1620000000000 autoDeletionDate: 1900000000000 config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true - roomId: 'room-456' roomName: 'room' creationDate: 1620001000000 autoDeletionDate: 1900000000000 config: - chatConfig: + chat: enabled: false - recordingConfig: + recording: enabled: true - virtualBackgroundConfig: + virtualBackground: enabled: false pagination: isTruncated: true diff --git a/backend/openapi/components/responses/success-room-process-deletion.yaml b/backend/openapi/components/responses/success-room-process-deletion.yaml index beba872..a1931dc 100644 --- a/backend/openapi/components/responses/success-room-process-deletion.yaml +++ b/backend/openapi/components/responses/success-room-process-deletion.yaml @@ -41,11 +41,11 @@ content: roomName: room creationDate: 1620000000000 config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true moderatorUrl: 'http://localhost:6080/room/room-123?secret=123456' speakerUrl: 'http://localhost:6080/room/room-123?secret=654321' @@ -64,11 +64,11 @@ content: roomName: room creationDate: 1620000000000 config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true moderatorUrl: 'http://localhost:6080/room/room-123?secret=123456' speakerUrl: 'http://localhost:6080/room/room-123?secret=654321' diff --git a/backend/openapi/components/responses/success-room-schedule-deletion.yaml b/backend/openapi/components/responses/success-room-schedule-deletion.yaml index dd2550d..b83feeb 100644 --- a/backend/openapi/components/responses/success-room-schedule-deletion.yaml +++ b/backend/openapi/components/responses/success-room-schedule-deletion.yaml @@ -26,11 +26,11 @@ content: roomName: room creationDate: 1620000000000 config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true moderatorUrl: 'http://localhost:6080/room/room-123?secret=123456' speakerUrl: 'http://localhost:6080/room/room-123?secret=654321' @@ -45,11 +45,11 @@ content: roomName: room creationDate: 1620000000000 config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true moderatorUrl: 'http://localhost:6080/room/room-123?secret=123456' speakerUrl: 'http://localhost:6080/room/room-123?secret=654321' @@ -64,11 +64,11 @@ content: roomName: room creationDate: 1620000000000 config: - chatConfig: + chat: enabled: true - recordingConfig: + recording: enabled: false - virtualBackgroundConfig: + virtualBackground: enabled: true moderatorUrl: 'http://localhost:6080/room/room-123?secret=123456' speakerUrl: 'http://localhost:6080/room/room-123?secret=654321' diff --git a/backend/openapi/components/schemas/meet-room-config.yaml b/backend/openapi/components/schemas/meet-room-config.yaml index 2e1d130..7852a58 100644 --- a/backend/openapi/components/schemas/meet-room-config.yaml +++ b/backend/openapi/components/schemas/meet-room-config.yaml @@ -1,13 +1,13 @@ MeetRoomConfig: type: object properties: - chatConfig: + chat: $ref: '#/MeetChatConfig' description: Config for the chat feature in the room. - recordingConfig: + recording: $ref: '#/MeetRecordingConfig' description: Config for recording the room. - virtualBackgroundConfig: + virtualBackground: $ref: '#/MeetVirtualBackgroundConfig' description: Config for virtual background in the room. MeetChatConfig: diff --git a/backend/src/environment.ts b/backend/src/environment.ts index 8672a3b..2d5ec23 100644 --- a/backend/src/environment.ts +++ b/backend/src/environment.ts @@ -111,11 +111,13 @@ export const logEnvVars = () => { console.log('MEET PREFERENCES STORAGE:', text(MEET_PREFERENCES_STORAGE_MODE)); console.log('MEET INITIAL ADMIN USER: ', credential('****' + MEET_INITIAL_ADMIN_USER.slice(-3))); console.log('MEET INITIAL ADMIN PASSWORD: ', credential('****' + MEET_INITIAL_ADMIN_PASSWORD.slice(-3))); + if (!MEET_INITIAL_API_KEY) { console.log(chalk.red('MEET INITIAL_API_KEY: none')); } else { console.log('MEET INITIAL API KEY: ', credential('****' + MEET_INITIAL_API_KEY.slice(-3))); } + console.log('MEET INITIAL WEBHOOK ENABLED:', text(MEET_INITIAL_WEBHOOK_ENABLED)); if (MEET_INITIAL_WEBHOOK_ENABLED === 'true') { diff --git a/backend/src/middlewares/recording.middleware.ts b/backend/src/middlewares/recording.middleware.ts index 72d41c9..efdf698 100644 --- a/backend/src/middlewares/recording.middleware.ts +++ b/backend/src/middlewares/recording.middleware.ts @@ -27,7 +27,7 @@ export const withRecordingEnabled = async (req: Request, res: Response, next: Ne const roomId = extractRoomIdFromRequest(req); const room: MeetRoom = await roomService.getMeetRoom(roomId!); - if (!room.config?.recordingConfig?.enabled) { + if (!room.config.recording.enabled) { logger.debug(`Recording is disabled for room '${roomId}'`); const error = errorRecordingDisabled(roomId!); return rejectRequestFromMeetError(res, error); diff --git a/backend/src/middlewares/request-validators/room-validator.middleware.ts b/backend/src/middlewares/request-validators/room-validator.middleware.ts index e707608..1d42409 100644 --- a/backend/src/middlewares/request-validators/room-validator.middleware.ts +++ b/backend/src/middlewares/request-validators/room-validator.middleware.ts @@ -90,9 +90,9 @@ const VirtualBackgroundConfigSchema: z.ZodType = z. }); const RoomConfigSchema: z.ZodType = z.object({ - recordingConfig: RecordingConfigSchema, - chatConfig: ChatConfigSchema, - virtualBackgroundConfig: VirtualBackgroundConfigSchema + recording: RecordingConfigSchema, + chat: ChatConfigSchema, + virtualBackground: VirtualBackgroundConfigSchema }); const RoomDeletionPolicyWithMeetingSchema: z.ZodType = z.enum([ @@ -151,9 +151,9 @@ const RoomRequestOptionsSchema: z.ZodType = z.object({ } ), config: RoomConfigSchema.optional().default({ - recordingConfig: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, + chat: { enabled: true }, + virtualBackground: { enabled: true } }) // maxParticipants: z // .number() diff --git a/backend/src/middlewares/room.middleware.ts b/backend/src/middlewares/room.middleware.ts index 8991102..925872a 100644 --- a/backend/src/middlewares/room.middleware.ts +++ b/backend/src/middlewares/room.middleware.ts @@ -62,7 +62,7 @@ export const configureRecordingTokenAuth = async (req: Request, res: Response, n throw errorRoomMetadataNotFound(roomId); } - const recordingAccess = room.config!.recordingConfig.allowAccessTo; + const recordingAccess = room.config?.recording.allowAccessTo; if (!recordingAccess || recordingAccess === MeetRecordingAccess.ADMIN) { // Deny request if the room is configured to allow access to recordings only for admins diff --git a/backend/src/services/frontend-event.service.ts b/backend/src/services/frontend-event.service.ts index 6f8063d..1819129 100644 --- a/backend/src/services/frontend-event.service.ts +++ b/backend/src/services/frontend-event.service.ts @@ -75,7 +75,7 @@ export class FrontendEventService { try { const payload: MeetRoomConfigUpdatedPayload = { roomId, - config: updatedRoom.config!, + config: updatedRoom.config, timestamp: Date.now() }; diff --git a/backend/src/services/room.service.ts b/backend/src/services/room.service.ts index 287156b..dfb2835 100644 --- a/backend/src/services/room.service.ts +++ b/backend/src/services/room.service.ts @@ -684,7 +684,7 @@ export class RoomService { } protected getRecordingPermissions(room: Partial, role: ParticipantRole): RecordingPermissions { - const recordingAccess = room.config!.recordingConfig.allowAccessTo; + const recordingAccess = room.config?.recording.allowAccessTo; // A participant can delete recordings if they are a moderator and the recording access is not set to admin const canDeleteRecordings = role === ParticipantRole.MODERATOR && recordingAccess !== MeetRecordingAccess.ADMIN; diff --git a/backend/src/services/storage/storage.service.ts b/backend/src/services/storage/storage.service.ts index 23da6b1..8090aff 100644 --- a/backend/src/services/storage/storage.service.ts +++ b/backend/src/services/storage/storage.service.ts @@ -303,7 +303,7 @@ export class MeetStorageService< moderatorUrl: room.moderatorUrl, speakerUrl: room.speakerUrl, config: { - recordingConfig: room.config?.recordingConfig + recording: room.config.recording } } as Partial; diff --git a/backend/tests/helpers/assertion-helpers.ts b/backend/tests/helpers/assertion-helpers.ts index 158ab0b..dba0fba 100644 --- a/backend/tests/helpers/assertion-helpers.ts +++ b/backend/tests/helpers/assertion-helpers.ts @@ -146,12 +146,12 @@ export const expectValidRoom = ( expect(room.config).toEqual(config); } else { expect(room.config).toEqual({ - recordingConfig: { + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } }); } diff --git a/backend/tests/helpers/request-helpers.ts b/backend/tests/helpers/request-helpers.ts index 279922f..03b6250 100644 --- a/backend/tests/helpers/request-helpers.ts +++ b/backend/tests/helpers/request-helpers.ts @@ -263,14 +263,14 @@ export const updateRoomConfig = async (roomId: string, config: any) => { export const updateRecordingAccessConfigInRoom = async (roomId: string, recordingAccess: MeetRecordingAccess) => { const response = await updateRoomConfig(roomId, { - recordingConfig: { + recording: { enabled: true, allowAccessTo: recordingAccess }, - chatConfig: { + chat: { enabled: true }, - virtualBackgroundConfig: { + virtualBackground: { enabled: true } }); diff --git a/backend/tests/integration/api/rooms/create-room.test.ts b/backend/tests/integration/api/rooms/create-room.test.ts index 534e4c6..7bcbc37 100644 --- a/backend/tests/integration/api/rooms/create-room.test.ts +++ b/backend/tests/integration/api/rooms/create-room.test.ts @@ -59,12 +59,12 @@ describe('Room API Tests', () => { withRecordings: MeetRoomDeletionPolicyWithRecordings.FORCE }, config: { - recordingConfig: { + recording: { enabled: false, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: false }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: false }, + virtualBackground: { enabled: true } } }; @@ -237,12 +237,12 @@ describe('Room API Tests', () => { roomName: 'TestRoom', autoDeletionDate: validAutoDeletionDate, config: { - recordingConfig: { + recording: { enabled: 'yes', // invalid boolean allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } } }; diff --git a/backend/tests/integration/api/rooms/get-room-preferences.test.ts b/backend/tests/integration/api/rooms/get-room-preferences.test.ts index ddc0283..3b47741 100644 --- a/backend/tests/integration/api/rooms/get-room-preferences.test.ts +++ b/backend/tests/integration/api/rooms/get-room-preferences.test.ts @@ -6,12 +6,12 @@ import { setupSingleRoom } from '../../../helpers/test-scenarios.js'; describe('Room API Tests', () => { const DEFAULT_CONFIG = { - recordingConfig: { + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } }; beforeAll(() => { @@ -36,12 +36,12 @@ describe('Room API Tests', () => { const payload = { roomName: 'custom-prefs', config: { - recordingConfig: { + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: false } + chat: { enabled: true }, + virtualBackground: { enabled: false } } }; diff --git a/backend/tests/integration/api/rooms/get-room.test.ts b/backend/tests/integration/api/rooms/get-room.test.ts index 4602264..3b560b5 100644 --- a/backend/tests/integration/api/rooms/get-room.test.ts +++ b/backend/tests/integration/api/rooms/get-room.test.ts @@ -36,12 +36,12 @@ describe('Room API Tests', () => { const payload = { roomName: 'custom-prefs', config: { - recordingConfig: { + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: false } + chat: { enabled: true }, + virtualBackground: { enabled: false } } }; // Create a room with custom config diff --git a/backend/tests/integration/api/rooms/update-room-preferences.test.ts b/backend/tests/integration/api/rooms/update-room-preferences.test.ts index 2ea0635..60507b3 100644 --- a/backend/tests/integration/api/rooms/update-room-preferences.test.ts +++ b/backend/tests/integration/api/rooms/update-room-preferences.test.ts @@ -34,23 +34,23 @@ describe('Room API Tests', () => { const createdRoom = await createRoom({ roomName: 'update-test', config: { - recordingConfig: { + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } } }); // Update the room config const updatedConfig = { - recordingConfig: { + recording: { enabled: false, allowAccessTo: MeetRecordingAccess.ADMIN }, - chatConfig: { enabled: false }, - virtualBackgroundConfig: { enabled: false } + chat: { enabled: false }, + virtualBackground: { enabled: false } }; const updateResponse = await updateRoomConfig(createdRoom.roomId, updatedConfig); @@ -82,23 +82,23 @@ describe('Room API Tests', () => { const createdRoom = await createRoom({ roomName: 'partial-update', config: { - recordingConfig: { + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } } }); // Update only one preference const partialConfig = { - recordingConfig: { + recording: { enabled: false, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } }; const updateResponse = await updateRoomConfig(createdRoom.roomId, partialConfig); @@ -121,17 +121,17 @@ describe('Room API Tests', () => { // Invalid config (missing required fields) const invalidConfig = { - recordingConfig: { + recording: { enabled: false }, - // Missing chatConfig - virtualBackgroundConfig: { enabled: false } + // Missing chat config + virtualBackground: { enabled: false } }; const response = await updateRoomConfig(roomId, invalidConfig); expect(response.status).toBe(422); expect(response.body.error).toContain('Unprocessable Entity'); - expect(JSON.stringify(response.body.details)).toContain('chatConfig'); + expect(JSON.stringify(response.body.details)).toContain('chat'); }); it('should fail when config has incorrect types', async () => { @@ -141,18 +141,18 @@ describe('Room API Tests', () => { // Invalid config (wrong types) const invalidConfig = { - recordingConfig: { + recording: { enabled: 'true', // String instead of boolean allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: false }, - virtualBackgroundConfig: { enabled: false } + chat: { enabled: false }, + virtualBackground: { enabled: false } }; const response = await updateRoomConfig(createdRoom.roomId, invalidConfig); expect(response.status).toBe(422); expect(response.body.error).toContain('Unprocessable Entity'); - expect(JSON.stringify(response.body.details)).toContain('recordingConfig.enabled'); + expect(JSON.stringify(response.body.details)).toContain('recording.enabled'); }); it('should fail when config is missing required properties', async () => { @@ -173,29 +173,29 @@ describe('Room API Tests', () => { }); const invalidConfig = { - recordingConfig: { + recording: { enabled: true // Missing allowAccessTo }, - chatConfig: { enabled: false }, - virtualBackgroundConfig: { enabled: false } + chat: { enabled: false }, + virtualBackground: { enabled: false } }; const response = await updateRoomConfig(createdRoom.roomId, invalidConfig); expect(response.status).toBe(422); expect(response.body.error).toContain('Unprocessable Entity'); - expect(JSON.stringify(response.body.details)).toContain('recordingConfig.allowAccessTo'); + expect(JSON.stringify(response.body.details)).toContain('recording.allowAccessTo'); }); it('should return 404 when updating non-existent room', async () => { const nonExistentRoomId = 'non-existent-room'; const config = { - recordingConfig: { + recording: { enabled: false, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: false }, - virtualBackgroundConfig: { enabled: false } + chat: { enabled: false }, + virtualBackground: { enabled: false } }; const response = await updateRoomConfig(nonExistentRoomId, config); diff --git a/backend/tests/integration/api/security/room-security.test.ts b/backend/tests/integration/api/security/room-security.test.ts index d46ba2e..e486c56 100644 --- a/backend/tests/integration/api/security/room-security.test.ts +++ b/backend/tests/integration/api/security/room-security.test.ts @@ -244,12 +244,12 @@ describe('Room API Security Tests', () => { describe('Update Room Config Tests', () => { const roomConfig = { - recordingConfig: { + recording: { enabled: false, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } }; let roomId: string; diff --git a/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/steps/recording-config/recording-config.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/steps/recording-config/recording-config.component.ts index f53ae08..f3d1d36 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/steps/recording-config/recording-config.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/steps/recording-config/recording-config.component.ts @@ -90,7 +90,7 @@ export class RecordingConfigComponent implements OnDestroy { const stepData: any = { config: { - recordingConfig: { + recording: { enabled, ...(enabled && { allowAccessTo: formValue.allowAccessTo }) } diff --git a/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/steps/room-config/room-config.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/steps/room-config/room-config.component.ts index 14276c0..be6e075 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/steps/room-config/room-config.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/console/rooms/room-wizard/steps/room-config/room-config.component.ts @@ -35,10 +35,10 @@ export class RoomConfigComponent implements OnDestroy { private saveFormData(formValue: any): void { const stepData: any = { config: { - chatConfig: { + chat: { enabled: formValue.chatEnabled }, - virtualBackgroundConfig: { + virtualBackground: { enabled: formValue.virtualBackgroundsEnabled } } diff --git a/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts index afeea69..81eeb32 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts @@ -383,7 +383,7 @@ export class MeetingComponent implements OnInit { this.featureConfService.setRoomConfig(config); // Refresh recording token if recording is enabled - if (config.recordingConfig.enabled) { + if (config.recording.enabled) { try { await this.recordingService.generateRecordingToken(this.roomId, this.roomSecret); } catch (error) { diff --git a/frontend/projects/shared-meet-components/src/lib/services/feature-configuration.service.ts b/frontend/projects/shared-meet-components/src/lib/services/feature-configuration.service.ts index f10bf30..943ee8b 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/feature-configuration.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/feature-configuration.service.ts @@ -138,9 +138,9 @@ export class FeatureConfigurationService { // Apply room configurations if (roomPrefs) { - features.showRecordingPanel = roomPrefs.recordingConfig.enabled; - features.showChat = roomPrefs.chatConfig.enabled; - features.showBackgrounds = roomPrefs.virtualBackgroundConfig.enabled; + features.showRecordingPanel = roomPrefs.recording.enabled; + features.showChat = roomPrefs.chat.enabled; + features.showBackgrounds = roomPrefs.virtualBackground.enabled; } // Apply participant permissions (these can restrict enabled features) diff --git a/frontend/projects/shared-meet-components/src/lib/services/wizard-state.service.ts b/frontend/projects/shared-meet-components/src/lib/services/wizard-state.service.ts index b52c284..d13dfc9 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/wizard-state.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/wizard-state.service.ts @@ -11,12 +11,12 @@ import { // Default room config following the app's defaults const DEFAULT_CONFIG: MeetRoomConfig = { - recordingConfig: { + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } }; /** @@ -156,8 +156,8 @@ export class RoomWizardStateService { isActive: editMode, // Only active in edit mode isVisible: true, formGroup: this.formBuilder.group({ - recordingEnabled: initialRoomOptions.config!.recordingConfig.enabled ? 'enabled' : 'disabled', - allowAccessTo: initialRoomOptions.config!.recordingConfig.allowAccessTo + recordingEnabled: initialRoomOptions.config!.recording.enabled ? 'enabled' : 'disabled', + allowAccessTo: initialRoomOptions.config!.recording.allowAccessTo }) }, { @@ -187,8 +187,8 @@ export class RoomWizardStateService { isActive: false, isVisible: true, formGroup: this.formBuilder.group({ - chatEnabled: initialRoomOptions.config!.chatConfig.enabled, - virtualBackgroundsEnabled: initialRoomOptions.config!.virtualBackgroundConfig.enabled + chatEnabled: initialRoomOptions.config!.chat.enabled, + virtualBackgroundsEnabled: initialRoomOptions.config!.virtualBackground.enabled }) } ]; @@ -234,9 +234,9 @@ export class RoomWizardStateService { ...currentOptions, config: { ...currentOptions.config, - recordingConfig: { - ...currentOptions.config?.recordingConfig, - ...stepData.config?.recordingConfig + recording: { + ...currentOptions.config?.recording, + ...stepData.config?.recording } } as MeetRoomConfig }; @@ -251,17 +251,17 @@ export class RoomWizardStateService { ...currentOptions, config: { ...currentOptions.config, - chatConfig: { - ...currentOptions.config?.chatConfig, - ...stepData.config?.chatConfig + chat: { + ...currentOptions.config?.chat, + ...stepData.config?.chat }, - virtualBackgroundConfig: { - ...currentOptions.config?.virtualBackgroundConfig, - ...stepData.config?.virtualBackgroundConfig + virtualBackground: { + ...currentOptions.config?.virtualBackground, + ...stepData.config?.virtualBackground }, - recordingConfig: { - ...currentOptions.config?.recordingConfig, - ...stepData.config?.recordingConfig + recording: { + ...currentOptions.config?.recording, + ...stepData.config?.recording } } as MeetRoomConfig }; @@ -283,7 +283,7 @@ export class RoomWizardStateService { const currentSteps = this._steps(); const currentOptions = this._roomOptions(); // TODO: Uncomment when recording config is fully implemented - const recordingEnabled = false; // currentOptions.config?.recordingConfig.enabled ?? false; + const recordingEnabled = false; // currentOptions.config?.recording.enabled ?? false; // Update recording steps visibility based on recordingEnabled const updatedSteps = currentSteps.map((step) => { diff --git a/frontend/webcomponent/tests/e2e/recording-access.test.ts b/frontend/webcomponent/tests/e2e/recording-access.test.ts index 48f8bb8..6af34b8 100644 --- a/frontend/webcomponent/tests/e2e/recording-access.test.ts +++ b/frontend/webcomponent/tests/e2e/recording-access.test.ts @@ -75,12 +75,12 @@ test.describe('Recording Access Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -96,12 +96,12 @@ test.describe('Recording Access Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -117,12 +117,12 @@ test.describe('Recording Access Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -138,12 +138,12 @@ test.describe('Recording Access Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -159,12 +159,12 @@ test.describe('Recording Access Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -180,12 +180,12 @@ test.describe('Recording Access Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); diff --git a/frontend/webcomponent/tests/e2e/ui-feature-config.test.ts b/frontend/webcomponent/tests/e2e/ui-feature-config.test.ts index 912fee0..59b4db7 100644 --- a/frontend/webcomponent/tests/e2e/ui-feature-config.test.ts +++ b/frontend/webcomponent/tests/e2e/ui-feature-config.test.ts @@ -76,12 +76,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -100,12 +100,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: false }, - recordingConfig: { + chat: { enabled: false }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -129,12 +129,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -163,12 +163,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -188,12 +188,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: false, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -229,12 +229,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -258,12 +258,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: false } + virtualBackground: { enabled: false } }, adminCookie ); @@ -287,12 +287,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: true } + virtualBackground: { enabled: true } }, adminCookie ); @@ -308,12 +308,12 @@ test.describe('UI Feature Config Tests', () => { await updateRoomConfig( roomId, { - chatConfig: { enabled: true }, - recordingConfig: { + chat: { enabled: true }, + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - virtualBackgroundConfig: { enabled: false } + virtualBackground: { enabled: false } }, adminCookie ); diff --git a/frontend/webcomponent/tests/helpers/function-helpers.ts b/frontend/webcomponent/tests/helpers/function-helpers.ts index 516dc07..ca44419 100644 --- a/frontend/webcomponent/tests/helpers/function-helpers.ts +++ b/frontend/webcomponent/tests/helpers/function-helpers.ts @@ -90,12 +90,12 @@ export async function interactWithElementInIframe( // Helper function to get default room config const getDefaultRoomConfig = (): MeetRoomConfig => ({ - recordingConfig: { + recording: { enabled: true, allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER }, - chatConfig: { enabled: true }, - virtualBackgroundConfig: { enabled: true } + chat: { enabled: true }, + virtualBackground: { enabled: true } }); // Helper function to create a room for testing diff --git a/testapp/public/views/index.mustache b/testapp/public/views/index.mustache index 8b009e3..0723ec4 100644 --- a/testapp/public/views/index.mustache +++ b/testapp/public/views/index.mustache @@ -208,7 +208,7 @@
Recording Access Level { */ const processFormConfig = (body: any): any => { const config = { - chatConfig: { - enabled: body['config.chatConfig.enabled'] === 'on' + chat: { + enabled: body['config.chat.enabled'] === 'on' }, - recordingConfig: { - enabled: body['config.recordingConfig.enabled'] === 'on', + recording: { + enabled: body['config.recording.enabled'] === 'on', // Only include allowAccessTo if recording is enabled - ...(body['config.recordingConfig.enabled'] === 'on' && { - allowAccessTo: body['config.recordingConfig.allowAccessTo'] || 'admin_moderator_speaker' + ...(body['config.recording.enabled'] === 'on' && { + allowAccessTo: body['config.recording.allowAccessTo'] || 'admin_moderator_speaker' }) }, - virtualBackgroundConfig: { - enabled: body['config.virtualBackgroundConfig.enabled'] === 'on' + virtualBackground: { + enabled: body['config.virtualBackground.enabled'] === 'on' } }; diff --git a/typings/src/room-config.ts b/typings/src/room-config.ts index eb05c9d..7dc010a 100644 --- a/typings/src/room-config.ts +++ b/typings/src/room-config.ts @@ -2,9 +2,9 @@ * Interface representing the config for a room. */ export interface MeetRoomConfig { - chatConfig: MeetChatConfig; - recordingConfig: MeetRecordingConfig; - virtualBackgroundConfig: MeetVirtualBackgroundConfig; + chat: MeetChatConfig; + recording: MeetRecordingConfig; + virtualBackground: MeetVirtualBackgroundConfig; } /**