Merge pull request #5716 from overleaf/ab-tear-down-de-ng-plans-page-test

Tear down de-ng split test and cleanup old version

GitOrigin-RevId: 02438bbb2e530dfe72f046dd91c547d97c39c96e
This commit is contained in:
Alexandre Bourdin 2021-11-08 16:06:55 +01:00 committed by Copybot
parent 6122520bf5
commit c881909258
7 changed files with 4 additions and 378 deletions

View file

@ -18,9 +18,6 @@ const AnalyticsManager = require('../Analytics/AnalyticsManager')
const RecurlyEventHandler = require('./RecurlyEventHandler')
const { expressify } = require('../../util/promises')
const OError = require('@overleaf/o-error')
const {
getAssignmentForSession,
} = require('../SplitTests/SplitTestV2Handler').promises
const groupPlanModalOptions = Settings.groupPlanModalOptions
const validGroupPlanModalOptions = {
@ -58,16 +55,7 @@ async function plansPage(req, res) {
usage: getDefault('usage', 'usage', 'enterprise'),
}
const { variant: templateVariant } = await getAssignmentForSession(
req.session,
'plans-page-de-ng'
)
const template =
templateVariant === 'de-ng'
? 'subscriptions/plans-marketing'
: 'subscriptions/plans'
res.render(template, {
res.render('subscriptions/plans-marketing', {
title: 'plans_and_pricing',
plans,
gaExperiments: Settings.gaExperiments.plansPage,

View file

@ -1,56 +0,0 @@
script(type="text/ng-template", id="groupPlanModalPurchaseTemplate")
.modal-header
h3 Save 30% or more with a group license
.modal-body.plans
.container-fluid
.row
.col-md-6.text-center
.circle.circle-lg
| {{ displayPrice }}
span.small / year
br
span.circle-subtext For {{ selected.size }} users
ul.list-unstyled
li Each user will have access to:
li  
li(ng-if="selected.plan_code == 'collaborator'")
strong #{translate("collabs_per_proj", {collabcount:10})}
li(ng-if="selected.plan_code == 'professional'")
strong #{translate("unlimited_collabs")}
+features_premium
.col-md-6
form.form
.form-group
label(for='plan_code')
| Plan
select.form-control(id="plan_code", ng-model="selected.plan_code")
option(ng-repeat="plan_code in options.plan_codes", value="{{plan_code.code}}") {{ plan_code.display }}
.form-group
label(for='size')
| Number of users
select.form-control(id="size", ng-model="selected.size")
option(ng-repeat="size in options.sizes", value="{{size}}") {{ size }}
.form-group
label(for='currency')
| Currency
select.form-control(id="currency", ng-model="selected.currency")
option(ng-repeat="currency in options.currencies", value="{{currency.code}}") {{ currency.display }}
.form-group
label(for='usage')
| Usage
select.form-control(id="usage", ng-model="selected.usage")
option(ng-repeat="usage in options.usages", value="{{usage.code}}") {{ usage.display }}
p.small.text-center.row-spaced-small(ng-show="selected.usage == 'educational'")
| The 40% educational discount can be used by students or faculty using Overleaf for teaching
p.small.text-center.row-spaced-small(ng-show="selected.usage == 'enterprise'")
| Save an additional 40% on groups of 10 or more with our educational discount
.modal-footer
.text-center
button.btn.btn-primary.btn-lg(ng-click="purchase()") Purchase Now
hr.thin
a(
href
ng-controller="ContactGeneralModal"
ng-click="openModal()"
) Need more than 50 licenses? Please get in touch

View file

@ -1,34 +0,0 @@
.faq
.row.row-spaced-large
.col-md-12
.page-header.plans-header.plans-subheader.text-centered
h2 FAQ
.row
.col-md-6
h3 #{translate("faq_how_free_trial_works_question")}
p #{translate('faq_how_does_free_trial_works_answer', { appName:'{{settings.appName}}', len:'7' })}
.col-md-6
h3 #{translate('faq_change_plans_question')}
p #{translate('faq_change_plans_answer')}
.row
.col-md-6
h3 #{translate('faq_do_collab_need_premium_question')}
p #{translate('faq_do_collab_need_premium_answer')}
.col-md-6
h3 #{translate('faq_need_more_collab_question')}
p !{translate('faq_need_more_collab_answer', { referFriendsLink: translate('referring_your_friends') })}
.row
.col-md-6
h3 #{translate('faq_purchase_more_licenses_question')}
p !{translate('faq_purchase_more_licenses_answer', { groupLink: translate('discounted_group_accounts') })} 
a(href='#groups', ng-click="openGroupPlanModal()") #{translate("get_in_touch_for_details")}
.col-md-6
h3 #{translate('faq_monthly_or_annual_question')}
p #{translate('faq_monthly_or_annual_answer')}
.row
.col-md-6
h3 #{translate('faq_how_to_pay_question')}
p #{translate('faq_how_to_pay_answer')}
.col-md-6
h3 #{translate('faq_pay_by_invoice_question')}
p !{translate('faq_pay_by_invoice_answer', {}, [{ name: 'a', attrs: { href: "#pay-by-invoice", 'ng-controller': "ContactGeneralModal", 'ng-click': "openModal()" }}])}

View file

@ -1,117 +0,0 @@
//- Features Tables
mixin table_premium
table.card.plans-table.plans-table-main
tr
th
th #{translate("free")}
th #{translate("personal")}
th #{translate("collaborator")}
.outer.outer-top
.outer-content
.best-value
strong #{translate('best_value')}
th #{translate("professional")}
tr
td #{translate("price")}
td #{translate("free")}
td
+price_personal
td
+price_collaborator
td
+price_professional
for feature in planFeatures
tr
td(event-tracking="features-table" event-tracking-trigger="hover" event-tracking-ga="subscription-funnel" event-tracking-label=`${feature.feature}`)
if feature.info
span(tooltip=translate(feature.info)) #{translate(feature.feature)}
else
| #{translate(feature.feature)}
for plan in feature.plans
td(ng-non-bindable)
if feature.value == 'str'
| #{plan}
else if plan
i.fa.fa-check(aria-hidden="true")
span.sr-only Feature included
else
i.fa.fa-times(aria-hidden="true")
span.sr-only Feature not included
tr
td
td
+btn_buy_free('table')
td
+btn_buy_personal('table')
td
+btn_buy_collaborator('table')
.outer.outer-btm
.outer-content  
td
+btn_buy_professional('table')
mixin table_cell_student(feature)
if feature.value == 'str'
| #{feature.student}
else if feature.student
i.fa.fa-check(aria-hidden="true")
span.sr-only Feature included
else
i.fa.fa-times(aria-hidden="true")
span.sr-only Feature not included
mixin table_student
table.card.plans-table.plans-table-student
tr
th
th #{translate("free")}
th #{translate("student")} (#{translate("annual")})
.outer.outer-top
.outer-content
.best-value
strong Best Value
th #{translate("student")}
tr
td #{translate("price")}
td #{translate("free")}
td
+price_student_annual
td
+price_student_monthly
for feature in planFeatures
tr
td(event-tracking="plans-page-table" event-tracking-trigger="hover" event-tracking-ga="subscription-funnel" event-tracking-label=`${feature.feature}`)
if feature.info
span(tooltip=translate(feature.info)) #{translate(feature.feature)}
else
| #{translate(feature.feature)}
td(ng-non-bindable)
if feature.value == 'str'
| #{feature.plans.free}
else if feature.plans.free
i.fa.fa-check(aria-hidden="true")
span.sr-only Feature included
else
i.fa.fa-times(aria-hidden="true")
span.sr-only Feature included
td(ng-non-bindable)
+table_cell_student(feature)
td(ng-non-bindable)
+table_cell_student(feature)
tr
td
td
+btn_buy_free('table')
td
+btn_buy_student('table', 'annual')
.outer.outer-btm
.outer-content  
td
+btn_buy_student('table', 'monthly')

View file

@ -1,25 +0,0 @@
.row.row-spaced-large
.col-md-12
.page-header.plans-header.plans-subheader.text-centered
h2 #{translate('in_good_company')}
.row
.col-md-6
div
.row
.col-md-3
.circle-img
img(src=buildImgPath('advocates/schultz.jpg') alt="Kevin Schultz")
.col-md-9
blockquote
p It is the ability to collaborate very easily that drew me to Overleaf.
footer Kevin Schultz, Assistant Professor of Physics, Hartwick College
.col-md-6
div
.row
.col-md-3
.circle-img
img(src=buildImgPath('advocates/dagoret-campagne.jpg') alt="Dr Sylvie Dagoret-Campagne")
.col-md-9
blockquote
p Overleaf is a great educational tool for publishing scientific documents.
footer Dr Sylvie Dagoret-Campagne, Director of Research at CNRS, University of Paris-Saclay

View file

@ -1,100 +0,0 @@
extends ../layout
include _plans_page_mixins
include _plans_page_tables
block vars
- metadata = { viewport: true }
block append meta
meta(name="ol-recomendedCurrency" content=recomendedCurrency)
meta(name="ol-groupPlans" data-type="json" content=groupPlans)
block content
main.content.content-alt#main-content
.container
.user-notifications
ul.list-unstyled(ng-cloak)
li.notification-entry
.alert.alert-info
.notification-body
span To help you work from home throughout 2021, we're providing discounted plans and special initiatives.
.notification-action
a.btn.btn-sm.btn-info(href="https://www.overleaf.com/events/wfh2021" event-tracking="Event-Pages" event-tracking-trigger="click" event-tracking-ga="WFH-Offer-Click" event-tracking-label="Plans-Banner") Upgrade
.content-page
.plans(ng-controller="PlansController")
.container(ng-cloak)
.row
.col-md-12
.page-header.centered.plans-header.text-centered
h1.text-capitalize(ng-non-bindable) #{translate('get_instant_access_to')} #{settings.appName}
.row
.col-md-8.col-md-offset-2
p.text-centered #{translate("sl_benefits_plans")}
+allCardsAndControls()
.row.row-spaced-large.text-centered
.col-xs-12
p.text-centered !{translate('also_provides_free_plan', { appName:'{{settings.appName}}' }, [{ name: 'a', attrs: { href: '/register' }}])}
i.fa.fa-cc-mastercard.fa-2x(aria-hidden="true")  
span.sr-only Mastercard accepted
i.fa.fa-cc-visa.fa-2x(aria-hidden="true")  
span.sr-only Visa accepted
i.fa.fa-cc-amex.fa-2x(aria-hidden="true")  
span.sr-only Amex accepted
i.fa.fa-cc-paypal.fa-2x(aria-hidden="true")  
span.sr-only Paypal accepted
div.text-centered #{translate('change_plans_any_time')}<br/> #{translate('billed_after_x_days', {len:'7'})}
br
div.text-centered #{translate('subject_to_additional_vat')}<br/> #{translate('select_country_vat')}
.row.row-spaced-large
.col-md-8.col-md-offset-2
.card.text-centered
.card-header
h2 #{translate('looking_multiple_licenses')}
span #{translate('reduce_costs_group_licenses')}
br
br
a.btn.btn-default(
href="#groups"
ng-click="openGroupPlanModal()"
) #{translate('find_out_more')}
.row.row-spaced-large
.col-sm-12
.page-header.plans-header.plans-subheader.text-centered
h2 #{translate('compare_plan_features')}
.row
.col-md-6.col-md-offset-3
+plan_switch('table')
.col-md-3.text-right
+currency_dropdown
.row(event-tracking="features-table-viewed" event-tracking-ga="subscription-funnel" event-tracking-trigger="scroll" event-tracking-send-once="true" event-tracking-label="exp-")
.col-sm-12(ng-if="ui.view != 'student'")
+table_premium
.col-sm-12(ng-if="ui.view == 'student'")
+table_student
include _plans_quotes
include _plans_faq
#bottom-cards.row.row-spaced(style="display: none;")
.col-sm-12
+allCardsAndControls(true, 'bottom')
.row.row-spaced-large
.col-md-12
.plans-header.plans-subheader.text-centered
h2.header-with-btn #{translate('still_have_questions')}
button.btn.btn-default.btn-header.text-capitalize(
ng-controller="ContactGeneralModal"
ng-click="openModal()"
) #{translate('get_in_touch')}
!= moduleIncludes("contactModalGeneral", locals)
.row.row-spaced
include _modal_group_purchase

View file

@ -185,40 +185,10 @@ describe('SubscriptionController', function () {
})
})
describe('splitTest', function () {
const cases = [
{
variant: 'default',
template: 'subscriptions/plans',
},
{
variant: 'de-ng',
template: 'subscriptions/plans-marketing',
},
]
for (const { variant, template } of cases) {
describe(variant, function () {
beforeEach(function () {
const assignment = { variant }
this.SplitTestV2Hander.promises.getAssignmentForSession.resolves(
assignment
)
})
it(`should render template ${template}`, function (done) {
this.res.render = page => {
page.should.equal(template)
done()
}
this.SubscriptionController.plansPage(this.req, this.res)
})
})
}
})
describe('groupPlanModal data', function () {
it('should pass local currency if valid', function (done) {
this.res.render = (page, opts) => {
page.should.equal('subscriptions/plans')
page.should.equal('subscriptions/plans-marketing')
opts.groupPlanModalDefaults.currency.should.equal('GBP')
done()
}
@ -230,7 +200,7 @@ describe('SubscriptionController', function () {
it('should fallback to USD when valid', function (done) {
this.res.render = (page, opts) => {
page.should.equal('subscriptions/plans')
page.should.equal('subscriptions/plans-marketing')
opts.groupPlanModalDefaults.currency.should.equal('USD')
done()
}
@ -242,7 +212,7 @@ describe('SubscriptionController', function () {
it('should pass valid options for group plan modal and discard invalid', function (done) {
this.res.render = (page, opts) => {
page.should.equal('subscriptions/plans')
page.should.equal('subscriptions/plans-marketing')
opts.groupPlanModalDefaults.size.should.equal('42')
opts.groupPlanModalDefaults.plan_code.should.equal('collaborator')
opts.groupPlanModalDefaults.currency.should.equal('GBP')