Watch for summary changes in job-row

This commit is contained in:
Michael Lange
2018-02-12 15:27:19 -08:00
parent 702228e878
commit b675d97400
2 changed files with 12 additions and 4 deletions

View File

@@ -1,7 +1,11 @@
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { lazyClick } from '../helpers/lazy-click';
import { watchRelationship } from 'nomad-ui/utils/properties/watch';
export default Component.extend({
store: service(),
tagName: 'tr',
classNames: ['job-row', 'is-interactive'],
@@ -17,7 +21,11 @@ export default Component.extend({
// Reload the job in order to get detail information
const job = this.get('job');
if (job && !job.get('isLoading')) {
job.reload();
job.reload().then(() => {
this.get('watch').perform(job, 100);
});
}
},
watch: watchRelationship('summary').drop(),
});

View File

@@ -5,10 +5,10 @@
<td data-test-job-type>{{job.displayType}}</td>
<td data-test-job-priority>{{job.priority}}</td>
<td data-test-job-task-groups>
{{#if job.isReloading}}
...
{{else}}
{{#if job.taskGroups.length}}
{{job.taskGroups.length}}
{{else}}
--
{{/if}}
</td>
<td data-test-job-allocations>