From 14d9eb92772bdf3b895b76129d2017e1c1e6d313 Mon Sep 17 00:00:00 2001 From: jaredevantabor Date: Tue, 28 Feb 2017 12:25:57 -0800 Subject: [PATCH] removing some old stale code from host event stdout after decoupling job-results from job-details --- awx/ui/client/src/app.js | 2 -- .../host-event/host-event.controller.js | 26 ++++--------------- .../host-event/host-event.route.js | 3 --- .../src/job-results/job-results.service.js | 13 ---------- 4 files changed, 5 insertions(+), 39 deletions(-) diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 7289c1af85..c479867951 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -46,7 +46,6 @@ import inventories from './inventories/main'; import inventoryScripts from './inventory-scripts/main'; import organizations from './organizations/main'; import managementJobs from './management-jobs/main'; -import jobDetail from './job-detail/main'; import workflowResults from './workflow-results/main'; import jobResults from './job-results/main'; import jobSubmission from './job-submission/main'; @@ -119,7 +118,6 @@ var tower = angular.module('Tower', [ login.name, activityStream.name, footer.name, - jobDetail.name, workflowResults.name, jobResults.name, jobSubmission.name, diff --git a/awx/ui/client/src/job-results/host-event/host-event.controller.js b/awx/ui/client/src/job-results/host-event/host-event.controller.js index e6c5fc71c7..b195d69b09 100644 --- a/awx/ui/client/src/job-results/host-event/host-event.controller.js +++ b/awx/ui/client/src/job-results/host-event/host-event.controller.js @@ -6,48 +6,32 @@ export default - ['$stateParams', '$scope', '$state', 'Wait', 'jobResultsService', 'hostEvent', 'hostResults', - function($stateParams, $scope, $state, Wait, jobResultsService, hostEvent, hostResults){ + ['$stateParams', '$scope', '$state', 'Wait', 'jobResultsService', 'hostEvent', + function($stateParams, $scope, $state, Wait, jobResultsService, hostEvent){ $scope.processEventStatus = jobResultsService.processEventStatus; - $scope.hostResults = []; - // Avoid rendering objects in the details fieldset - // ng-if="processResults(value)" via host-event-details.partial.html $scope.processResults = function(value){ if (typeof value === 'object'){return false;} else {return true;} }; - $scope.isStdOut = function(){ - if ($state.current.name === 'jobDetail.host-event.stdout' || $state.current.name === 'jobDetail.host-event.stderr'){ - return 'StandardOut-preContainer StandardOut-preContent'; - } - }; - /*ignore jslint start*/ + var initCodeMirror = function(el, data, mode){ var container = document.getElementById(el); - var editor = CodeMirror.fromTextArea(container, { // jshint ignore:line + var editor = CodeMirror.fromTextArea(container, { lineNumbers: true, mode: mode }); editor.setSize("100%", 200); editor.getDoc().setValue(data); }; - /*ignore jslint end*/ + $scope.isActiveState = function(name){ return $state.current.name === name; }; - $scope.getActiveHostIndex = function(){ - var result = $scope.hostResults.filter(function( obj ) { - return obj.id === $scope.event.id; - }); - return $scope.hostResults.indexOf(result[0]); - }; - var init = function(){ hostEvent.event_name = hostEvent.event; $scope.event = _.cloneDeep(hostEvent); - $scope.hostResults = hostResults; // grab standard out & standard error if present from the host // event's "res" object, for things like Ansible modules diff --git a/awx/ui/client/src/job-results/host-event/host-event.route.js b/awx/ui/client/src/job-results/host-event/host-event.route.js index eb796fa7df..a1fd784434 100644 --- a/awx/ui/client/src/job-results/host-event/host-event.route.js +++ b/awx/ui/client/src/job-results/host-event/host-event.route.js @@ -18,9 +18,6 @@ var hostEventModal = { id: $stateParams.eventId }).then(function(res) { return res.data.results[0]; }); - }], - hostResults: ['jobResultsService', '$stateParams', function(jobResultsService, $stateParams) { - return jobResultsService.getJobEventChildren($stateParams.taskId).then(res => res.data.results); }] }, onExit: function() { diff --git a/awx/ui/client/src/job-results/job-results.service.js b/awx/ui/client/src/job-results/job-results.service.js index 3817a922b8..5cf6f488e5 100644 --- a/awx/ui/client/src/job-results/job-results.service.js +++ b/awx/ui/client/src/job-results/job-results.service.js @@ -247,19 +247,6 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo msg: 'Call to ' + url + '. GET returned: ' + status }); }); }, - getJobEventChildren: function(id){ - var url = GetBasePath('job_events'); - url = url + id + '/children/?order_by=host_name'; - Rest.setUrl(url); - return Rest.get() - .success(function(data){ - return data; - }) - .error(function(data, status) { - ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', - msg: 'Call to ' + url + '. GET returned: ' + status }); - }); - }, stringifyParams: function(params){ return _.reduce(params, (result, value, key) => { return result + key + '=' + value + '&';