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

Create new feature flag for BS5 project dashboard page

GitOrigin-RevId: a523bd7df94c411805ac2f5234135bc7a56d25bb
This commit is contained in:
Tim Down 2024-06-25 11:17:25 +01:00 committed by Copybot
parent 8897e439ae
commit 956aad7e43
5 changed files with 24 additions and 15 deletions

View file

@ -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', {
title: 'your_projects',

View file

@ -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')
res.render('user/settings', {

View file

@ -7,6 +7,7 @@ html(
)
- metadata = metadata || {}
- let bootstrap5PageStatus = 'disabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
- let bootstrap5PageSplitTest = ''
block entrypointVar
@ -14,8 +15,8 @@ html(
head
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'
//- Stylesheet
@ -26,17 +27,17 @@ html(
block _headLinks
if (typeof(suppressRelAlternateLinks) == "undefined")
if (typeof suppressRelAlternateLinks == "undefined")
if settings.i18n.subdomainLang
each subdomainDetails in settings.i18n.subdomainLang
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')
link(rel="preload", href=buildJsPath(currentLngCode + "-json.js"), as="script", nonce=scriptNonce)
//- Scripts
if (typeof(suppressGoogleAnalytics) == "undefined")
if (typeof suppressGoogleAnalytics == "undefined")
include _google_analytics
block meta
@ -58,7 +59,7 @@ html(
meta(name="ol-splitTestVariants" data-type="json" content=splitTestVariants || {})
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={
appId: settings.algolia.app_id,
apiKey: settings.algolia.read_only_api_key,
@ -74,9 +75,9 @@ html(
body(class=(showThinFooter ? 'thin-footer' : undefined))
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')}
block body

View file

@ -5,7 +5,8 @@ block entrypointVar
block vars
- 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
meta(name="ol-usersBestSubscription" data-type="json" content=usersBestSubscription)

View file

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