mirror of
https://github.com/ansible/awx.git
synced 2026-01-27 08:31:28 -03:30
added process errors and fixed css bug on add perm modal
This commit is contained in:
parent
3829f276e7
commit
87c9798c09
@ -39,7 +39,7 @@
|
||||
}
|
||||
|
||||
.AddPermissions-body {
|
||||
padding: 0p 20px;
|
||||
padding: 0px 20px;
|
||||
max-height: 70vh;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* Controller for handling permissions adding
|
||||
*/
|
||||
|
||||
export default ['$rootScope', '$scope', 'GetBasePath', 'Rest', '$q', function (rootScope, scope, GetBasePath, Rest, $q) {
|
||||
export default ['$rootScope', '$scope', 'GetBasePath', 'Rest', '$q', 'Wait', 'ProcessErrors', function (rootScope, scope, GetBasePath, Rest, $q, Wait, ProcessErrors) {
|
||||
var manuallyUpdateChecklists = function(list, id, isSelected) {
|
||||
var elemScope = angular
|
||||
.element("#" +
|
||||
@ -144,6 +144,8 @@ export default ['$rootScope', '$scope', 'GetBasePath', 'Rest', '$q', function (r
|
||||
|
||||
// post roles to api
|
||||
scope.updatePermissions = function() {
|
||||
Wait('start');
|
||||
|
||||
var requests = scope.posts
|
||||
.map(function(post) {
|
||||
Rest.setUrl(post.url);
|
||||
@ -152,10 +154,18 @@ export default ['$rootScope', '$scope', 'GetBasePath', 'Rest', '$q', function (r
|
||||
|
||||
$q.all(requests)
|
||||
.then(function () {
|
||||
Wait('stop');
|
||||
rootScope.$broadcast("refreshList", "permission");
|
||||
scope.closeModal();
|
||||
}, function (error) {
|
||||
// TODO: request(s) errored out. Call process errors
|
||||
Wait('stop');
|
||||
rootScope.$broadcast("refreshList", "permission");
|
||||
scope.closeModal();
|
||||
ProcessErrors(null, error.data, error.status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Failed to post role(s): POST returned status' +
|
||||
error.status
|
||||
});
|
||||
});
|
||||
};
|
||||
}];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user