mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 17:43:42 -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 =
|
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')
|
||||||
}
|
}
|
||||||
|
|
|
@ -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',
|
||||||
|
])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue