From ba817d6a1d1776a0bb1aa06dc1be0fb88ee26bc9 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Mon, 7 Jul 2014 18:24:10 -0400 Subject: [PATCH] Dashboard Clean up call to ProcessErrors. It should always include scope. --- awx/ui/static/js/controllers/Home.js | 3 ++- awx/ui/static/js/widgets/HostGraph.js | 9 ++++----- awx/ui/static/js/widgets/JobStatusGraph.js | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/awx/ui/static/js/controllers/Home.js b/awx/ui/static/js/controllers/Home.js index 9481abc541..8004f7b42b 100644 --- a/awx/ui/static/js/controllers/Home.js +++ b/awx/ui/static/js/controllers/Home.js @@ -122,7 +122,8 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, Wait, Dashb } -Home.$inject = ['$scope', '$compile', '$routeParams', '$rootScope', '$location', 'Wait', 'DashboardCounts', 'HostGraph','JobStatusGraph', 'DashboardJobs', 'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors', 'Button' +Home.$inject = ['$scope', '$compile', '$routeParams', '$rootScope', '$location', 'Wait', 'DashboardCounts', 'HostGraph','JobStatusGraph', 'DashboardJobs', + 'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors', 'Button' ]; diff --git a/awx/ui/static/js/widgets/HostGraph.js b/awx/ui/static/js/widgets/HostGraph.js index ac5a2b492f..93bcaab321 100644 --- a/awx/ui/static/js/widgets/HostGraph.js +++ b/awx/ui/static/js/widgets/HostGraph.js @@ -42,9 +42,9 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities']) }) .error(function (data, status) { - //Wait('stWaitop'); - ProcessErrors(null, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard graph data: ' + status }); - }); + //Wait('stWaitop'); + ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard graph data: ' + status }); + }); if (scope.removeLicenseCountReady) { @@ -55,11 +55,10 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities']) Rest.get() .success(function (data) { scope.$emit('hostDataReady', data, license); - }) .error(function (data, status) { //Wait('stWaitop'); - ProcessErrors(null, data, status, null, { hdr: 'Error!', msg: 'Failed to get license info ' + status }); + ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get license info ' + status }); }); }); diff --git a/awx/ui/static/js/widgets/JobStatusGraph.js b/awx/ui/static/js/widgets/JobStatusGraph.js index e2db2ccbd5..0ffc835057 100644 --- a/awx/ui/static/js/widgets/JobStatusGraph.js +++ b/awx/ui/static/js/widgets/JobStatusGraph.js @@ -72,15 +72,15 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities']) url = GetBasePath('dashboard')+'graphs/?period='+period+'&type='+job_type; Rest.setUrl(url); Rest.get() - .success(function (data){ - scope.$emit('graphDataReady', data); - return job_type, period; + .success(function (data){ + scope.$emit('graphDataReady', data); + return job_type, period; - }) - .error(function (data, status) { - //Wait('stWaitop'); - ProcessErrors(null, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard graph data: ' + status }); - }); + }) + .error(function (data, status) { + //Wait('stWaitop'); + ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard graph data: ' + status }); + }); } element = angular.element(document.getElementById(target));