Use the customer information, not an existing subscription, to determine whether the button should say "Start Free Trial" or "Subscribe"
This commit is contained in:
parent
a5c2fc7185
commit
8f66c39ff5
4 changed files with 13 additions and 10 deletions
|
@ -3331,7 +3331,7 @@ quayApp.directive('planManager', function () {
|
|||
'planChanged': '&planChanged'
|
||||
},
|
||||
controller: function($scope, $element, PlanService, ApiService) {
|
||||
$scope.hasSubscription = false;
|
||||
$scope.isExistingCustomer = false;
|
||||
|
||||
$scope.parseDate = function(timestamp) {
|
||||
return new Date(timestamp * 1000);
|
||||
|
@ -3372,7 +3372,7 @@ quayApp.directive('planManager', function () {
|
|||
|
||||
var subscribedToPlan = function(sub) {
|
||||
$scope.subscription = sub;
|
||||
$scope.hasSubscription = true;
|
||||
$scope.isExistingCustomer = !!sub['isExistingCustomer'];
|
||||
|
||||
PlanService.getPlanIncludingDeprecated(sub.plan, function(subscribedPlan) {
|
||||
$scope.subscribedPlan = subscribedPlan;
|
||||
|
@ -3409,7 +3409,7 @@ quayApp.directive('planManager', function () {
|
|||
if (!$scope.plans) { return; }
|
||||
|
||||
PlanService.getSubscription($scope.organization, subscribedToPlan, function() {
|
||||
// User/Organization has no subscription.
|
||||
$scope.isExistingCustomer = false;
|
||||
subscribedToPlan({ 'plan': PlanService.getFreePlan() });
|
||||
});
|
||||
};
|
||||
|
|
Reference in a new issue