From 37b598fa5a7690b044119e3721813b387c477b26 Mon Sep 17 00:00:00 2001 From: Thomas Mees Date: Thu, 6 Oct 2022 16:46:46 +0200 Subject: [PATCH] Teardown premium features discoverability and implement variant GitOrigin-RevId: 46dfa1aae117e1862c828bed568085dcd59acd8b --- .../Subscription/SubscriptionController.js | 22 ------------------- services/web/app/src/router.js | 5 +---- .../web/app/views/layout/navbar-marketing.pug | 13 ----------- services/web/app/views/layout/navbar.pug | 13 ----------- .../subscriptions/_premium_features_link.pug | 3 +-- .../web/app/views/subscriptions/dashboard.pug | 5 +---- .../subscriptions/successful_subscription.pug | 3 +-- .../SubscriptionControllerTests.js | 1 - 8 files changed, 4 insertions(+), 61 deletions(-) diff --git a/services/web/app/src/Features/Subscription/SubscriptionController.js b/services/web/app/src/Features/Subscription/SubscriptionController.js index 238b161e42..4a51407d30 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionController.js +++ b/services/web/app/src/Features/Subscription/SubscriptionController.js @@ -222,16 +222,6 @@ async function userSubscriptionPage(req, res) { const cancelButtonNewCopy = cancelButtonAssignment?.variant === 'new-copy' - const premiumFeaturesDiscoverabilityAssignment = - await SplitTestHandler.promises.getAssignment( - req, - res, - 'premium-features-discoverability' - ) - - const premiumFeaturesDiscoverability = - premiumFeaturesDiscoverabilityAssignment?.variant === 'active' - const data = { title: 'your_subscription', plans, @@ -248,7 +238,6 @@ async function userSubscriptionPage(req, res) { currentInstitutionsWithLicence, groupPlanModalOptions, cancelButtonNewCopy, - premiumFeaturesDiscoverability, } res.render('subscriptions/dashboard', data) } @@ -332,16 +321,6 @@ async function successfulSubscription(req, res) { user ) - const premiumFeaturesDiscoverabilityAssignment = - await SplitTestHandler.promises.getAssignment( - req, - res, - 'premium-features-discoverability' - ) - - const premiumFeaturesDiscoverability = - premiumFeaturesDiscoverabilityAssignment?.variant === 'active' - const postCheckoutRedirect = req.session?.postCheckoutRedirect if (!personalSubscription) { @@ -350,7 +329,6 @@ async function successfulSubscription(req, res) { res.render('subscriptions/successful_subscription', { title: 'thank_you', personalSubscription, - premiumFeaturesDiscoverability, postCheckoutRedirect, }) } diff --git a/services/web/app/src/router.js b/services/web/app/src/router.js index 77b0300a9a..3671809302 100644 --- a/services/web/app/src/router.js +++ b/services/web/app/src/router.js @@ -79,10 +79,7 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) { webRouter.get( '*', expressify( - SplitTestMiddleware.loadAssignmentsInLocals([ - 'unified-navigation', - 'premium-features-discoverability', - ]) + SplitTestMiddleware.loadAssignmentsInLocals(['unified-navigation']) ) ) diff --git a/services/web/app/views/layout/navbar-marketing.pug b/services/web/app/views/layout/navbar-marketing.pug index 2aee392da9..15ac810ff8 100644 --- a/services/web/app/views/layout/navbar-marketing.pug +++ b/services/web/app/views/layout/navbar-marketing.pug @@ -93,19 +93,6 @@ nav.navbar.navbar-default.navbar-main each child in item.dropdown if child.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 li if child.url diff --git a/services/web/app/views/layout/navbar.pug b/services/web/app/views/layout/navbar.pug index 775b0289f7..6019af8f65 100644 --- a/services/web/app/views/layout/navbar.pug +++ b/services/web/app/views/layout/navbar.pug @@ -67,19 +67,6 @@ nav.navbar.navbar-default.navbar-main each child in item.dropdown if child.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 li if child.url diff --git a/services/web/app/views/subscriptions/_premium_features_link.pug b/services/web/app/views/subscriptions/_premium_features_link.pug index d8f8436700..87002ccffc 100644 --- a/services/web/app/views/subscriptions/_premium_features_link.pug +++ b/services/web/app/views/subscriptions/_premium_features_link.pug @@ -1,2 +1 @@ -if premiumFeaturesDiscoverability - p !{translate("get_most_subscription_by_checking_premium_features", {}, [{name: 'a', attrs: {href: '/learn/how-to/Overleaf_premium_features'}}])} \ No newline at end of file +p !{translate("get_most_subscription_by_checking_premium_features", {}, [{name: 'a', attrs: {href: '/learn/how-to/Overleaf_premium_features'}}])} \ No newline at end of file diff --git a/services/web/app/views/subscriptions/dashboard.pug b/services/web/app/views/subscriptions/dashboard.pug index 60cac960c0..ff0c069772 100644 --- a/services/web/app/views/subscriptions/dashboard.pug +++ b/services/web/app/views/subscriptions/dashboard.pug @@ -58,10 +58,7 @@ block content else p(ng-non-bindable) | You are on the #{settings.appName} Free plan. Upgrade to access these - if premiumFeaturesDiscoverability - a(href="/learn/how-to/Overleaf_premium_features") Premium Features: - else - | Premium Features: + a(href="/learn/how-to/Overleaf_premium_features") Premium Features: ul 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'] diff --git a/services/web/app/views/subscriptions/successful_subscription.pug b/services/web/app/views/subscriptions/successful_subscription.pug index 5107d3851d..8b5a6441b1 100644 --- a/services/web/app/views/subscriptions/successful_subscription.pug +++ b/services/web/app/views/subscriptions/successful_subscription.pug @@ -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")} p.letter-from-founders 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")} a(href=`mailto:${settings.adminEmail}`, ng-non-bindable) #{settings.adminEmail} | . diff --git a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js index 8d46b2335e..d1cb7b27fd 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js @@ -403,7 +403,6 @@ describe('SubscriptionController', function () { assert.deepEqual(variables, { title: 'thank_you', personalSubscription: 'foo', - premiumFeaturesDiscoverability: false, postCheckoutRedirect: undefined, }) done()