From dbb1d68b663f3991ff4abf50b6f1570c1f8d1a61 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 19 Nov 2014 14:52:59 +0000 Subject: [PATCH 01/10] added SEK and CAD currencies --- services/web/public/coffee/main/plans.coffee | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/services/web/public/coffee/main/plans.coffee b/services/web/public/coffee/main/plans.coffee index d94869e4d3..24b5abaab0 100644 --- a/services/web/public/coffee/main/plans.coffee +++ b/services/web/public/coffee/main/plans.coffee @@ -46,6 +46,29 @@ define [ professional: monthly: "£24" annual: "£288" + + SEK: + symbol: "kr" + student: + monthly: "60 kr" + annual: "600 kr" + collaborator: + monthly: "110 kr" + annual: "1320 kr" + professional: + monthly: "220 kr" + annual: "2640 kr" + CAD: + symbol: "$" + student: + monthly: "$9" + annual: "$90" + collaborator: + monthly: "$17" + annual: "$204" + professional: + monthly: "$34" + annual: "$408" } From 458e4335deffe111b72eb5d9a403ca561540a967 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 19 Nov 2014 21:34:01 +0000 Subject: [PATCH 02/10] added a load more currencies --- services/web/public/coffee/main/plans.coffee | 72 ++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/services/web/public/coffee/main/plans.coffee b/services/web/public/coffee/main/plans.coffee index 24b5abaab0..af113b28fc 100644 --- a/services/web/public/coffee/main/plans.coffee +++ b/services/web/public/coffee/main/plans.coffee @@ -69,6 +69,78 @@ define [ professional: monthly: "$34" annual: "$408" + + NOK: + symbol: "kr" + student: + monthly: "60 kr" + annual: "600 kr" + collaborator: + monthly: "110 kr" + annual: "1320 kr" + professional: + monthly: "220 kr" + annual: "2640 kr" + + DKK: + symbol: "kr" + student: + monthly: "50 kr" + annual: "500 kr" + collaborator: + monthly: "90 kr" + annual: "1080 kr" + professional: + monthly: "180 kr" + annual: "2160 kr" + + AUD: + symbol: "$" + student: + monthly: "$10" + annual: "$100" + collaborator: + monthly: "$18" + annual: "$216" + professional: + monthly: "$35" + annual: "$420" + + NZD: + symbol: "$" + student: + monthly: "$10" + annual: "$100" + collaborator: + monthly: "$18" + annual: "$216" + professional: + monthly: "$35" + annual: "$420" + + CHF: + symbol: "Fr" + student: + monthly: "CHF 8" + annual: "CHF 80" + collaborator: + monthly: "CHF 15" + annual: "CHF 180" + professional: + monthly: "CHF 30" + annual: "CHF 360" + + SGD: + symbol: "$" + student: + monthly: "$12" + annual: "$120" + collaborator: + monthly: "$~" + annual: "$240" + professional: + monthly: "$40" + annual: "$480" } From 6d22bda88f2843426f1ece243a3c16456ea689ee Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 21 Nov 2014 13:13:53 +0000 Subject: [PATCH 03/10] added new currencies removed ab test as well --- .../coffee/infrastructure/GeoIpLookup.coffee | 13 ++++++++++--- services/web/config/settings.defaults.coffee | 2 +- .../public/coffee/main/new-subscription.coffee | 11 ----------- services/web/public/coffee/main/plans.coffee | 17 ----------------- 4 files changed, 11 insertions(+), 32 deletions(-) diff --git a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee index 54b8c89731..a49627d0cb 100644 --- a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee +++ b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee @@ -6,13 +6,20 @@ logger = require("logger-sharelatex") currencyMappings = { "GB":"GBP" "US":"USD" + "CH":"CHF" + "NZ":"NZD" + "AU":"AUD" + "DK":"DKK" + "NO":"NOK" + "CA":"CAD" + "SE":"SEK" } # Countries which would likely prefer Euro's -EuroCountries = ["AT", "BE", "BG", "HR", "CY", "CZ", -"DK", "EE", "FI", "FR", "DE", "EL", "HU", "IE", +EuroCountries = ["AT", "BE", "BG", "HR", "CY", "CZ", +"EE", "FI", "FR", "DE", "EL", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", -"RO", "SK", "SI", "ES", "SE"] +"RO", "SK", "SI", "ES"] _.each EuroCountries, (country)-> currencyMappings[country] = "EUR" diff --git a/services/web/config/settings.defaults.coffee b/services/web/config/settings.defaults.coffee index 07ae5b6357..1ed03e4269 100644 --- a/services/web/config/settings.defaults.coffee +++ b/services/web/config/settings.defaults.coffee @@ -99,7 +99,7 @@ module.exports = apiKey: "" subdomain: "" geoIpLookup: - url: "https://freegeoip.net/json/" + url: "http://localhost:8080/json" templates: user_id: process.env.TEMPLATES_USER_ID or "5395eb7aad1f29a88756c7f2" diff --git a/services/web/public/coffee/main/new-subscription.coffee b/services/web/public/coffee/main/new-subscription.coffee index 6d7d542817..2d4756f624 100644 --- a/services/web/public/coffee/main/new-subscription.coffee +++ b/services/web/public/coffee/main/new-subscription.coffee @@ -7,16 +7,5 @@ define [ $scope.currencyCode = MultiCurrencyPricing.currencyCode $scope.plans = MultiCurrencyPricing.plans - - if MultiCurrencyPricing.currencyCode != "USD" - currencyBuckets = [ - { bucketName:"eu-eu", currency:MultiCurrencyPricing.currencyCode} - { bucketName:"eu-usd", currency:"USD"} - ] - multiCurrencyBucket = abTestManager.getABTestBucket "multi_currency", currencyBuckets - $scope.currencyCode = multiCurrencyBucket.currency - abTestManager.processTestWithStep("multi_currency_editor", multiCurrencyBucket.bucketName, 0) - - $scope.changeCurrency = (newCurrency)-> window.location = "/user/subscription/new?planCode=#{window.plan_code}¤cy=#{newCurrency}" \ No newline at end of file diff --git a/services/web/public/coffee/main/plans.coffee b/services/web/public/coffee/main/plans.coffee index af113b28fc..e00c23d9b7 100644 --- a/services/web/public/coffee/main/plans.coffee +++ b/services/web/public/coffee/main/plans.coffee @@ -147,23 +147,10 @@ define [ App.controller "PlansController", ($scope, $modal, event_tracking, abTestManager, MultiCurrencyPricing, $http) -> - $scope.plans = MultiCurrencyPricing.plans $scope.currencyCode = MultiCurrencyPricing.currencyCode - - - if MultiCurrencyPricing.currencyCode != "USD" - currencyBuckets = [ - { bucketName:"eu-eu", currency:MultiCurrencyPricing.currencyCode} - { bucketName:"eu-usd", currency:"USD"} - ] - multiCurrencyBucket = abTestManager.getABTestBucket "multi_currency", currencyBuckets - $scope.currencyCode = multiCurrencyBucket.currency - - - $scope.trial_len = 7 $scope.planQueryString = '_free_trial_7_days' @@ -171,14 +158,10 @@ define [ view: "monthly" - $scope.changeCurreny = (newCurrency)-> $scope.currencyCode = newCurrency $scope.signUpNowClicked = (plan, annual)-> - if multiCurrencyBucket? - abTestManager.processTestWithStep("multi_currency", multiCurrencyBucket.bucketName, 0) - if $scope.ui.view == "annual" plan = "#{plan}_annual" From 6c0f03e9c78cbab056589b9400b602d57374c9c3 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Mon, 24 Nov 2014 16:21:03 +0000 Subject: [PATCH 04/10] added ab test to show collar plan to people in editor --- .../Subscription/SubscriptionController.coffee | 1 + services/web/app/views/subscriptions/new.jade | 6 ++++++ .../subscriptions/successful_subscription.jade | 9 ++------- services/web/public/coffee/ide.coffee | 13 ++++++++++--- .../web/public/coffee/main/new-subscription.coffee | 5 ++++- services/web/public/stylesheets/app/plans.less | 5 +++++ 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee index 530f41e2c0..7cebfdf535 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee @@ -57,6 +57,7 @@ module.exports = SubscriptionController = plan_code: req.query.planCode currency: currency plan:plan + showStudentPlan: req.query.ssp recurlyConfig: JSON.stringify currency: currency subdomain: Settings.apis.recurly.subdomain diff --git a/services/web/app/views/subscriptions/new.jade b/services/web/app/views/subscriptions/new.jade index d954f32f2b..470fefb9a8 100644 --- a/services/web/app/views/subscriptions/new.jade +++ b/services/web/app/views/subscriptions/new.jade @@ -34,6 +34,12 @@ block content .col-md-3.col-md-pull-6 + if showStudentPlan == 'true' + a.btn-primary.btn.plansPageStudentLink( + href, + ng-click="switchToStudent()" + ) #{translate("half_price_student")} + .card.card-first .paymentPageFeatures .page-header diff --git a/services/web/app/views/subscriptions/successful_subscription.jade b/services/web/app/views/subscriptions/successful_subscription.jade index a9c4699b10..8b66dec6c9 100644 --- a/services/web/app/views/subscriptions/successful_subscription.jade +++ b/services/web/app/views/subscriptions/successful_subscription.jade @@ -35,11 +35,6 @@ block content script(type="text/javascript"). window.ab = [ - {step:2, bucket:"eu-eu", testName:"multi_currency"}, - {step:2, bucket:"eu-usd", testName:"multi_currency"}, - - {step:1, bucket:"eu-eu", testName:"multi_currency_editor"}, - {step:1, bucket:"eu-usd", testName:"multi_currency_editor"} - - + {step:1, bucket:"student_control", testName:"editor_plan"}, + {step:1, bucket:"collab_test", testName:"editor_plan"}, ] \ No newline at end of file diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 17142eb51d..9639af07c9 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -65,10 +65,17 @@ define [ $scope.chat = {} $scope.startFreeTrial = (source) -> - ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) - window.open("/user/subscription/new?planCode=student_free_trial_7_days") - $scope.startedFreeTrial = true + testBuckets = [ + { bucketName:"student_control", planName:"student"} + { bucketName:"collab_test", planName:"collaborator"} + ] + editorPlanBucket = abTestManager.getABTestBucket "editor_plan", testBuckets + abTestManager.processTestWithStep("editor_plan", editorPlanBucket.bucketName, 0) + ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) + window.open("/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}") + $scope.startedFreeTrial = true + window._ide = ide ide.project_id = $scope.project_id = window.project_id diff --git a/services/web/public/coffee/main/new-subscription.coffee b/services/web/public/coffee/main/new-subscription.coffee index 2d4756f624..f607cd3435 100644 --- a/services/web/public/coffee/main/new-subscription.coffee +++ b/services/web/public/coffee/main/new-subscription.coffee @@ -8,4 +8,7 @@ define [ $scope.plans = MultiCurrencyPricing.plans $scope.changeCurrency = (newCurrency)-> - window.location = "/user/subscription/new?planCode=#{window.plan_code}¤cy=#{newCurrency}" \ No newline at end of file + window.location = "/user/subscription/new?planCode=#{window.plan_code}¤cy=#{newCurrency}" + + $scope.switchToStudent = ()-> + window.location = "/user/subscription/new?planCode=student¤cy=#{$scope.currencyCode}" \ No newline at end of file diff --git a/services/web/public/stylesheets/app/plans.less b/services/web/public/stylesheets/app/plans.less index 9324393bda..777a4400c3 100644 --- a/services/web/public/stylesheets/app/plans.less +++ b/services/web/public/stylesheets/app/plans.less @@ -91,6 +91,11 @@ } } +.plansPageStudentLink { + margin-left: 20px; + margin-top: 20px; +} + From 02ef07dca43c9bbabe04758cdf14547b4eee0469 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Mon, 24 Nov 2014 23:59:55 +0000 Subject: [PATCH 05/10] broken free trial func into own file. added ab test on upgrade button colour --- .../web/app/views/project/editor/dropbox.jade | 4 +-- .../web/app/views/project/editor/pdf.jade | 2 +- .../web/app/views/project/editor/share.jade | 4 +-- .../views/project/editor/track-changes.jade | 5 ++-- services/web/app/views/subscriptions/new.jade | 4 +-- .../successful_subscription.jade | 3 +++ .../views/view_templates/bonus_templates.jade | 2 +- services/web/public/coffee/ide.coffee | 15 +++-------- .../public/coffee/main/account-upgrade.coffee | 27 +++++++++++++++++++ 9 files changed, 44 insertions(+), 22 deletions(-) create mode 100644 services/web/public/coffee/main/account-upgrade.coffee diff --git a/services/web/app/views/project/editor/dropbox.jade b/services/web/app/views/project/editor/dropbox.jade index 7cc425ccef..5aa2e1b44b 100644 --- a/services/web/app/views/project/editor/dropbox.jade +++ b/services/web/app/views/project/editor/dropbox.jade @@ -25,8 +25,8 @@ script(type="text/ng-template", id="dropboxModalTemplate") strong Dropbox/sharelatex/{{ project.name }} div.text-center(ng-hide="dbState.hasDropboxFeature") p #{translate("need_to_upgrade_for_dropbox")} - p - a.btn.btn-info(ng-click="startFreeTrial('dropbox')") #{translate("start_free_trial")} + p(ng-controller="FreeTrialModalController") + a.btn(ng-click="startFreeTrial('dropbox')", ng-class="buttonClass") #{translate("start_free_trial")} p.small(ng-show="startedFreeTrial") | #{translate("refresh_page_after_starting_free_trial")} diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index ef67ee81b4..6d59fd0584 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -99,7 +99,7 @@ div.full-size.pdf(ng-controller="PdfController") p a.btn.btn-info( href - ng-click="startFreeTrial('compile-timeout')" + ng-click="hello('compile-timeout')" ) #{translate("start_free_trial")} diff --git a/services/web/app/views/project/editor/share.jade b/services/web/app/views/project/editor/share.jade index 7f48a3ebdd..83e4c52f38 100644 --- a/services/web/app/views/project/editor/share.jade +++ b/services/web/app/views/project/editor/share.jade @@ -68,8 +68,8 @@ script(type='text/ng-template', id='shareProjectModalTemplate') ) #{translate("share")} div.text-center(ng-hide="canAddCollaborators") p #{translate("need_to_upgrade_for_more_collabs")}. - p - a.btn.btn-info(href, ng-click="startFreeTrial('projectMembers')") #{translate("start_free_trial")} + p(ng-controller="FreeTrialModalController") + a.btn(href, ng-click="startFreeTrial('projectMembers')", ng-class="buttonClass") #{translate("start_free_trial")} p.small(ng-show="startedFreeTrial") | #{translate("refresh_page_after_starting_free_trial")}. diff --git a/services/web/app/views/project/editor/track-changes.jade b/services/web/app/views/project/editor/track-changes.jade index aad08a0576..10f4070dee 100644 --- a/services/web/app/views/project/editor/track-changes.jade +++ b/services/web/app/views/project/editor/track-changes.jade @@ -2,9 +2,10 @@ div#trackChanges(ng-show="ui.view == 'track-changes'") .upgrade-prompt(ng-show="!project.features.versioning") .message(ng-show="project.owner._id == user.id") p #{translate("need_to_upgrade_for_history")} - p - a.btn.btn-info( + p(ng-controller="FreeTrialModalController") + a.btn( href + ng-class="buttonClass" ng-click="startFreeTrial('track-changes')" ) #{translate("start_free_trial")} p.small(ng-show="startedFreeTrial") #{translate("refresh_page_after_starting_free_trial")} diff --git a/services/web/app/views/subscriptions/new.jade b/services/web/app/views/subscriptions/new.jade index 470fefb9a8..78ad380d59 100644 --- a/services/web/app/views/subscriptions/new.jade +++ b/services/web/app/views/subscriptions/new.jade @@ -86,7 +86,7 @@ block content Recurly.buildSubscriptionForm(recurlySubscriptionFormConfig); window.ab = [ - {step:1, bucket:"eu-eu", testName:"multi_currency"}, - {step:1, bucket:"eu-usd", testName:"multi_currency"} + {step:1, bucket:"red", testName:"button_color"}, + {step:1, bucket:"blue", testName:"button_color"} ] diff --git a/services/web/app/views/subscriptions/successful_subscription.jade b/services/web/app/views/subscriptions/successful_subscription.jade index 8b66dec6c9..7047e7c8ac 100644 --- a/services/web/app/views/subscriptions/successful_subscription.jade +++ b/services/web/app/views/subscriptions/successful_subscription.jade @@ -37,4 +37,7 @@ block content window.ab = [ {step:1, bucket:"student_control", testName:"editor_plan"}, {step:1, bucket:"collab_test", testName:"editor_plan"}, + + {step:2, bucket:"blue", testName:"button_color"}, + {step:2, bucket:"red", testName:"button_color"} ] \ No newline at end of file diff --git a/services/web/app/views/view_templates/bonus_templates.jade b/services/web/app/views/view_templates/bonus_templates.jade index e96f387137..a75c0ad284 100644 --- a/services/web/app/views/view_templates/bonus_templates.jade +++ b/services/web/app/views/view_templates/bonus_templates.jade @@ -28,7 +28,7 @@ script(type="text/ng-template", id="BonusLinkToUsModal") div.text-center(ng-hide="dbState.hasDropboxFeature") p You need to upgrade your account to link to dropbox. p - a.btn.btn-info(ng-click="startFreeTrial('dropbox')") Start Free Trial + a.btn(ng-click="startFreeTrial('dropbox')", ng-class="buttonClass") Start Free Trial p.small(ng-show="startedFreeTrial") | Please refresh this page after starting your free trial. diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 9639af07c9..e5abde12cf 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -27,6 +27,7 @@ define [ "directives/rightClick" "filters/formatDate" "main/event-tracking" + "main/account-upgrade" ], ( App FileTreeManager @@ -38,7 +39,8 @@ define [ PdfManager BinaryFilesManager ) -> - App.controller "IdeController", ($scope, $timeout, ide, abTestManager) -> + + App.controller "IdeController", ($scope, $timeout, ide) -> # Don't freak out if we're already in an apply callback $scope.$originalApply = $scope.$apply $scope.$apply = (fn = () ->) -> @@ -64,17 +66,6 @@ define [ $scope.chat = {} - $scope.startFreeTrial = (source) -> - - testBuckets = [ - { bucketName:"student_control", planName:"student"} - { bucketName:"collab_test", planName:"collaborator"} - ] - editorPlanBucket = abTestManager.getABTestBucket "editor_plan", testBuckets - abTestManager.processTestWithStep("editor_plan", editorPlanBucket.bucketName, 0) - ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) - window.open("/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}") - $scope.startedFreeTrial = true window._ide = ide diff --git a/services/web/public/coffee/main/account-upgrade.coffee b/services/web/public/coffee/main/account-upgrade.coffee new file mode 100644 index 0000000000..df3f6e9724 --- /dev/null +++ b/services/web/public/coffee/main/account-upgrade.coffee @@ -0,0 +1,27 @@ +define [ + "base" +], (App) -> + App.controller "FreeTrialModalController", ($scope, abTestManager)-> + + buttonColorBuckets = [ + { bucketName:"red", btnClass:"primary"} + { bucketName:"blue", btnClass:"info"} + ] + + buttonColorBucket = abTestManager.getABTestBucket "button_color", buttonColorBuckets + abTestManager.processTestWithStep("button_color", buttonColorBucket.bucketName, 0) + $scope.buttonClass = "btn-#{buttonColorBucket.btnClass}" + + + $scope.startFreeTrial = (source) -> + + testBuckets = [ + { bucketName:"student_control", planName:"student"} + { bucketName:"collab_test", planName:"collaborator"} + ] + + editorPlanBucket = abTestManager.getABTestBucket "editor_plan", testBuckets + abTestManager.processTestWithStep("editor_plan", editorPlanBucket.bucketName, 0) + ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) + window.open("/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}") + $scope.startedFreeTrial = true \ No newline at end of file From dd37436da2b52e3ca56632299e179ea3df816a92 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 25 Nov 2014 11:35:46 +0000 Subject: [PATCH 06/10] delete old cookie keys --- .../coffee/analytics/AbTestingManager.coffee | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/analytics/AbTestingManager.coffee b/services/web/public/coffee/analytics/AbTestingManager.coffee index 01c8127195..2c01a88a6c 100644 --- a/services/web/public/coffee/analytics/AbTestingManager.coffee +++ b/services/web/public/coffee/analytics/AbTestingManager.coffee @@ -2,8 +2,23 @@ define [ "base" "libs/md5" ], (App) -> - + oldKeys = [ + "sl_abt_multi_currency_editor_eu-eu" + "sl_abt_multi_currency_eu-eu" + "sl_abt_multi_currency_editor_eu-usd" + "sl_abt_multi_currency_eu-usd" + "sl_abt_trial_len_14d" + "sl_abt_trial_len_7d" + "sl_abt_trial_len_30d" + "sl_utt" + "sl_utt_trial_len" + "sl_utt_multi_currency" + ] + App.factory "abTestManager", ($http, ipCookie) -> + + _.each oldKeys, (oldKey)-> + ipCookie.remove(oldKey) _buildCookieKey = (testName, bucket)-> key = "sl_abt_#{testName}_#{bucket}" From d91064a3698d58a6e2fed817c7480dea6c742cb4 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 25 Nov 2014 11:51:03 +0000 Subject: [PATCH 07/10] increased timeout for geoip to 3 seconds --- services/web/app/coffee/infrastructure/GeoIpLookup.coffee | 2 +- .../UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee index a49627d0cb..3f8a16e00d 100644 --- a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee +++ b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee @@ -32,7 +32,7 @@ module.exports = GeoIpLookup = ip = ip.trim().split(" ")[0] opts = url: "#{settings.apis.geoIpLookup.url}/#{ip}" - timeout: 1000 + timeout: 3000 json:true logger.log ip:ip, opts:opts, "getting geo ip details" request.get opts, (err, res, ipDetails)-> diff --git a/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee b/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee index 8f8f559d09..8932da51d4 100644 --- a/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee +++ b/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee @@ -43,7 +43,7 @@ describe "GeoIpLookup", -> it "should request the details using the ip", (done)-> @GeoIpLookup.getDetails @ipAddress, (err)=> - @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:1000, json:true}).should.equal true + @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:3000, json:true}).should.equal true done() it "should return the ip details", (done)-> @@ -53,7 +53,7 @@ describe "GeoIpLookup", -> it "should take the first ip in the string", (done)-> @GeoIpLookup.getDetails " #{@ipAddress} 456.312.452.102 432.433.888.234", (err)=> - @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:1000, json:true}).should.equal true + @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:3000, json:true}).should.equal true done() describe "getCurrencyCode", -> From 3bae278c9211fc111371187af5d710be721c0407 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 25 Nov 2014 13:10:00 +0000 Subject: [PATCH 08/10] Revert "increased timeout for geoip to 3 seconds" This reverts commit e4c892b59734a0b6b67ad37a1d09c1618ec389d4. --- services/web/app/coffee/infrastructure/GeoIpLookup.coffee | 2 +- .../UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee index 3f8a16e00d..a49627d0cb 100644 --- a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee +++ b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee @@ -32,7 +32,7 @@ module.exports = GeoIpLookup = ip = ip.trim().split(" ")[0] opts = url: "#{settings.apis.geoIpLookup.url}/#{ip}" - timeout: 3000 + timeout: 1000 json:true logger.log ip:ip, opts:opts, "getting geo ip details" request.get opts, (err, res, ipDetails)-> diff --git a/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee b/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee index 8932da51d4..8f8f559d09 100644 --- a/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee +++ b/services/web/test/UnitTests/coffee/infrastructure/GeoIpLookupTests.coffee @@ -43,7 +43,7 @@ describe "GeoIpLookup", -> it "should request the details using the ip", (done)-> @GeoIpLookup.getDetails @ipAddress, (err)=> - @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:3000, json:true}).should.equal true + @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:1000, json:true}).should.equal true done() it "should return the ip details", (done)-> @@ -53,7 +53,7 @@ describe "GeoIpLookup", -> it "should take the first ip in the string", (done)-> @GeoIpLookup.getDetails " #{@ipAddress} 456.312.452.102 432.433.888.234", (err)=> - @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:3000, json:true}).should.equal true + @request.get.calledWith({url:@settings.apis.geoIpLookup.url+"/"+@ipAddress, timeout:1000, json:true}).should.equal true done() describe "getCurrencyCode", -> From d070c0acd8693c6646380a6b1dec54ae6600c88f Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 25 Nov 2014 13:14:38 +0000 Subject: [PATCH 09/10] fixed SGD collab price --- services/web/public/coffee/main/plans.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/public/coffee/main/plans.coffee b/services/web/public/coffee/main/plans.coffee index e00c23d9b7..a21768a5a9 100644 --- a/services/web/public/coffee/main/plans.coffee +++ b/services/web/public/coffee/main/plans.coffee @@ -136,7 +136,7 @@ define [ monthly: "$12" annual: "$120" collaborator: - monthly: "$~" + monthly: "$20" annual: "$240" professional: monthly: "$40" From ba784c3e62366a54666d3258543653ed864505ed Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 25 Nov 2014 13:18:57 +0000 Subject: [PATCH 10/10] changed swiss franks to show Fr for display issues --- services/web/public/coffee/main/plans.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/web/public/coffee/main/plans.coffee b/services/web/public/coffee/main/plans.coffee index a21768a5a9..4f21c4b5a8 100644 --- a/services/web/public/coffee/main/plans.coffee +++ b/services/web/public/coffee/main/plans.coffee @@ -121,14 +121,14 @@ define [ CHF: symbol: "Fr" student: - monthly: "CHF 8" - annual: "CHF 80" + monthly: "Fr 8" + annual: "Fr 80" collaborator: - monthly: "CHF 15" - annual: "CHF 180" + monthly: "Fr 15" + annual: "Fr 180" professional: - monthly: "CHF 30" - annual: "CHF 360" + monthly: "Fr 30" + annual: "Fr 360" SGD: symbol: "$"