Teardown premium features discoverability and implement variant

GitOrigin-RevId: 46dfa1aae117e1862c828bed568085dcd59acd8b
This commit is contained in:
Thomas Mees 2022-10-06 16:46:46 +02:00 committed by Copybot
parent 7c812162a1
commit 37b598fa5a
8 changed files with 4 additions and 61 deletions

View file

@ -222,16 +222,6 @@ async function userSubscriptionPage(req, res) {
const cancelButtonNewCopy = cancelButtonAssignment?.variant === 'new-copy' const cancelButtonNewCopy = cancelButtonAssignment?.variant === 'new-copy'
const premiumFeaturesDiscoverabilityAssignment =
await SplitTestHandler.promises.getAssignment(
req,
res,
'premium-features-discoverability'
)
const premiumFeaturesDiscoverability =
premiumFeaturesDiscoverabilityAssignment?.variant === 'active'
const data = { const data = {
title: 'your_subscription', title: 'your_subscription',
plans, plans,
@ -248,7 +238,6 @@ async function userSubscriptionPage(req, res) {
currentInstitutionsWithLicence, currentInstitutionsWithLicence,
groupPlanModalOptions, groupPlanModalOptions,
cancelButtonNewCopy, cancelButtonNewCopy,
premiumFeaturesDiscoverability,
} }
res.render('subscriptions/dashboard', data) res.render('subscriptions/dashboard', data)
} }
@ -332,16 +321,6 @@ async function successfulSubscription(req, res) {
user user
) )
const premiumFeaturesDiscoverabilityAssignment =
await SplitTestHandler.promises.getAssignment(
req,
res,
'premium-features-discoverability'
)
const premiumFeaturesDiscoverability =
premiumFeaturesDiscoverabilityAssignment?.variant === 'active'
const postCheckoutRedirect = req.session?.postCheckoutRedirect const postCheckoutRedirect = req.session?.postCheckoutRedirect
if (!personalSubscription) { if (!personalSubscription) {
@ -350,7 +329,6 @@ async function successfulSubscription(req, res) {
res.render('subscriptions/successful_subscription', { res.render('subscriptions/successful_subscription', {
title: 'thank_you', title: 'thank_you',
personalSubscription, personalSubscription,
premiumFeaturesDiscoverability,
postCheckoutRedirect, postCheckoutRedirect,
}) })
} }

View file

@ -79,10 +79,7 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
webRouter.get( webRouter.get(
'*', '*',
expressify( expressify(
SplitTestMiddleware.loadAssignmentsInLocals([ SplitTestMiddleware.loadAssignmentsInLocals(['unified-navigation'])
'unified-navigation',
'premium-features-discoverability',
])
) )
) )

View file

@ -93,19 +93,6 @@ nav.navbar.navbar-default.navbar-main
each child in item.dropdown each child in item.dropdown
if child.divider if child.divider
li.divider li.divider
if child.splitTest
if (splitTestVariants && (splitTestVariants[child.splitTest.name] === child.splitTest.variant))
li
if child.url
a(
href=child.url,
class=child.class,
event-tracking=child.event
event-tracking-mb="true"
event-tracking-trigger="click"
) !{translate(child.text)}
else
| !{translate(child.text)}
else else
li li
if child.url if child.url

View file

@ -67,19 +67,6 @@ nav.navbar.navbar-default.navbar-main
each child in item.dropdown each child in item.dropdown
if child.divider if child.divider
li.divider li.divider
if child.splitTest
if (splitTestVariants && (splitTestVariants[child.splitTest.name] === child.splitTest.variant))
li
if child.url
a(
href=child.url,
class=child.class,
event-tracking=child.event
event-tracking-mb="true"
event-tracking-trigger="click"
) !{translate(child.text)}
else
| !{translate(child.text)}
else else
li li
if child.url if child.url

View file

@ -1,2 +1 @@
if premiumFeaturesDiscoverability p !{translate("get_most_subscription_by_checking_premium_features", {}, [{name: 'a', attrs: {href: '/learn/how-to/Overleaf_premium_features'}}])}
p !{translate("get_most_subscription_by_checking_premium_features", {}, [{name: 'a', attrs: {href: '/learn/how-to/Overleaf_premium_features'}}])}

View file

@ -58,10 +58,7 @@ block content
else else
p(ng-non-bindable) p(ng-non-bindable)
| You are on the #{settings.appName} Free plan. Upgrade to access these | You are on the #{settings.appName} Free plan. Upgrade to access these
if premiumFeaturesDiscoverability a(href="/learn/how-to/Overleaf_premium_features") Premium Features:
a(href="/learn/how-to/Overleaf_premium_features") Premium Features:
else
| Premium Features:
ul ul
li #{translate('invite_more_collabs')} li #{translate('invite_more_collabs')}
for feature in ['realtime_track_changes', 'full_doc_history', 'reference_search', 'reference_sync', 'dropbox_integration_lowercase', 'github_integration_lowercase', 'priority_support'] for feature in ['realtime_track_changes', 'full_doc_history', 'reference_search', 'reference_sync', 'dropbox_integration_lowercase', 'github_integration_lowercase', 'priority_support']

View file

@ -20,8 +20,7 @@ block content
a.btn.btn-success.btn-large(href=`/manage/groups/${personalSubscription._id}/members`) #{translate("add_your_first_group_member_now")} a.btn.btn-success.btn-large(href=`/manage/groups/${personalSubscription._id}/members`) #{translate("add_your_first_group_member_now")}
p.letter-from-founders p.letter-from-founders
p #{translate("thanks_for_subscribing_you_help_sl", {planName:personalSubscription.plan.name})} p #{translate("thanks_for_subscribing_you_help_sl", {planName:personalSubscription.plan.name})}
if premiumFeaturesDiscoverability p !{translate("get_most_subscription_by_checking_premium_features", {}, [{name: 'a', attrs: {href: 'https://www.overleaf.com/learn/how-to/Overleaf_premium_features'}}])}
p !{translate("get_most_subscription_by_checking_premium_features", {}, [{name: 'a', attrs: {href: 'https://www.overleaf.com/learn/how-to/Overleaf_premium_features'}}])}
p #{translate("need_anything_contact_us_at")} p #{translate("need_anything_contact_us_at")}
a(href=`mailto:${settings.adminEmail}`, ng-non-bindable) #{settings.adminEmail} a(href=`mailto:${settings.adminEmail}`, ng-non-bindable) #{settings.adminEmail}
| . | .

View file

@ -403,7 +403,6 @@ describe('SubscriptionController', function () {
assert.deepEqual(variables, { assert.deepEqual(variables, {
title: 'thank_you', title: 'thank_you',
personalSubscription: 'foo', personalSubscription: 'foo',
premiumFeaturesDiscoverability: false,
postCheckoutRedirect: undefined, postCheckoutRedirect: undefined,
}) })
done() done()