96c1e547f0
* add new key_info to the list models for identity endpoints * add details to group and show pages * add parent groups to group tabs * render alias the same everywhere * space tab subnav more like the designs * fix tests * pull tabs in and remove padding
28 lines
666 B
JavaScript
28 lines
666 B
JavaScript
import ApplicationSerializer from '../application';
|
|
import Ember from 'ember';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
normalizeItems(payload) {
|
|
if (payload.data.keys && Array.isArray(payload.data.keys)) {
|
|
return payload.data.keys;
|
|
}
|
|
Ember.assign(payload, payload.data);
|
|
delete payload.data;
|
|
return payload;
|
|
},
|
|
|
|
extractLazyPaginatedData(payload) {
|
|
let list;
|
|
list = payload.data.keys.map(key => {
|
|
let model = payload.data.key_info[key];
|
|
model.id = key;
|
|
return model;
|
|
});
|
|
delete payload.data.key_info;
|
|
return list.sort((a,b) => {
|
|
return a.name.localeCompare(b.name);
|
|
});
|
|
},
|
|
|
|
});
|