Trim the parent job prefix off the child job names when displaying them

This commit is contained in:
Michael Lange 2018-01-26 16:27:04 -08:00
parent 1f5e9998e9
commit 40c8149520
4 changed files with 8 additions and 3 deletions

View File

@ -13,7 +13,7 @@ export default AbstractJobPage.extend({
args: ['jobs.job', parent],
},
{
label: job.get('name'),
label: job.get('trimmedName'),
args: ['jobs.job', job],
},
];

View File

@ -34,6 +34,11 @@ export default Model.extend({
parent: belongsTo('job', { inverse: 'children' }),
children: hasMany('job', { inverse: 'parent' }),
// The parent job name is prepended to child launch job names
trimmedName: computed('name', 'parent', function() {
return this.get('parent.content') ? this.get('name').replace(/.+?\//, '') : this.get('name');
}),
// A composite of type and other job attributes to determine
// a better type descriptor for human interpretation rather
// than for scheduling.

View File

@ -7,7 +7,7 @@
{{/global-header}}
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
<h1 class="title">
{{job.name}}
{{job.trimmedName}}
<span class="bumper-left tag {{job.statusClass}}" data-test-job-status>{{job.status}}</span>
</h1>

View File

@ -7,7 +7,7 @@
{{/global-header}}
{{#job-page/parts/body job=job onNamespaceChange=onNamespaceChange}}
<h1 class="title">
{{job.name}}
{{job.trimmedName}}
<span class="bumper-left tag {{job.statusClass}}" data-test-job-status>{{job.status}}</span>
</h1>