UI update to check recent job type for routing to detail pages.

This commit is contained in:
kialam 2018-12-04 11:19:25 -05:00
parent b763c51f8a
commit 2a62e300a2
No known key found for this signature in database
GPG Key ID: 2D0E60E4B8C7EA0F

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,