From 1b247347e760c48d3888d7156f7ecaa69e3a24c2 Mon Sep 17 00:00:00 2001 From: Tim Down <158919+timdown@users.noreply.github.com> Date: Thu, 30 May 2024 14:41:53 +0100 Subject: [PATCH] Merge pull request #18590 from overleaf/td-ieee-editor-remove-blue Disable IEEE stylesheet in IEEE editor based on feature flag GitOrigin-RevId: 09b203e3220a868d5f0a0e413bdc4d3ff7a1792e --- .../web/app/src/Features/Project/ProjectController.js | 1 + services/web/app/src/infrastructure/ExpressLocals.js | 8 ++++++-- services/web/app/views/layout-base.pug | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index 4f26f3e8ee..0ce87ec293 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -335,6 +335,7 @@ const _ProjectController = { 'table-generator-promotion', 'track-pdf-download', !anonymous && 'writefull-oauth-promotion', + 'ieee-stylesheet', ].filter(Boolean) const responses = await pProps( diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index 2e14ba6c02..cdfa08df84 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -186,12 +186,16 @@ module.exports = function (webRouter, privateApiRouter, publicApiRouter) { res.locals.isIEEE = brandVariation => brandVariation?.brand_id === IEEE_BRAND_ID - res.locals.getCssThemeModifier = function (userSettings, brandVariation) { + res.locals.getCssThemeModifier = function ( + userSettings, + brandVariation, + ieeeStylesheetEnabled + ) { // Themes only exist in OL v2 if (Settings.overleaf != null) { // The IEEE theme takes precedence over the user personal setting, i.e. a user with // a theme setting of "light" will still get the IEE theme in IEEE branded projects. - if (res.locals.isIEEE(brandVariation)) { + if (ieeeStylesheetEnabled && res.locals.isIEEE(brandVariation)) { return 'ieee-' } else if (userSettings && userSettings.overallTheme != null) { return userSettings.overallTheme diff --git a/services/web/app/views/layout-base.pug b/services/web/app/views/layout-base.pug index 337c449c58..83d6e4cf4e 100644 --- a/services/web/app/views/layout-base.pug +++ b/services/web/app/views/layout-base.pug @@ -16,9 +16,10 @@ html( include ./_metadata.pug - const bootstrapVersion = bootstrap5PageStatus !== 'disabled' && (bootstrap5Override || (bootstrap5PageStatus === 'enabled' && splitTestVariants['bootstrap-5'] === 'enabled')) ? 5 : 3 + - const ieeeStylesheetEnabled = splitTestVariants?.['ieee-stylesheet'] !== 'disabled' //- Stylesheet - link(rel='stylesheet', href=buildCssPath(getCssThemeModifier(userSettings, brandVariation), bootstrapVersion), id="main-stylesheet") + link(rel='stylesheet', href=buildCssPath(getCssThemeModifier(userSettings, brandVariation, ieeeStylesheetEnabled), bootstrapVersion), id="main-stylesheet") block css each file in entrypointStyles(entrypoint) link(rel='stylesheet', href=file)