This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/directives/ui/delete-namespace-view.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-11-12 16:09:47 +00:00
/**
* 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',
'namespaceTitle': '@namespaceTitle'
},
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;
});