diff --git a/ui/app/routes/vault/cluster/access/identity/aliases/index.js b/ui/app/routes/vault/cluster/access/identity/aliases/index.js index 46b134329fbb..abee732e5bea 100644 --- a/ui/app/routes/vault/cluster/access/identity/aliases/index.js +++ b/ui/app/routes/vault/cluster/access/identity/aliases/index.js @@ -10,7 +10,6 @@ export default Route.extend(ListRoute, { responsePath: 'data.keys', page: params.page, pageFilter: params.pageFilter, - size: 100, }) .catch(err => { if (err.httpStatus === 404) { diff --git a/ui/app/routes/vault/cluster/access/identity/index.js b/ui/app/routes/vault/cluster/access/identity/index.js index 2d453df15166..a9a983ecdd36 100644 --- a/ui/app/routes/vault/cluster/access/identity/index.js +++ b/ui/app/routes/vault/cluster/access/identity/index.js @@ -10,7 +10,6 @@ export default Route.extend(ListRoute, { responsePath: 'data.keys', page: params.page, pageFilter: params.pageFilter, - size: 100, }) .catch(err => { if (err.httpStatus === 404) { diff --git a/ui/app/routes/vault/cluster/access/leases/list.js b/ui/app/routes/vault/cluster/access/leases/list.js index 7c417c778c25..e56f23d49739 100644 --- a/ui/app/routes/vault/cluster/access/leases/list.js +++ b/ui/app/routes/vault/cluster/access/leases/list.js @@ -24,7 +24,6 @@ export default Route.extend({ responsePath: 'data.keys', page: params.page, pageFilter: params.pageFilter, - size: 100, }) .then(model => { this.set('has404', false); diff --git a/ui/app/routes/vault/cluster/policies/index.js b/ui/app/routes/vault/cluster/policies/index.js index 831d7725db03..a1aac6911f37 100644 --- a/ui/app/routes/vault/cluster/policies/index.js +++ b/ui/app/routes/vault/cluster/policies/index.js @@ -27,7 +27,6 @@ export default Route.extend(ClusterRoute, ListRoute, { page: params.page, pageFilter: params.pageFilter, responsePath: 'data.keys', - size: 100, }) .catch(err => { // acls will never be empty, but sentinel policies can be diff --git a/ui/app/routes/vault/cluster/secrets/backend/list.js b/ui/app/routes/vault/cluster/secrets/backend/list.js index 3171d1249e6b..2e861d4ee59b 100644 --- a/ui/app/routes/vault/cluster/secrets/backend/list.js +++ b/ui/app/routes/vault/cluster/secrets/backend/list.js @@ -63,7 +63,6 @@ export default Route.extend({ responsePath: 'data.keys', page: params.page, pageFilter: params.pageFilter, - size: 100, }) .then(model => { this.set('has404', false); diff --git a/ui/app/services/store.js b/ui/app/services/store.js index c5254742235b..e9aa21107975 100644 --- a/ui/app/services/store.js +++ b/ui/app/services/store.js @@ -6,6 +6,9 @@ import { assert } from '@ember/debug'; import { set, get, computed } from '@ember/object'; import DS from 'ember-data'; import clamp from 'vault/utils/clamp'; +import config from 'vault/config/environment'; + +const { DEFAULT_PAGE_SIZE } = config.APP; export function normalizeModelName(modelName) { return dasherize(modelName); @@ -69,7 +72,9 @@ export default DS.Store.extend({ const responsePath = query.responsePath; assert('responsePath is required', responsePath); assert('page is required', typeof query.page === 'number'); - assert('size is required', query.size); + if (!query.size) { + query.size = DEFAULT_PAGE_SIZE; + } if (dataCache) { return resolve(this.fetchPage(modelName, query)); diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index da7b5bc80b7b..c8f254c61e7f 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -139,18 +139,18 @@ {{/linked-block}} {{/if}} - {{#if (gt model.meta.lastPage 1) }} - {{list-pagination - page=model.meta.currentPage - lastPage=model.meta.lastPage - link="vault.cluster.policies.index" - }} - {{/if}} {{else}} {{/each}} + {{#if (gt model.meta.lastPage 1) }} + {{list-pagination + page=model.meta.currentPage + lastPage=model.meta.lastPage + link="vault.cluster.policies.index" + }} + {{/if}} {{else}} { store.lazyPaginatedQuery('transit-key', {}); @@ -231,12 +242,5 @@ module('Unit | Service | store', function(hooks) { /page is required/, 'requires page' ); - assert.throws( - () => { - store.lazyPaginatedQuery('transit-key', { responsePath: 'foo', page: 1 }); - }, - /size is required/, - 'requires size' - ); }); });