Ensure the task group is present whenever an allocation row is rendered

This commit is contained in:
Michael Lange 2018-03-15 14:03:14 -07:00
parent c8b3e91d4a
commit 23cfbb9c27
2 changed files with 8 additions and 0 deletions

View file

@ -58,6 +58,9 @@ function qualifyJob() {
job,
originalJobId: null,
});
if (job.get('isPartial')) {
job.reload();
}
} else {
this.get('store')
.findRecord('job', allocation.get('originalJobId'))

View file

@ -84,6 +84,11 @@ export default Model.extend({
taskGroups: fragmentArray('task-group', { defaultValue: () => [] }),
summary: belongsTo('job-summary'),
// A job model created from the jobs list response will be lacking
// task groups. This is an indicator that it needs to be reloaded
// if task group information is important.
isPartial: equal('taskGroups.length', 0),
// If a job has only been loaded through the list request, the task groups
// are still unknown. However, the count of task groups is available through
// the job-summary model which is embedded in the jobs list response.