diff --git a/awx/ui/static/js/directives/job-status-graph.js b/awx/ui/static/js/directives/job-status-graph.js index 64ecc502d7..fdf5fe9381 100644 --- a/awx/ui/static/js/directives/job-status-graph.js +++ b/awx/ui/static/js/directives/job-status-graph.js @@ -1,8 +1,8 @@ angular.module('GraphDirectives', []) .directive('jobStatusGraph', ['$rootScope', '$compile', '$location' , '$window', 'Wait', 'jobStatusGraphData', - function ($rootScope, $compile , $location, $window, Rest, Wait, jobStatusGraphData) { + function ($rootScope, $compile , $location, $window, Wait, jobStatusGraphData) { return { - restrict: 'A', + restrict: 'E', templateUrl: '/static/partials/job_status_graph.html', link: link }; @@ -26,17 +26,12 @@ angular.module('GraphDirectives', []) cleanup = _.compose( [ cleanup, - scope.$on('DataReceived:JobStatusGraph', - function(e, data) { - scope.$emit('graphDataReady', data); - }) ]); function createGraph(period, jobtype){ - console.log('createGraph'); - // jobStatusGraphData.get(period, jobtype).then(function(data) { - // scope.$emit('graphDataReady', data); - // }); + jobStatusGraphData.get(period, jobtype).then(function(data) { + scope.$emit('graphDataReady', data); + }); } cleanup = _.compose( diff --git a/awx/ui/static/partials/home.html b/awx/ui/static/partials/home.html index 5ea2cc5fe4..e3f218465c 100644 --- a/awx/ui/static/partials/home.html +++ b/awx/ui/static/partials/home.html @@ -12,7 +12,7 @@
-
+
diff --git a/awx/ui/tests/unit/directives/job-status-graph-test.js b/awx/ui/tests/unit/directives/job-status-graph-test.js index f890358e00..09628f8e86 100644 --- a/awx/ui/tests/unit/directives/job-status-graph-test.js +++ b/awx/ui/tests/unit/directives/job-status-graph-test.js @@ -15,12 +15,9 @@ describe('Job Status Graph Directive', function() { $httpBackend.whenGET('/static/partials/job_status_graph.html') .respond("
"); - // $httpBackend.whenGET('/api/').respond(200, - // {"available_versions": {"v1": "/api/v1/"}, "description": "Ansible Tower REST API", "current_version": "/api/v1/"}); - scope = $rootScope.$new(); - element = '
'; + element = ''; // Takes jobs grouped by result (successful or failure // Then looks at each array of arrays, where index 0 is the timestamp & index 1 is the count of jobs with that status