open-vault/ui/app/serializers/identity/group.js
Matthew Irish 96c1e547f0
UI identity lists (#4655)
* 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
2018-05-29 21:56:15 -05:00

26 lines
627 B
JavaScript

import DS from 'ember-data';
import IdentitySerializer from './_base';
export default IdentitySerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
alias: { embedded: 'always' },
},
normalizeFindRecordResponse(store, primaryModelClass, payload) {
if (payload.alias && Object.keys(payload.alias).length === 0) {
delete payload.alias;
}
return this._super(...arguments);
},
serialize() {
let json = this._super(...arguments);
delete json.alias;
if (json.type === 'external') {
delete json.member_entity_ids;
delete json.member_group_ids;
}
return json;
},
});