- Fix a bug with subscribing in the new repo view

- Have conversion to organization update its plan to a business plan
- Fix bug in the repo donut usage graph thingy where it had zero size when not in the default tab
This commit is contained in:
Joseph Schorr 2013-11-07 22:08:23 -05:00
parent 294d4849a2
commit fe69ba5ec1
9 changed files with 106 additions and 44 deletions

View file

@ -140,6 +140,23 @@ quayApp = angular.module('quay', ['restangular', 'angularMoment', 'angulartics',
}, function() { callback([]); });
};
planService.getMatchingBusinessPlan = function(callback) {
planService.getPlans(function() {
planService.getSubscription(null, function(sub) {
var plan = planDict[sub.plan];
if (!plan) {
planService.getMinimumPlan(0, true, callback);
return;
}
var count = Math.max(sub.usedPrivateRepos, plan.privateRepos);
planService.getMinimumPlan(count, true, callback);
}, function() {
planService.getMinimumPlan(0, true, callback);
});
});
};
planService.getPlans = function(callback) {
planService.verifyLoaded(callback);
};
@ -387,6 +404,27 @@ quayApp.directive('signinForm', function () {
});
quayApp.directive('plansTable', function () {
var directiveDefinitionObject = {
priority: 0,
templateUrl: '/static/directives/plans-table.html',
replace: false,
transclude: true,
restrict: 'C',
scope: {
'plans': '=plans',
'currentPlan': '=currentPlan'
},
controller: function($scope, $element) {
$scope.setPlan = function(plan) {
$scope.currentPlan = plan;
};
}
};
return directiveDefinitionObject;
});
quayApp.directive('organizationHeader', function () {
var directiveDefinitionObject = {
priority: 0,