2018-08-17 18:22:26 +00:00
|
|
|
import { assign } from '@ember/polyfills';
|
|
|
|
import ApplicationSerializer from './application';
|
2019-04-16 19:11:43 +00:00
|
|
|
import { get } from '@ember/object';
|
2018-08-17 18:22:26 +00:00
|
|
|
|
|
|
|
export default ApplicationSerializer.extend({
|
|
|
|
normalize(typeHash, hash) {
|
2018-12-13 02:40:10 +00:00
|
|
|
const failures = hash.FailedTGAllocs || {};
|
|
|
|
hash.FailedTGAllocs = Object.keys(failures).map(key => {
|
|
|
|
return assign({ Name: key }, failures[key] || {});
|
2018-08-17 18:22:26 +00:00
|
|
|
});
|
2019-04-16 19:11:43 +00:00
|
|
|
hash.PreemptionIDs = (get(hash, 'Annotations.PreemptedAllocs') || []).mapBy('ID');
|
2018-08-17 18:22:26 +00:00
|
|
|
return this._super(...arguments);
|
|
|
|
},
|
|
|
|
});
|