From c6a7d0859d02a7272767dda45c8cd60fa8c5011c Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Sat, 17 Nov 2018 15:41:50 -0500 Subject: [PATCH] add workflow jobs to inventory list status popup --- .../host-summary-popover.controller.js | 18 ++++++++++++++---- .../host-summary-popover.directive.js | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/list/host-summary-popover/host-summary-popover.controller.js b/awx/ui/client/src/inventories-hosts/inventories/list/host-summary-popover/host-summary-popover.controller.js index 77bab5de67..3db9145d61 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/list/host-summary-popover/host-summary-popover.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/list/host-summary-popover/host-summary-popover.controller.js @@ -5,9 +5,13 @@ export default [ '$scope', 'Empty', 'Wait', 'GetBasePath', 'Rest', 'ProcessError if (!Empty($scope.inventory.id)) { if ($scope.inventory.total_hosts > 0) { Wait('start'); - let url = GetBasePath('jobs') + "?type=job&inventory=" + $scope.inventory.id + "&failed="; - url += ($scope.inventory.has_active_failures) ? "true" : "false"; + + let url = GetBasePath('unified_jobs') + '?'; + url += `&or__job__inventory=${$scope.inventory.id}`; + url += `&or__workflowjob__inventory=${$scope.inventory.id}`; + url += `&failed=${$scope.inventory.has_active_failures ? "true" : "false"}`; url += "&order_by=-finished&page_size=5"; + Rest.setUrl(url); Rest.get() .then(({data}) => { @@ -22,8 +26,14 @@ export default [ '$scope', 'Empty', 'Wait', 'GetBasePath', 'Rest', 'ProcessError } }; - $scope.viewJob = function(jobId) { - $state.go('output', { id: jobId, type: 'playbook' }); + $scope.viewJob = function(jobId, type) { + let outputType = 'playbook'; + + if (type === 'workflow_job') { + $state.go('workflowResults', { id: jobId}, { reload: true }); + } else { + $state.go('output', { id: jobId, type: outputType }); + } }; } diff --git a/awx/ui/client/src/inventories-hosts/inventories/list/host-summary-popover/host-summary-popover.directive.js b/awx/ui/client/src/inventories-hosts/inventories/list/host-summary-popover/host-summary-popover.directive.js index 7e6ae14f79..82d598bfa6 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/list/host-summary-popover/host-summary-popover.directive.js +++ b/awx/ui/client/src/inventories-hosts/inventories/list/host-summary-popover/host-summary-popover.directive.js @@ -60,10 +60,10 @@ export default ['templateUrl', 'Wait', '$filter', '$compile', 'i18n', data.results.forEach(function(row) { if ((scope.inventory.has_active_failures && row.status === 'failed') || (!scope.inventory.has_active_failures && row.status === 'successful')) { html += "\n"; - html += "\n"; html += "" + ($filter('longDate')(row.finished)) + ""; - html += "" + $filter('sanitize')(ellipsis(row.name)) + ""; html += "\n"; }