github.com/emate/nomad@v0.8.2-wo-binpacking/ui/app/models/evaluation.js (about) 1 import { bool, equal } from '@ember/object/computed'; 2 import Model from 'ember-data/model'; 3 import attr from 'ember-data/attr'; 4 import { belongsTo } from 'ember-data/relationships'; 5 import { fragmentArray } from 'ember-data-model-fragments/attributes'; 6 import shortUUIDProperty from '../utils/properties/short-uuid'; 7 8 export default Model.extend({ 9 shortId: shortUUIDProperty('id'), 10 priority: attr('number'), 11 type: attr('string'), 12 triggeredBy: attr('string'), 13 status: attr('string'), 14 statusDescription: attr('string'), 15 failedTGAllocs: fragmentArray('placement-failure', { defaultValue: () => [] }), 16 17 hasPlacementFailures: bool('failedTGAllocs.length'), 18 isBlocked: equal('status', 'blocked'), 19 20 // TEMPORARY: https://github.com/emberjs/data/issues/5209 21 originalJobId: attr('string'), 22 23 job: belongsTo('job'), 24 25 modifyIndex: attr('number'), 26 });