Merge pull request #2873 from ansible/related_slices

Show type in related_jobs, link based on type

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2018-12-06 20:51:00 +00:00
committed by GitHub
6 changed files with 58 additions and 40 deletions

View File

@@ -21,20 +21,17 @@ export default ['$scope', '$filter', 'i18n',
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/playbook/';
}
var sparkData =
_.sortBy(recentJobs.map(function(job) {
const finished = $filter('longDate')(job.finished) || job.status+"";
// We now get the job type of recent jobs associated with a JT
if (job.type === 'workflow_job') {
detailsBaseUrl = '/#/workflows/';
} else if (job.type === 'job') {
detailsBaseUrl = '/#/jobs/playbook/';
}
const data = {
status: job.status,
jobId: job.id,