Add support for deleting namespaces (users, organizations)
Fixes #102 Fixes #105
This commit is contained in:
parent
a74e94fb67
commit
73eb66eac5
23 changed files with 407 additions and 33 deletions
|
@ -11,7 +11,8 @@ angular.module('quay').directive('billingManagementPanel', function () {
|
|||
scope: {
|
||||
'user': '=user',
|
||||
'organization': '=organization',
|
||||
'isEnabled': '=isEnabled'
|
||||
'isEnabled': '=isEnabled',
|
||||
'subscriptionStatus': '=subscriptionStatus'
|
||||
},
|
||||
controller: function($scope, $element, PlanService, ApiService, Features) {
|
||||
$scope.currentCard = null;
|
||||
|
@ -19,6 +20,7 @@ angular.module('quay').directive('billingManagementPanel', function () {
|
|||
$scope.updating = true;
|
||||
$scope.changeReceiptsInfo = null;
|
||||
$scope.context = {};
|
||||
$scope.subscriptionStatus = 'loading';
|
||||
|
||||
var setSubscription = function(sub) {
|
||||
$scope.subscription = sub;
|
||||
|
@ -29,12 +31,14 @@ angular.module('quay').directive('billingManagementPanel', function () {
|
|||
|
||||
if (!sub.hasSubscription) {
|
||||
$scope.updating = false;
|
||||
$scope.subscriptionStatus = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
// Load credit card information.
|
||||
PlanService.getCardInfo($scope.organization ? $scope.organization.name : null, function(card) {
|
||||
$scope.currentCard = card;
|
||||
$scope.subscriptionStatus = 'valid';
|
||||
$scope.updating = false;
|
||||
});
|
||||
});
|
||||
|
|
34
static/js/directives/ui/delete-namespace-view.js
Normal file
34
static/js/directives/ui/delete-namespace-view.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* An element which displays a settings table row for deleting a namespace (user or organization).
|
||||
*/
|
||||
angular.module('quay').directive('deleteNamespaceView', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/delete-namespace-view.html',
|
||||
replace: false,
|
||||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'user': '=user',
|
||||
'organization': '=organization',
|
||||
'subscriptionStatus': '=subscriptionStatus'
|
||||
},
|
||||
controller: function($scope, $element, UserService) {
|
||||
$scope.context = {};
|
||||
|
||||
$scope.showDeleteNamespace = function() {
|
||||
$scope.deleteNamespaceInfo = {
|
||||
'user': $scope.user,
|
||||
'organization': $scope.organization,
|
||||
'namespace': $scope.user ? $scope.user.username : $scope.organization.name,
|
||||
'verification': ''
|
||||
};
|
||||
};
|
||||
|
||||
$scope.deleteNamespace = function(info, callback) {
|
||||
UserService.deleteNamespace(info, callback);
|
||||
};
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
Reference in a new issue