From 9816511f51412eab1341afad4d65d4a40d7b692c Mon Sep 17 00:00:00 2001 From: mabashian Date: Sun, 30 Jul 2017 14:53:55 -0400 Subject: [PATCH] Correctly link to job details from portal jobs list --- .../src/portal-mode/portal-jobs.list.js | 1 + .../portal-mode-jobs.controller.js | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/awx/ui/client/src/portal-mode/portal-jobs.list.js b/awx/ui/client/src/portal-mode/portal-jobs.list.js index c11fe05628..24f9b2afe3 100644 --- a/awx/ui/client/src/portal-mode/portal-jobs.list.js +++ b/awx/ui/client/src/portal-mode/portal-jobs.list.js @@ -29,6 +29,7 @@ export default ['i18n', function(i18n) { awTipPlacement: "top", awToolTip: "{{ job.status_tip }}", dataTipWatch: 'job.status_tip', + ngClick:"viewjobResults(job)", }, name: { label: i18n._('Name'), diff --git a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js index b8479bd6e7..b297e126eb 100644 --- a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js +++ b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js @@ -72,6 +72,34 @@ export function PortalModeJobsController($scope, $state, qs, GetBasePath, Portal function buildTooltips(job) { job.status_tip = `Job ${job.status}. Click for details.`; } + + $scope.viewjobResults = function(job) { + + var goTojobResults = function(state) { + $state.go(state, { id: job.id }, { reload: true }); + }; + switch (job.type) { + case 'job': + goTojobResults('jobResult'); + break; + case 'ad_hoc_command': + goTojobResults('adHocJobStdout'); + break; + case 'system_job': + goTojobResults('managementJobStdout'); + break; + case 'project_update': + goTojobResults('scmUpdateStdout'); + break; + case 'inventory_update': + goTojobResults('inventorySyncStdout'); + break; + case 'workflow_job': + goTojobResults('workflowResults'); + break; + } + + }; } PortalModeJobsController.$inject = ['$scope', '$state', 'QuerySet', 'GetBasePath', 'PortalJobsList', 'jobsDataset'];