From dec8307cfb45f66083623ea41c0bde546b1c39dd Mon Sep 17 00:00:00 2001 From: CSantosM <4a.santos@gmail.com> Date: Wed, 18 Feb 2026 13:06:27 +0100 Subject: [PATCH] frontend: Refactors room feature service location Moves the RoomFeatureService from the shared directory to the rooms domain directory. This change improves the modularity and organization of the codebase by grouping domain-specific services within their respective domains. It also updates imports to reflect the new location of the service. --- .../services/meeting-context.service.ts | 4 +- .../services/meeting-event-handler.service.ts | 2 +- .../meeting/services/meeting.service.ts | 3 +- .../src/lib/domains/rooms/index.ts | 2 +- .../domains/rooms/models/features.model.ts | 106 +++++++++++++++++ .../src/lib/domains/rooms/models/index.ts | 2 + .../src/lib/domains/rooms/services/index.ts | 2 + .../rooms}/services/room-feature.service.ts | 6 +- .../domains/rooms/services/room.service.ts | 2 +- .../rooms}/utils/features.utils.ts | 2 +- .../src/lib/domains/rooms/utils/index.ts | 3 + .../src/lib/shared/models/app.model.ts | 112 ------------------ .../src/lib/shared/services/index.ts | 2 +- 13 files changed, 124 insertions(+), 124 deletions(-) create mode 100644 meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/models/features.model.ts rename meet-ce/frontend/projects/shared-meet-components/src/lib/{shared => domains/rooms}/services/room-feature.service.ts (93%) rename meet-ce/frontend/projects/shared-meet-components/src/lib/{shared => domains/rooms}/utils/features.utils.ts (97%) create mode 100644 meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/utils/index.ts diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting-context.service.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting-context.service.ts index b17485c7..8c8cc2ce 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting-context.service.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting-context.service.ts @@ -1,9 +1,9 @@ import { computed, effect, inject, Injectable, signal } from '@angular/core'; -import { MeetRoom } from 'node_modules/@openvidu-meet/typings/dist/room'; +import { MeetRoom } from '@openvidu-meet/typings'; import { ParticipantService, Room, ViewportService } from 'openvidu-components-angular'; import { GlobalConfigService } from '../../../shared/services/global-config.service'; -import { RoomFeatureService } from '../../../shared/services/room-feature.service'; import { SessionStorageService } from '../../../shared/services/session-storage.service'; +import { RoomFeatureService } from '../../rooms/services/room-feature.service'; import { CustomParticipantModel } from '../models'; /** diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting-event-handler.service.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting-event-handler.service.ts index a426349d..bd2d7180 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting-event-handler.service.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting-event-handler.service.ts @@ -20,12 +20,12 @@ import { } from 'openvidu-components-angular'; import { NavigationService } from '../../../shared/services/navigation.service'; import { NotificationService } from '../../../shared/services/notification.service'; -import { RoomFeatureService } from '../../../shared/services/room-feature.service'; import { SessionStorageService } from '../../../shared/services/session-storage.service'; import { SoundService } from '../../../shared/services/sound.service'; import { TokenStorageService } from '../../../shared/services/token-storage.service'; import { RecordingService } from '../../recordings/services/recording.service'; import { RoomMemberContextService } from '../../room-members/services/room-member-context.service'; +import { RoomFeatureService } from '../../rooms/services/room-feature.service'; import { MeetingContextService } from './meeting-context.service'; import { MeetingWebComponentManagerService } from './meeting-webcomponent-manager.service'; diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting.service.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting.service.ts index 0b374003..2f6e2129 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting.service.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/meeting/services/meeting.service.ts @@ -1,6 +1,6 @@ import { Clipboard } from '@angular/cdk/clipboard'; import { inject, Injectable } from '@angular/core'; -import { MeetRoom } from 'node_modules/@openvidu-meet/typings/dist/room'; +import { MeetRoom } from '@openvidu-meet/typings'; import { LoggerService } from 'openvidu-components-angular'; import { HttpService } from '../../../shared/services/http.service'; import { NotificationService } from '../../../shared/services/notification.service'; @@ -12,7 +12,6 @@ export class MeetingService { protected readonly MEETINGS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/meetings`; protected loggerService: LoggerService = inject(LoggerService); protected notificationService = inject(NotificationService); - protected httpService: HttpService = inject(HttpService); protected clipboard = inject(Clipboard); diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/index.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/index.ts index e7a7f406..4a367e51 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/index.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/index.ts @@ -3,5 +3,5 @@ export * from './guards'; export * from './models'; export * from './pages'; export * from './services'; -export * from './utils/ui'; +export * from './utils'; diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/models/features.model.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/models/features.model.ts new file mode 100644 index 00000000..df8aeea7 --- /dev/null +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/models/features.model.ts @@ -0,0 +1,106 @@ +/** + * Status of captions feature based on room and global configuration + */ +export type CaptionsStatus = 'HIDDEN' | 'ENABLED' | 'DISABLED_WITH_WARNING'; + +/** + * Interface that defines all available features in the application + */ +export interface RoomFeatures { + /** + * Indicates if video track is enabled in the room (mutued or unmuted) + */ + videoEnabled: boolean; + /** + * Indicates if audio track is enabled in the room (muted or unmuted) + */ + audioEnabled: boolean; + + /** + * Indicates if camera control is shown in the UI + */ + showCamera: boolean; + + /** + * Indicates if microphone control is shown in the UI + */ + showMicrophone: boolean; + + /** + * Indicates if screen share control is shown in the UI + */ + showScreenShare: boolean; + + /** + * Indicates if the recording controls is shown in the UI + */ + showStartStopRecording: boolean; + + /** + * Indicates if the chat panel is shown in the UI + */ + showChat: boolean; + + /** + * Indicates if the virtual backgrounds feature is shown in the UI + */ + showBackgrounds: boolean; + /** + * Indicates if the participant list is shown in the UI + */ + showParticipantList: boolean; + + /** + * Indicates if the settings panel is shown in the UI + */ + showSettings: boolean; + + /** + * Indicates if the fullscreen control is shown in the UI + */ + showFullscreen: boolean; + + /** + * Indicates if the theme selector is shown in the UI + */ + showThemeSelector: boolean; + /** + * Indicates if the flag for allowing smart layout is enabled. + * + * It's changed manually (not based on permissions or room config). + */ + showLayoutSelector: boolean; + /** + * Indicates if the captions controls (like toggle captions button) is shown in the UI + */ + showCaptionsControls: boolean; + /** + * Indicates if the captions controls are shown but disabled in the UI, with a warning that captions are globally disabled + */ + showCaptionsControlsDisabled: boolean; + + /** + * Indicates if the share access links controls is shown in the UI + */ + showShareAccessLinks: boolean; + /** + * Indicates if the make moderator controls is shown in the UI + */ + showMakeModerator: boolean; + /** + * Indicates if the end meeting controls is shown in the UI + */ + showEndMeeting: boolean; + /** + * Indicates if the kick participants controls is shown in the UI + */ + showKickParticipants: boolean; + /** + * Indicates if the view recordings controls is shown in the UI + */ + showViewRecordings: boolean; + /** + * Indicates if the join meeting controls is shown in the UI + */ + showJoinMeeting: boolean; +} diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/models/index.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/models/index.ts index 7096a67e..cc065fd7 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/models/index.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/models/index.ts @@ -1,2 +1,4 @@ +// export * from './features.model'; export * from './room-request'; export * from './wizard.model'; + diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/index.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/index.ts index ea4fd50f..cbf6af18 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/index.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/index.ts @@ -1,2 +1,4 @@ +export * from './room-feature.service'; export * from './room.service'; export * from './wizard-state.service'; + diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/services/room-feature.service.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/room-feature.service.ts similarity index 93% rename from meet-ce/frontend/projects/shared-meet-components/src/lib/shared/services/room-feature.service.ts rename to meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/room-feature.service.ts index 2674a6de..ec608f82 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/services/room-feature.service.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/room-feature.service.ts @@ -1,10 +1,10 @@ import { computed, inject, Injectable, signal } from '@angular/core'; import { MeetAppearanceConfig, MeetRoomConfig, MeetRoomMemberPermissions } from '@openvidu-meet/typings'; import { LoggerService } from 'openvidu-components-angular'; -import { RoomMemberContextService } from '../../domains/room-members/services/room-member-context.service'; -import { RoomFeatures } from '../models/app.model'; +import { GlobalConfigService } from '../../../shared/services/global-config.service'; +import { RoomMemberContextService } from '../../room-members/services/room-member-context.service'; +import { RoomFeatures } from '../models/features.model'; import { FeatureCalculator } from '../utils/features.utils'; -import { GlobalConfigService } from './global-config.service'; /** * Base configuration for features, used as a starting point before applying room-specific and user-specific configurations diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/room.service.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/room.service.ts index 6a69b158..95e2b926 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/room.service.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/services/room.service.ts @@ -13,8 +13,8 @@ import { } from '@openvidu-meet/typings'; import { ILogger, LoggerService } from 'openvidu-components-angular'; import { HttpService } from '../../../shared/services/http.service'; -import { RoomFeatureService } from '../../../shared/services/room-feature.service'; import { MeetRoomClientResponseOptions } from '../models/room-request'; +import { RoomFeatureService } from './room-feature.service'; @Injectable({ providedIn: 'root' diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/utils/features.utils.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/utils/features.utils.ts similarity index 97% rename from meet-ce/frontend/projects/shared-meet-components/src/lib/shared/utils/features.utils.ts rename to meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/utils/features.utils.ts index 358fb8b5..6cf37e15 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/utils/features.utils.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/utils/features.utils.ts @@ -4,7 +4,7 @@ import { MeetRoomConfig, MeetRoomMemberPermissions } from '@openvidu-meet/typings'; -import { CaptionsStatus, RoomFeatures } from '../models/app.model'; +import { CaptionsStatus, RoomFeatures } from '../models/features.model'; // New helper class for feature calculation logic export class FeatureCalculator { diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/utils/index.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/utils/index.ts new file mode 100644 index 00000000..2e5fe37a --- /dev/null +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/domains/rooms/utils/index.ts @@ -0,0 +1,3 @@ +export * from './features.utils'; +export * from './ui'; + diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/models/app.model.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/models/app.model.ts index 28e454ae..dd472802 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/models/app.model.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/models/app.model.ts @@ -13,115 +13,3 @@ export enum Edition { CE = 'CE', PRO = 'PRO' } - -/** - * Status of captions feature based on room and global configuration - */ -export type CaptionsStatus = 'HIDDEN' | 'ENABLED' | 'DISABLED_WITH_WARNING'; - -/** - * Interface that defines all available features in the application - */ -export interface RoomFeatures { - /** - * Indicates if video track is enabled in the room (mutued or unmuted) - */ - videoEnabled: boolean; - /** - * Indicates if audio track is enabled in the room (muted or unmuted) - */ - audioEnabled: boolean; - - /** - * Indicates if camera control is shown in the UI - */ - showCamera: boolean; - - /** - * Indicates if microphone control is shown in the UI - */ - showMicrophone: boolean; - - /** - * Indicates if screen share control is shown in the UI - */ - showScreenShare: boolean; - - /** - * Indicates if the recording controls is shown in the UI - */ - showStartStopRecording: boolean; - - /** - * Indicates if the chat panel is shown in the UI - */ - showChat: boolean; - - /** - * Indicates if the virtual backgrounds feature is shown in the UI - */ - showBackgrounds: boolean; - /** - * Indicates if the participant list is shown in the UI - */ - showParticipantList: boolean; - - /** - * Indicates if the settings panel is shown in the UI - */ - showSettings: boolean; - - /** - * Indicates if the fullscreen control is shown in the UI - */ - showFullscreen: boolean; - - /** - * Indicates if the theme selector is shown in the UI - */ - showThemeSelector: boolean; - /** - * Indicates if the flag for allowing smart layout is enabled. - * - * It's changed manually (not based on permissions or room config). - */ - showLayoutSelector: boolean; - /** - * Status of captions feature based on room and global configuration - */ - // captionsStatus: CaptionsStatus; - - /** - * Indicates if the captions controls (like toggle captions button) is shown in the UI - */ - showCaptionsControls: boolean; - /** - * Indicates if the captions controls are shown but disabled in the UI, with a warning that captions are globally disabled - */ - showCaptionsControlsDisabled: boolean; - - /** - * Indicates if the share access links controls is shown in the UI - */ - showShareAccessLinks: boolean; - /** - * Indicates if the make moderator controls is shown in the UI - */ - showMakeModerator: boolean; - /** - * Indicates if the end meeting controls is shown in the UI - */ - showEndMeeting: boolean; - /** - * Indicates if the kick participants controls is shown in the UI - */ - showKickParticipants: boolean; - /** - * Indicates if the view recordings controls is shown in the UI - */ - showViewRecordings: boolean; - /** - * Indicates if the join meeting controls is shown in the UI - */ - showJoinMeeting: boolean; -} diff --git a/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/services/index.ts b/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/services/index.ts index 62e3ec52..8ef1711e 100644 --- a/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/services/index.ts +++ b/meet-ce/frontend/projects/shared-meet-components/src/lib/shared/services/index.ts @@ -7,9 +7,9 @@ export * from './http-header-provider.service'; export * from './http.service'; export * from './navigation.service'; export * from './notification.service'; -export * from './room-feature.service'; export * from './runtime-config.service'; export * from './session-storage.service'; export * from './storage.service'; export * from './theme.service'; export * from './token-storage.service'; +