From 652092840190a40e9521eb450d776bf587ed8cff Mon Sep 17 00:00:00 2001 From: Victor Klomp Date: Fri, 29 Nov 2024 22:16:54 +0100 Subject: [PATCH] fix(poster): Add feature flag --- .../screen/poster/gewis/gewis-poster-screen-controller.ts | 2 ++ .../screen/poster/gewis/gewis-poster-screen-handler.ts | 3 ++- .../screen/poster/hubble/hubble-poster-screen-controller.ts | 2 ++ .../screen/poster/hubble/hubble-poster-screen-handler.ts | 2 ++ src/modules/handlers/screen/screen-handler-settings.ts | 4 ++++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/modules/handlers/screen/poster/gewis/gewis-poster-screen-controller.ts b/src/modules/handlers/screen/poster/gewis/gewis-poster-screen-controller.ts index 10cdcf5..73ed068 100644 --- a/src/modules/handlers/screen/poster/gewis/gewis-poster-screen-controller.ts +++ b/src/modules/handlers/screen/poster/gewis/gewis-poster-screen-controller.ts @@ -10,6 +10,7 @@ import {Request as ExpressRequest} from "express"; import {TrainResponse} from "../ns-trains-service"; import GEWISPosterService, {GEWISPhotoAlbumParams} from "./gewis-poster-service"; import OlympicsService from "../olympics-service"; +import {FeatureEnabled} from "../../../../server-settings"; interface GewisPosterResponse extends BasePosterResponse { borrelMode: boolean; @@ -17,6 +18,7 @@ interface GewisPosterResponse extends BasePosterResponse { @Route('handler/screen/gewis-poster') @Tags('Handlers') +@FeatureEnabled('GewisPosterScreenHandler') export class GewisPosterScreenController extends BasePosterScreenController { protected screenHandler: GewisPosterScreenHandler; diff --git a/src/modules/handlers/screen/poster/gewis/gewis-poster-screen-handler.ts b/src/modules/handlers/screen/poster/gewis/gewis-poster-screen-handler.ts index f0a62dd..e972ab0 100644 --- a/src/modules/handlers/screen/poster/gewis/gewis-poster-screen-handler.ts +++ b/src/modules/handlers/screen/poster/gewis/gewis-poster-screen-handler.ts @@ -1,7 +1,8 @@ import BasePosterScreenHandler from "../base-poster-screen-handler"; import { Namespace } from "socket.io"; +import { FeatureEnabled } from "../../../../server-settings"; - +@FeatureEnabled('GewisPosterScreenHandler') export default class GewisPosterScreenHandler extends BasePosterScreenHandler { private borrelModeDay: number | undefined; diff --git a/src/modules/handlers/screen/poster/hubble/hubble-poster-screen-controller.ts b/src/modules/handlers/screen/poster/hubble/hubble-poster-screen-controller.ts index 8dff46e..fdb91bb 100644 --- a/src/modules/handlers/screen/poster/hubble/hubble-poster-screen-controller.ts +++ b/src/modules/handlers/screen/poster/hubble/hubble-poster-screen-controller.ts @@ -7,9 +7,11 @@ import {Get, Post, Request, Route, Security, Tags} from "tsoa"; import {SecurityNames} from "../../../../../helpers/security"; import {securityGroups} from "../../../../../helpers/security-groups"; import {Request as ExpressRequest} from "express"; +import {FeatureEnabled} from "../../../../server-settings"; @Route('handler/screen/hubble-poster') @Tags('Handlers') +@FeatureEnabled('HubblePosterScreenHandler') export class HubblePosterScreenController extends BasePosterScreenController { constructor() { super(); diff --git a/src/modules/handlers/screen/poster/hubble/hubble-poster-screen-handler.ts b/src/modules/handlers/screen/poster/hubble/hubble-poster-screen-handler.ts index 6dc34ec..0714190 100644 --- a/src/modules/handlers/screen/poster/hubble/hubble-poster-screen-handler.ts +++ b/src/modules/handlers/screen/poster/hubble/hubble-poster-screen-handler.ts @@ -1,6 +1,8 @@ import BasePosterScreenHandler from "../base-poster-screen-handler"; import { Namespace } from "socket.io"; +import {FeatureEnabled} from "../../../../server-settings"; +@FeatureEnabled('HubblePosterScreenHandler') export default class HubblePosterScreenHandler extends BasePosterScreenHandler { constructor(socket: Namespace) { super(socket); diff --git a/src/modules/handlers/screen/screen-handler-settings.ts b/src/modules/handlers/screen/screen-handler-settings.ts index 7d9439a..7fd49ff 100644 --- a/src/modules/handlers/screen/screen-handler-settings.ts +++ b/src/modules/handlers/screen/screen-handler-settings.ts @@ -1,7 +1,11 @@ export interface ScreenHandlerSettings { RoomResponsibleLegacyScreenURL: string; + HubblePosterScreenHandler: boolean; + GewisPosterScreenHandler: boolean; } export const ScreenHandlerSettingsDefaults: ScreenHandlerSettings = { RoomResponsibleLegacyScreenURL: '', + HubblePosterScreenHandler: false, + GewisPosterScreenHandler: false, };