فهرست منبع

Merge pull request #18590 from overleaf/td-ieee-editor-remove-blue

Disable IEEE stylesheet in IEEE editor based on feature flag

GitOrigin-RevId: 09b203e3220a868d5f0a0e413bdc4d3ff7a1792e
Tim Down 2 سال پیش
والد
کامیت
1b247347e7

+ 1 - 0
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(

+ 6 - 2
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

+ 2 - 1
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)