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
2019-11-12 11:09:47 -05:00

35 lines
No EOL
1.1 KiB
JavaScript

/**
* 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;
});