mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
* move list to component * use helper instead * add changelog * clarify changelog copy * delete components now that helper is in use * move helper to util, remove template helper invokation * add optional sorting to lazyPaginatedQuery based on sortBy query attribute * Add serialization to entity-alias and entity so that they can be sorted by name on list view * Same logic as base normalizeItems for extractLazyPaginatedData so that metadata shows on list * Add headers --------- Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com> Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
26 lines
651 B
JavaScript
26 lines
651 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
|
|
import IdentitySerializer from './_base';
|
|
|
|
export default IdentitySerializer.extend(EmbeddedRecordsMixin, {
|
|
// we don't need to serialize relationships here
|
|
serializeHasMany() {},
|
|
attrs: {
|
|
aliases: { embedded: 'always' },
|
|
},
|
|
extractLazyPaginatedData(payload) {
|
|
return payload.data.keys.map((key) => {
|
|
const model = payload.data.key_info[key];
|
|
model.id = key;
|
|
if (payload.backend) {
|
|
model.backend = payload.backend;
|
|
}
|
|
return model;
|
|
});
|
|
},
|
|
});
|