From 030e229f5e4720dffa7f292a37cceae35d5d0745 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Thu, 15 Mar 2018 10:27:29 -0700 Subject: [PATCH] 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. --- ui/app/components/job-row.js | 32 +------------------------ ui/app/templates/components/job-row.hbs | 4 ++-- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/ui/app/components/job-row.js b/ui/app/components/job-row.js index b48913dfc..2b17061eb 100644 --- a/ui/app/components/job-row.js +++ b/ui/app/components/job-row.js @@ -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'), }); diff --git a/ui/app/templates/components/job-row.hbs b/ui/app/templates/components/job-row.hbs index a412279fd..64be67c44 100644 --- a/ui/app/templates/components/job-row.hbs +++ b/ui/app/templates/components/job-row.hbs @@ -5,8 +5,8 @@ {{job.displayType}} {{job.priority}} - {{#if job.taskGroups.length}} - {{job.taskGroups.length}} + {{#if job.taskGroupCount}} + {{job.taskGroupCount}} {{else}} -- {{/if}}