Add job submit time to the job children list

This commit is contained in:
Michael Lange
2020-09-18 17:33:43 -07:00
parent daf9ed3f9c
commit bf1c879447
5 changed files with 12 additions and 1 deletions

View File

@@ -12,6 +12,10 @@ export default class JobRow extends Component {
job = null;
// One of independent, parent, or child. Used to customize the template
// based on the relationship of this job to others.
context = 'independent';
onClick() {}
click(event) {

View File

@@ -23,6 +23,7 @@ export default class Job extends Model {
@attr('string') statusDescription;
@attr('number') createIndex;
@attr('number') modifyIndex;
@attr('date') submitTime;
// True when the job is the parent periodic or parameterized jobs
// Instances of periodic or parameterized jobs are false for both properties

View File

@@ -7,6 +7,8 @@ export default class JobSerializer extends ApplicationSerializer {
parameterized: 'ParameterizedJob',
};
separateNanos = ['SubmitTime'];
normalize(typeHash, hash) {
hash.NamespaceID = hash.Namespace;

View File

@@ -14,6 +14,7 @@
@class="with-foot" as |t|>
<t.head>
<t.sort-by @prop="name">Name</t.sort-by>
<t.sort-by @prop="submitTime">Submitted At</t.sort-by>
<t.sort-by @prop="status">Status</t.sort-by>
<t.sort-by @prop="type">Type</t.sort-by>
<t.sort-by @prop="priority">Priority</t.sort-by>
@@ -21,7 +22,7 @@
<th class="is-3">Summary</th>
</t.head>
<t.body @key="model.id" as |row|>
<JobRow data-test-job-row @job={{row.model}} @onClick={{action this.gotoJob row.model}} />
<JobRow data-test-job-row @job={{row.model}} @context="child" @onClick={{action this.gotoJob row.model}} />
</t.body>
</ListTable>
<div class="table-foot">

View File

@@ -1,4 +1,7 @@
<td data-test-job-name><LinkTo @route="jobs.job" @model={{this.job.plainId}} class="is-primary">{{this.job.name}}</LinkTo></td>
{{#if (eq @context "child")}}
<td data-test-submit-time>{{format-month-ts this.job.submitTime}}</td>
{{/if}}
<td data-test-job-status>
<span class="tag {{this.job.statusClass}}">{{this.job.status}}</span>
</td>