Merge pull request #15857 from overleaf/mf-split-test-website-redesign

[web] Configure `website-redesign` split test

GitOrigin-RevId: 8b1b3c6ab1ba9c674517ebdb87e89bd3a44aade7
This commit is contained in:
M Fahru 2023-11-21 11:30:19 -07:00 committed by Copybot
parent 9f80dd48e8
commit 8aed8f7dd7
2 changed files with 22 additions and 7 deletions

View file

@ -58,6 +58,12 @@ module.exports = HomeController = {
) )
} }
const websiteRedesignVariant =
res.locals.splitTestVariants?.['website-redesign']
const websiteRedesignActive =
websiteRedesignVariant === 'new-design' ||
websiteRedesignVariant === 'new-design-registration'
const onboardingFlowAssignment = const onboardingFlowAssignment =
await SplitTestHandler.promises.getAssignment( await SplitTestHandler.promises.getAssignment(
req, req,
@ -65,12 +71,18 @@ module.exports = HomeController = {
'onboarding-flow' 'onboarding-flow'
) )
if (websiteRedesignActive) {
return res.render('external/home/website-redesign/index', {
onboardingFlowVariant: onboardingFlowAssignment.variant,
})
} else {
return res.render('external/home/v2', { return res.render('external/home/v2', {
designSystemUpdatesVariant: designSystemUpdatesAssignment.variant, designSystemUpdatesVariant: designSystemUpdatesAssignment.variant,
onboardingFlowVariant: onboardingFlowAssignment.variant, onboardingFlowVariant: onboardingFlowAssignment.variant,
hideNewsletterCheckbox: hideNewsletterCheckbox:
onboardingFlowAssignment.variant === 'token-confirmation-odc', onboardingFlowAssignment.variant === 'token-confirmation-odc',
}) })
}
} else { } else {
return res.redirect('/login') return res.redirect('/login')
} }

View file

@ -81,7 +81,10 @@ function getWebpackAssets(entrypoint, section) {
module.exports = function (webRouter, privateApiRouter, publicApiRouter) { module.exports = function (webRouter, privateApiRouter, publicApiRouter) {
webRouter.use( webRouter.use(
expressify( expressify(
SplitTestMiddleware.loadAssignmentsInLocals(['design-system-updates']) SplitTestMiddleware.loadAssignmentsInLocals([
'design-system-updates',
'website-redesign',
])
) )
) )