github.com/blixtra/nomad@v0.7.2-0.20171221000451-da9a1d7bb050/ui/app/serializers/evaluation.js (about) 1 import Ember from 'ember'; 2 import ApplicationSerializer from './application'; 3 4 const { inject, get, assign } = Ember; 5 6 export default ApplicationSerializer.extend({ 7 system: inject.service(), 8 9 normalize(typeHash, hash) { 10 hash.FailedTGAllocs = Object.keys(hash.FailedTGAllocs || {}).map(key => { 11 return assign({ Name: key }, get(hash, `FailedTGAllocs.${key}`) || {}); 12 }); 13 14 hash.PlainJobId = hash.JobID; 15 hash.Namespace = 16 hash.Namespace || 17 get(hash, 'Job.Namespace') || 18 this.get('system.activeNamespace.id') || 19 'default'; 20 hash.JobID = JSON.stringify([hash.JobID, hash.Namespace]); 21 22 // TEMPORARY: https://github.com/emberjs/data/issues/5209 23 hash.OriginalJobId = hash.JobID; 24 25 return this._super(typeHash, hash); 26 }, 27 });