Kaynağa Gözat

Merge pull request #18764 from overleaf/td-bs5-dashboard-feature-flag

Create new feature flag for BS5 project dashboard page

GitOrigin-RevId: a523bd7df94c411805ac2f5234135bc7a56d25bb
Tim Down 2 yıl önce
ebeveyn
işleme
956aad7e43

+ 8 - 3
services/web/app/src/Features/Project/ProjectListController.js

@@ -424,9 +424,14 @@ async function projectListPage(req, res, next) {
     )
     )
   }
   }
 
 
-  // Get the user's assignment for the Bootstrap 5 split test, which populates
-  // splitTestVariants with a value for 'bootstrap-5' and allows Pug to read it
-  await SplitTestHandler.promises.getAssignment(req, res, 'bootstrap-5')
+  // Get the user's assignment for this page's Bootstrap 5 split test, which
+  // populates splitTestVariants with a value for the split test name and allows
+  // Pug to read it
+  await SplitTestHandler.promises.getAssignment(
+    req,
+    res,
+    'bootstrap-5-project-dashboard'
+  )
 
 
   res.render('project/list-react', {
   res.render('project/list-react', {
     title: 'your_projects',
     title: 'your_projects',

+ 3 - 2
services/web/app/src/Features/User/UserPagesController.js

@@ -138,8 +138,9 @@ async function settingsPage(req, res) {
     )
     )
   }
   }
 
 
-  // Get the user's assignment for the Bootstrap 5 split test, which populates
-  // splitTestVariants with a value for 'bootstrap-5' and allows Pug to read it
+  // Get the user's assignment for this page's Bootstrap 5 split test, which
+  // populates splitTestVariants with a value for the split test name and allows
+  // Pug to read it
   await SplitTestHandler.promises.getAssignment(req, res, 'bootstrap-5')
   await SplitTestHandler.promises.getAssignment(req, res, 'bootstrap-5')
 
 
   res.render('user/settings', {
   res.render('user/settings', {

+ 10 - 9
services/web/app/views/layout-base.pug

@@ -7,6 +7,7 @@ html(
 )
 )
 	- metadata = metadata || {}
 	- metadata = metadata || {}
 	- let bootstrap5PageStatus = 'disabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
 	- let bootstrap5PageStatus = 'disabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
+	- let bootstrap5PageSplitTest = ''
 
 
 	block entrypointVar
 	block entrypointVar
 
 
@@ -14,8 +15,8 @@ html(
 
 
 	head
 	head
 		include ./_metadata.pug
 		include ./_metadata.pug
-			
-		- const bootstrapVersion = bootstrap5PageStatus !== 'disabled' && (bootstrap5Override || (bootstrap5PageStatus === 'enabled' && splitTestVariants['bootstrap-5'] === 'enabled')) ? 5 : 3
+
+		- const bootstrapVersion = bootstrap5PageStatus !== 'disabled' && (bootstrap5Override || (bootstrap5PageStatus === 'enabled' && splitTestVariants[bootstrap5PageSplitTest] === 'enabled')) ? 5 : 3
 		- const ieeeStylesheetEnabled = splitTestVariants?.['ieee-stylesheet'] !== 'disabled'
 		- const ieeeStylesheetEnabled = splitTestVariants?.['ieee-stylesheet'] !== 'disabled'
 
 
 		//- Stylesheet
 		//- Stylesheet
@@ -26,17 +27,17 @@ html(
 
 
 		block _headLinks
 		block _headLinks
 
 
-		if (typeof(suppressRelAlternateLinks) == "undefined")
+		if (typeof suppressRelAlternateLinks == "undefined")
 			if settings.i18n.subdomainLang
 			if settings.i18n.subdomainLang
 				each subdomainDetails in settings.i18n.subdomainLang
 				each subdomainDetails in settings.i18n.subdomainLang
 					if !subdomainDetails.hide
 					if !subdomainDetails.hide
-						link(rel="alternate", href=subdomainDetails.url+currentUrl, hreflang=subdomainDetails.lngCode)
-		
+						link(rel="alternate", href=subdomainDetails.url + currentUrl, hreflang=subdomainDetails.lngCode)
+
 		if (entrypoint !== 'marketing')
 		if (entrypoint !== 'marketing')
 			link(rel="preload", href=buildJsPath(currentLngCode + "-json.js"), as="script", nonce=scriptNonce)
 			link(rel="preload", href=buildJsPath(currentLngCode + "-json.js"), as="script", nonce=scriptNonce)
 
 
 		//- Scripts
 		//- Scripts
-		if (typeof(suppressGoogleAnalytics) == "undefined")
+		if (typeof suppressGoogleAnalytics == "undefined")
 			include _google_analytics
 			include _google_analytics
 
 
 		block meta
 		block meta
@@ -58,7 +59,7 @@ html(
 			meta(name="ol-splitTestVariants" data-type="json" content=splitTestVariants || {})
 			meta(name="ol-splitTestVariants" data-type="json" content=splitTestVariants || {})
 			meta(name="ol-splitTestInfo" data-type="json" content=splitTestInfo || {})
 			meta(name="ol-splitTestInfo" data-type="json" content=splitTestInfo || {})
 
 
-			if (typeof(settings.algolia) != "undefined")
+			if (typeof settings.algolia != "undefined")
 				meta(name="ol-algolia" data-type="json" content={
 				meta(name="ol-algolia" data-type="json" content={
 					appId: settings.algolia.app_id,
 					appId: settings.algolia.app_id,
 					apiKey: settings.algolia.read_only_api_key,
 					apiKey: settings.algolia.read_only_api_key,
@@ -74,9 +75,9 @@ html(
 
 
 	body(class=(showThinFooter ? 'thin-footer' : undefined))
 	body(class=(showThinFooter ? 'thin-footer' : undefined))
 		if(settings.recaptcha && settings.recaptcha.siteKeyV3)
 		if(settings.recaptcha && settings.recaptcha.siteKeyV3)
-			script(type="text/javascript", nonce=scriptNonce, src="https://www.recaptcha.net/recaptcha/api.js?render="+settings.recaptcha.siteKeyV3, defer=deferScripts)
+			script(type="text/javascript", nonce=scriptNonce, src="https://www.recaptcha.net/recaptcha/api.js?render=" + settings.recaptcha.siteKeyV3, defer=deferScripts)
 
 
-		if (typeof(suppressSkipToContent) == "undefined")
+		if (typeof suppressSkipToContent == "undefined")
 			a(class="skip-to-content" href="#main-content") #{translate('skip_to_content')}
 			a(class="skip-to-content" href="#main-content") #{translate('skip_to_content')}
 
 
 		block body
 		block body

+ 2 - 1
services/web/app/views/project/list-react.pug

@@ -5,7 +5,8 @@ block entrypointVar
 
 
 block vars
 block vars
 	- var suppressNavContentLinks = true
 	- var suppressNavContentLinks = true
-	- bootstrap5PageStatus = 'queryStringOnly' // One of 'disabled', 'enabled', and 'queryStringOnly'
+	- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
+	- bootstrap5PageSplitTest = 'bootstrap-5-project-dashboard'
 
 
 block append meta
 block append meta
 	meta(name="ol-usersBestSubscription" data-type="json" content=usersBestSubscription)
 	meta(name="ol-usersBestSubscription" data-type="json" content=usersBestSubscription)

+ 1 - 0
services/web/app/views/user/settings.pug

@@ -5,6 +5,7 @@ block entrypointVar
 		
 		
 block vars
 block vars
 	- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
 	- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
+	- bootstrap5PageSplitTest = 'bootstrap-5'
 
 
 block append meta
 block append meta
 	meta(name="ol-hasPassword" data-type="boolean" content=hasPassword)
 	meta(name="ol-hasPassword" data-type="boolean" content=hasPassword)