From a3b297e582fb07bcc7547495679a06cd74e88b9b Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Thu, 9 Jun 2016 10:30:55 -0400 Subject: [PATCH 1/2] Display error when trying to delete a job you don't have access to #2076 --- awx/ui/client/src/helpers/Jobs.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/helpers/Jobs.js b/awx/ui/client/src/helpers/Jobs.js index 9d764d449f..e883455d30 100644 --- a/awx/ui/client/src/helpers/Jobs.js +++ b/awx/ui/client/src/helpers/Jobs.js @@ -156,7 +156,7 @@ export default }; } ]) - + .factory('JobsListUpdate', ['Rest', function(Rest) { return function(params) { var scope = params.scope, @@ -343,9 +343,12 @@ export default scope.search(scope.iterator); } }) - .error(function() { + .error(function(obj, status) { Wait('stop'); $('#prompt-modal').modal('hide'); + if (status == 403) { + Alert('Error', obj.detail); + } // Ignore the error. The job most likely already finished. // ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url + // ' failed. POST returned status: ' + status }); @@ -361,9 +364,12 @@ export default scope.search(scope.iterator); } }) - .error(function () { + .error(function (obj, status) { Wait('stop'); $('#prompt-modal').modal('hide'); + if (status == 403) { + Alert('Error', obj.detail); + } // Ignore the error. The job most likely already finished. //ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url + // ' failed. DELETE returned status: ' + status }); From dd9351b22671ae72a3cf1338c6add458c9c4ac30 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Thu, 9 Jun 2016 12:25:39 -0400 Subject: [PATCH 2/2] jshint --- awx/ui/client/src/helpers/Jobs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/helpers/Jobs.js b/awx/ui/client/src/helpers/Jobs.js index e883455d30..30cc910366 100644 --- a/awx/ui/client/src/helpers/Jobs.js +++ b/awx/ui/client/src/helpers/Jobs.js @@ -346,7 +346,7 @@ export default .error(function(obj, status) { Wait('stop'); $('#prompt-modal').modal('hide'); - if (status == 403) { + if (status === 403) { Alert('Error', obj.detail); } // Ignore the error. The job most likely already finished. @@ -367,7 +367,7 @@ export default .error(function (obj, status) { Wait('stop'); $('#prompt-modal').modal('hide'); - if (status == 403) { + if (status === 403) { Alert('Error', obj.detail); } // Ignore the error. The job most likely already finished.