- 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

@ -712,11 +712,19 @@ function UserAdminCtrl($scope, $timeout, $location, Restangular, PlanService, Us
$scope.updatingUser = false;
$scope.changePasswordSuccess = false;
$scope.convertStep = 0;
$scope.org = {};
$('.form-change-pw').popover();
$scope.showConvertForm = function() {
PlanService.getMatchingBusinessPlan(function(plan) {
$scope.org.plan = plan;
});
PlanService.getPlans(function(plans) {
$scope.orgPlans = plans.business;
});
$scope.convertStep = 1;
};
@ -729,7 +737,8 @@ function UserAdminCtrl($scope, $timeout, $location, Restangular, PlanService, Us
var data = {
'adminUser': $scope.org.adminUser,
'adminPassword': $scope.org.adminPassword
'adminPassword': $scope.org.adminPassword,
'plan': $scope.org.plan.stripeId
};
var convertAccount = Restangular.one('user/convert');
@ -1017,7 +1026,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula
};
$scope.upgradePlan = function() {
PlanService.showSubscribeDialog($scope, $scope.planRequired.stripeId, null, function() {
PlanService.changePlan($scope, null, $scope.planRequired.stripeId, null, function() {
// Subscribing.
$scope.planChanging = true;
}, function(plan) {