mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
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:
parent
9f80dd48e8
commit
8aed8f7dd7
2 changed files with 22 additions and 7 deletions
|
@ -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 =
|
||||
await SplitTestHandler.promises.getAssignment(
|
||||
req,
|
||||
|
@ -65,12 +71,18 @@ module.exports = HomeController = {
|
|||
'onboarding-flow'
|
||||
)
|
||||
|
||||
return res.render('external/home/v2', {
|
||||
designSystemUpdatesVariant: designSystemUpdatesAssignment.variant,
|
||||
onboardingFlowVariant: onboardingFlowAssignment.variant,
|
||||
hideNewsletterCheckbox:
|
||||
onboardingFlowAssignment.variant === 'token-confirmation-odc',
|
||||
})
|
||||
if (websiteRedesignActive) {
|
||||
return res.render('external/home/website-redesign/index', {
|
||||
onboardingFlowVariant: onboardingFlowAssignment.variant,
|
||||
})
|
||||
} else {
|
||||
return res.render('external/home/v2', {
|
||||
designSystemUpdatesVariant: designSystemUpdatesAssignment.variant,
|
||||
onboardingFlowVariant: onboardingFlowAssignment.variant,
|
||||
hideNewsletterCheckbox:
|
||||
onboardingFlowAssignment.variant === 'token-confirmation-odc',
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return res.redirect('/login')
|
||||
}
|
||||
|
|
|
@ -81,7 +81,10 @@ function getWebpackAssets(entrypoint, section) {
|
|||
module.exports = function (webRouter, privateApiRouter, publicApiRouter) {
|
||||
webRouter.use(
|
||||
expressify(
|
||||
SplitTestMiddleware.loadAssignmentsInLocals(['design-system-updates'])
|
||||
SplitTestMiddleware.loadAssignmentsInLocals([
|
||||
'design-system-updates',
|
||||
'website-redesign',
|
||||
])
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue