Parcourir la source

Merge pull request #20667 from overleaf/td-bs5-always-enabled-option

Add option to always enable BS5 for a particular page

GitOrigin-RevId: f338c4f4be87aae1a2a239a2b36b738616aabaed
Tim Down il y a 1 an
Parent
commit
c817c5ed98

+ 2 - 2
services/web/app/views/layout-base.pug

@@ -7,7 +7,7 @@ html(
 )
 	- metadata = metadata || {}
 	- let bootstrap5PageStatus = 'disabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
-	- let bootstrap5PageSplitTest = ''
+	- let bootstrap5PageSplitTest = '' // Limits Bootstrap 5 usage on this page to users with an assignment of "enabled" for the specified split test. If left empty and bootstrap5PageStatus is "enabled", the page always uses Bootstrap 5.
 	- let isWebsiteRedesign = false
 
 	block entrypointVar
@@ -17,7 +17,7 @@ html(
 	head
 		include ./_metadata.pug
 
-		- const bootstrapVersion = bootstrap5PageStatus !== 'disabled' && (bootstrap5Override || (bootstrap5PageStatus === 'enabled' && splitTestVariants[bootstrap5PageSplitTest] === 'enabled')) ? 5 : 3
+		- const bootstrapVersion = bootstrap5PageStatus !== 'disabled' && (bootstrap5Override || (bootstrap5PageStatus === 'enabled' && (bootstrap5PageSplitTest === '' || splitTestVariants[bootstrap5PageSplitTest] === 'enabled'))) ? 5 : 3
 		- const ieeeStylesheetEnabled = splitTestVariants?.['ieee-stylesheet'] !== 'disabled'
 
 		//- Stylesheet

+ 1 - 2
services/web/app/views/layout-website-redesign-bootstrap-5.pug

@@ -6,7 +6,6 @@ include ./_mixins/bootstrap_js
 block entrypointVar
 	- entrypoint = 'marketing'
 	- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
-	- bootstrap5Override = true
 	- isWebsiteRedesign = true
 
 block body
@@ -27,4 +26,4 @@ block body
 	!= moduleIncludes("contactModal-marketing-bootstrap-5", locals)
 
 block prepend foot-scripts
-	+bootstrap-js(5)
+	+bootstrap-js(5)