diff --git a/awx/ui/client/src/partials/job-template-smart-status.html b/awx/ui/client/src/partials/job-template-smart-status.html index 1c45c5fe36..d4f8d860b3 100644 --- a/awx/ui/client/src/partials/job-template-smart-status.html +++ b/awx/ui/client/src/partials/job-template-smart-status.html @@ -1 +1 @@ - + diff --git a/awx/ui/client/src/smart-status/smart-status.controller.js b/awx/ui/client/src/smart-status/smart-status.controller.js index 10762de15d..1283552a55 100644 --- a/awx/ui/client/src/smart-status/smart-status.controller.js +++ b/awx/ui/client/src/smart-status/smart-status.controller.js @@ -15,9 +15,21 @@ export default ['$scope', '$filter', var singleJobStatus = true; var firstJobStatus; var recentJobs = $scope.jobs; + var detailsBaseUrl; + if(!recentJobs){ return; } + + // unless we explicitly define a value for the template-type attribute when invoking the + // directive, assume the status icons are for a regular (non-workflow) job when building + // the details url path + if (typeof $scope.templateType !== 'undefined' && $scope.templateType === 'workflow_job_template') { + detailsBaseUrl = '/#/workflows/'; + } else { + detailsBaseUrl = '/#/jobs/'; + } + var sparkData = _.sortBy(recentJobs.map(function(job) { @@ -38,6 +50,7 @@ export default ['$scope', '$filter', data.sortDate = job.finished || "running" + data.jobId; data.finished = $filter('longDate')(job.finished) || job.status+""; data.status_tip = "JOB ID: " + data.jobId + "
STATUS: " + data.smartStatus + "
FINISHED: " + data.finished; + data.detailsUrl = detailsBaseUrl + data.jobId; // If we've already determined that there are both failed and successful jobs OR if the current job in the loop is // pending/waiting/running then we don't worry about checking for a single job status diff --git a/awx/ui/client/src/smart-status/smart-status.directive.js b/awx/ui/client/src/smart-status/smart-status.directive.js index 1ed0ecdcc5..a4486e125e 100644 --- a/awx/ui/client/src/smart-status/smart-status.directive.js +++ b/awx/ui/client/src/smart-status/smart-status.directive.js @@ -9,7 +9,8 @@ export default [ 'templateUrl', function(templateUrl) { return { scope: { - jobs: '=' + jobs: '=', + templateType: '=?', }, templateUrl: templateUrl('smart-status/smart-status'), restrict: 'E', diff --git a/awx/ui/client/src/smart-status/smart-status.partial.html b/awx/ui/client/src/smart-status/smart-status.partial.html index a0545ec814..ec1a81fac3 100644 --- a/awx/ui/client/src/smart-status/smart-status.partial.html +++ b/awx/ui/client/src/smart-status/smart-status.partial.html @@ -1,6 +1,6 @@
-