mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
added process errors and fixed css bug on add perm modal
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.AddPermissions-body {
|
.AddPermissions-body {
|
||||||
padding: 0p 20px;
|
padding: 0px 20px;
|
||||||
max-height: 70vh;
|
max-height: 70vh;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
* Controller for handling permissions adding
|
* 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 manuallyUpdateChecklists = function(list, id, isSelected) {
|
||||||
var elemScope = angular
|
var elemScope = angular
|
||||||
.element("#" +
|
.element("#" +
|
||||||
@@ -144,6 +144,8 @@ export default ['$rootScope', '$scope', 'GetBasePath', 'Rest', '$q', function (r
|
|||||||
|
|
||||||
// post roles to api
|
// post roles to api
|
||||||
scope.updatePermissions = function() {
|
scope.updatePermissions = function() {
|
||||||
|
Wait('start');
|
||||||
|
|
||||||
var requests = scope.posts
|
var requests = scope.posts
|
||||||
.map(function(post) {
|
.map(function(post) {
|
||||||
Rest.setUrl(post.url);
|
Rest.setUrl(post.url);
|
||||||
@@ -152,10 +154,18 @@ export default ['$rootScope', '$scope', 'GetBasePath', 'Rest', '$q', function (r
|
|||||||
|
|
||||||
$q.all(requests)
|
$q.all(requests)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
|
Wait('stop');
|
||||||
rootScope.$broadcast("refreshList", "permission");
|
rootScope.$broadcast("refreshList", "permission");
|
||||||
scope.closeModal();
|
scope.closeModal();
|
||||||
}, function (error) {
|
}, 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
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user