e9e52e0dfe
This doesn’t include Ember Data, as we are still back on 3.12. Most changes are deprecation updates, linting fixes, and dependencies. It can be read commit-by-commit, though many of them are mechanical and skimmable. For the new linting exclusions, I’ve added them to the Tech Debt list. The decrease in test count is because linting is no longer included in ember test. There’s a new deprecation warning in the logs that can be fixed by updating Ember Power Select but when I tried that it caused it to render incorrectly, so I decided to ignore it for now and address it separately.
31 lines
773 B
JavaScript
31 lines
773 B
JavaScript
import Model from '@ember-data/model';
|
|
import { attr, belongsTo } from '@ember-data/model';
|
|
import { get } from '@ember/object';
|
|
|
|
export default class Recommendation extends Model {
|
|
@belongsTo('job') job;
|
|
@belongsTo('recommendation-summary', { inverse: 'recommendations' }) recommendationSummary;
|
|
|
|
@attr('date') submitTime;
|
|
|
|
get taskGroup() {
|
|
return get(this, 'recommendationSummary.taskGroup');
|
|
}
|
|
|
|
@attr('string') taskName;
|
|
|
|
get task() {
|
|
return get(this, 'taskGroup.tasks').findBy('name', this.taskName);
|
|
}
|
|
|
|
@attr('string') resource;
|
|
@attr('number') value;
|
|
|
|
get currentValue() {
|
|
const resourceProperty = this.resource === 'CPU' ? 'reservedCPU' : 'reservedMemory';
|
|
return get(this, `task.${resourceProperty}`);
|
|
}
|
|
|
|
@attr() stats;
|
|
}
|