mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 19:35:41 +03:00
Update job row to no longer watch job-summary or reload the job
Now that job summary is pushed into the store from the list request and the task group count is derived from the summary, the detailed job information is no longer needed for a job row.
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
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';
|
||||
import WithVisibilityDetection from 'nomad-ui/mixins/with-component-visibility-detection';
|
||||
|
||||
export default Component.extend(WithVisibilityDetection, {
|
||||
export default Component.extend({
|
||||
store: service(),
|
||||
|
||||
tagName: 'tr',
|
||||
@@ -17,32 +15,4 @@ export default Component.extend(WithVisibilityDetection, {
|
||||
click(event) {
|
||||
lazyClick([this.get('onClick'), event]);
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
// Reload the job in order to get detail information
|
||||
const job = this.get('job');
|
||||
if (job && !job.get('isLoading')) {
|
||||
job.reload().then(() => {
|
||||
this.get('watch').perform(job, 100);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
visibilityHandler() {
|
||||
if (document.hidden) {
|
||||
this.get('watch').cancelAll();
|
||||
} else {
|
||||
const job = this.get('job');
|
||||
if (job && !job.get('isLoading')) {
|
||||
this.get('watch').perform(job, 100);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
willDestroy() {
|
||||
this.get('watch').cancelAll();
|
||||
this._super(...arguments);
|
||||
},
|
||||
|
||||
watch: watchRelationship('summary'),
|
||||
});
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<td data-test-job-type>{{job.displayType}}</td>
|
||||
<td data-test-job-priority>{{job.priority}}</td>
|
||||
<td data-test-job-task-groups>
|
||||
{{#if job.taskGroups.length}}
|
||||
{{job.taskGroups.length}}
|
||||
{{#if job.taskGroupCount}}
|
||||
{{job.taskGroupCount}}
|
||||
{{else}}
|
||||
--
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user