Merge pull request #18614 from overleaf/mf-create-plans-redesign-split-test-config

[web] Create split test configuration for `website-redesign-plans` split test

GitOrigin-RevId: dea88256830897d1ab1f1de64eb21413c823e6ff
This commit is contained in:
Jessica Lawshe 2024-06-03 09:38:25 -05:00 committed by Copybot
parent 9e99683915
commit 22be3928e3
3 changed files with 39 additions and 0 deletions

View file

@ -33,6 +33,19 @@ const validGroupPlanModalOptions = {
} }
async function plansPage(req, res) { async function plansPage(req, res) {
const websiteRedesignPlansAssignment =
await SplitTestHandler.promises.getAssignment(
req,
res,
'website-redesign-plans'
)
if (websiteRedesignPlansAssignment.variant === 'new-design') {
return res.redirect(302, '/user/subscription/plans-2')
} else if (websiteRedesignPlansAssignment.variant === 'light-design') {
return res.redirect(302, '/user/subscription/plans-3')
}
const language = req.i18n.language || 'en' const language = req.i18n.language || 'en'
const plans = SubscriptionViewModelBuilder.buildPlansList() const plans = SubscriptionViewModelBuilder.buildPlansList()
@ -123,6 +136,12 @@ async function plansPage(req, res) {
}) })
} }
async function plansPageLightDesign(req, res) {
res.render('subscriptions/plans-light-design', {
title: 'plans_and_pricing',
})
}
function formatGroupPlansDataForDash() { function formatGroupPlansDataForDash() {
return { return {
plans: [...groupPlanModalOptions.plan_codes], plans: [...groupPlanModalOptions.plan_codes],
@ -615,6 +634,7 @@ async function getLatamCountryBannerDetails(req, res) {
module.exports = { module.exports = {
plansPage: expressify(plansPage), plansPage: expressify(plansPage),
plansPageLightDesign: expressify(plansPageLightDesign),
userSubscriptionPage: expressify(userSubscriptionPage), userSubscriptionPage: expressify(userSubscriptionPage),
interstitialPaymentPage: expressify(interstitialPaymentPage), interstitialPaymentPage: expressify(interstitialPaymentPage),
successfulSubscription: expressify(successfulSubscription), successfulSubscription: expressify(successfulSubscription),

View file

@ -29,6 +29,12 @@ module.exports = {
SubscriptionController.plansPage SubscriptionController.plansPage
) )
webRouter.get(
'/user/subscription/plans-3',
RateLimiterMiddleware.rateLimit(subscriptionRateLimiter),
SubscriptionController.plansPageLightDesign
)
webRouter.get( webRouter.get(
'/user/subscription', '/user/subscription',
AuthenticationController.requireLogin(), AuthenticationController.requireLogin(),

View file

@ -0,0 +1,13 @@
extends ../layout-website-redesign
block vars
- var suppressRelAlternateLinks = true
- metadata.canonicalURL = (settings.siteUrl ? settings.siteUrl : '') + '/user/subscription/plans'
//- TODO: uncomment after bringing all of the elements from the old plans page
//- block entrypointVar
//- - entrypoint = 'pages/user/subscription/plans-v2/plans-v2-main'
block content
main.content.website-redesign#main-content
p plans page light-design variant