From 04d0eabb3203bd1d10b53288864dfc4ddf97e4c1 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Tue, 6 Dec 2022 07:57:47 -0500 Subject: [PATCH] Merge pull request #10772 from overleaf/em-ieee-brand-id Make the IEEE brand id configurable GitOrigin-RevId: 3ee286131d6ed8f43247ab1e2954eabec83d75d6 --- services/web/app/src/infrastructure/ExpressLocals.js | 6 +++--- services/web/config/settings.defaults.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index 6209ed51af..3dd065e2d1 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -21,6 +21,8 @@ const { addOptionalCleanupHandlerAfterDrainingConnections, } = require('./GracefulShutdown') +const IEEE_BRAND_ID = Settings.ieeeBrandId + let webpackManifest switch (process.env.NODE_ENV) { case 'production': @@ -179,10 +181,8 @@ module.exports = function (webRouter, privateApiRouter, publicApiRouter) { res.locals.moment = moment - const IEEE_BRAND_ID = 15 res.locals.isIEEE = brandVariation => - (brandVariation != null ? brandVariation.brand_id : undefined) === - IEEE_BRAND_ID + brandVariation?.brand_id === IEEE_BRAND_ID res.locals.getCssThemeModifier = function (userSettings, brandVariation) { // Themes only exist in OL v2 diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index efa4282c73..e13b349fd3 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -801,6 +801,9 @@ module.exports = { unsupportedBrowsers: { ie: '<=11', }, + + // ID of the IEEE brand in the rails app + ieeeBrandId: intFromEnv('IEEE_BRAND_ID', 15), } module.exports.mergeWith = function (overrides) {