From f5c914ed6cbd345f984cf4ba946ad536485f6ea1 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 11 Dec 2017 18:03:09 +0000 Subject: [PATCH] When upgrading track changes on V2, redirect to V1 trial page --- services/web/app/views/layout.pug | 4 ++++ .../web/public/coffee/main/account-upgrade.coffee | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/services/web/app/views/layout.pug b/services/web/app/views/layout.pug index e12d7d6f81..fc14c2030b 100644 --- a/services/web/app/views/layout.pug +++ b/services/web/app/views/layout.pug @@ -95,6 +95,10 @@ html(itemscope, itemtype='http://schema.org/Product') cdnDomain : '!{settings.templates.cdnDomain}', indexName : '!{settings.templates.indexName}' } + + - if (settings.overleaf && settings.overleaf.host) + script. + window.v1BaseUrl = '!{settings.overleaf.host}' body if(settings.recaptcha) diff --git a/services/web/public/coffee/main/account-upgrade.coffee b/services/web/public/coffee/main/account-upgrade.coffee index 6144bea9ef..29bc472505 100644 --- a/services/web/public/coffee/main/account-upgrade.coffee +++ b/services/web/public/coffee/main/account-upgrade.coffee @@ -11,9 +11,12 @@ define [ w = window.open() go = () -> ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) - url = "/user/subscription/new?planCode=#{plan}&ssp=true" - if couponCode? - url = "#{url}&cc=#{couponCode}" + if window.v1BaseUrl? + url = "#{window.v1BaseUrl}/users/trial" + else + url = "/user/subscription/new?planCode=#{plan}&ssp=true" + if couponCode? + url = "#{url}&cc=#{couponCode}" $scope.startedFreeTrial = true switch source @@ -27,7 +30,7 @@ define [ else event_tracking.sendMB "subscription-start-trial", { source, plan } - + w.location = url if $scope.shouldABTestPlans