mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-23 07:31:09 +02:00
* rename store to pagination, remove store extension * initial update of service test * remove superfluous helper * replace store with pagination service in main app * update kmip engine syntax * add pagination to kmip engine * update to pagination in config-ui engine * update sync engine to use pagination service * use pagination service in kv engine * use pagination service in ldap engine * use pagination in pki engine * update renaming clearDataset functions * link to jira VAULT-31721 * remove comment
44 lines
997 B
JavaScript
44 lines
997 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Route from '@ember/routing/route';
|
|
import { service } from '@ember/service';
|
|
import ListRoute from 'core/mixins/list-route';
|
|
|
|
export default Route.extend(ListRoute, {
|
|
pagination: service(),
|
|
secretMountPath: service(),
|
|
model(params) {
|
|
return this.pagination
|
|
.lazyPaginatedQuery('kmip/scope', {
|
|
backend: this.secretMountPath.currentPath,
|
|
responsePath: 'data.keys',
|
|
page: params.page,
|
|
pageFilter: params.pageFilter,
|
|
})
|
|
.catch((err) => {
|
|
if (err.httpStatus === 404) {
|
|
return [];
|
|
} else {
|
|
throw err;
|
|
}
|
|
});
|
|
},
|
|
|
|
actions: {
|
|
willTransition(transition) {
|
|
window.scrollTo(0, 0);
|
|
if (transition.targetName !== this.routeName) {
|
|
this.pagination.clearDataset();
|
|
}
|
|
return true;
|
|
},
|
|
reload() {
|
|
this.pagination.clearDataset();
|
|
this.refresh();
|
|
},
|
|
},
|
|
});
|