Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make saved object list length configurable #6128

Merged
merged 1 commit into from Feb 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/ui/public/config/defaults.js
Expand Up @@ -176,6 +176,11 @@ define(function (require) {
value: '($0,0.[00])',
description: 'Default numeral format for the "currency" format'
},
'savedObjects:perPage': {
type: 'number',
value: 5,
description: 'Number of objects to show per page in the load dialog'
},
'timepicker:timeDefaults': {
type: 'json',
value: [
Expand Down
5 changes: 4 additions & 1 deletion src/ui/public/directives/saved_object_finder.js
Expand Up @@ -4,7 +4,7 @@ define(function (require) {
var rison = require('ui/utils/rison');
var keymap = require('ui/utils/key_map');

module.directive('savedObjectFinder', function ($location, $injector, kbnUrl, Private) {
module.directive('savedObjectFinder', function ($location, $injector, kbnUrl, Private, config) {

var services = Private(require('ui/saved_objects/saved_object_registry')).byLoaderPropertiesName;

Expand All @@ -23,6 +23,9 @@ define(function (require) {
controller: function ($scope, $element, $timeout) {
var self = this;

// The number of items to show in the list
$scope.perPage = config.get('savedObjects:perPage');

// the text input element
var $input = $element.find('input[ng-model=filter]');

Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/partials/saved_object_finder.html
Expand Up @@ -17,7 +17,7 @@
<span class="finder-hit-count"><strong>{{finder.hitCount}}</strong> {{finder.hitCountNoun()}}</span>
</div>
</form>
<paginate list="finder.hits" per-page="5">
<paginate list="finder.hits" per-page="{{perPage}}">
<ul
class="list-group list-group-menu"
ng-class="{'select-mode': finder.selector.enabled}">
Expand Down