diff --git a/src/core_plugins/kibana/public/context/app.html b/src/core_plugins/kibana/public/context/app.html index 6d0235435e7bf..6d7a870cefbb1 100644 --- a/src/core_plugins/kibana/public/context/app.html +++ b/src/core_plugins/kibana/public/context/app.html @@ -118,6 +118,7 @@ sorting="contextApp.state.queryParameters.sort" columns="contextApp.state.queryParameters.columns" infinite-scroll="true" + minimum-visible-rows="contextApp.state.rows.all.length" > diff --git a/src/core_plugins/kibana/public/discover/controllers/discover.js b/src/core_plugins/kibana/public/discover/controllers/discover.js index 9a710e48d9d45..73c8bf9f31e0a 100644 --- a/src/core_plugins/kibana/public/discover/controllers/discover.js +++ b/src/core_plugins/kibana/public/discover/controllers/discover.js @@ -89,8 +89,21 @@ app.directive('discoverApp', function () { }; }); -function discoverController($scope, config, courier, $route, $window, Notifier, - AppState, timefilter, Promise, Private, kbnUrl) { +function discoverController( + $element, + $route, + $scope, + $timeout, + $window, + AppState, + Notifier, + Private, + Promise, + config, + courier, + kbnUrl, + timefilter, +) { const Vis = Private(VisProvider); const docTitle = Private(DocTitleProvider); @@ -106,6 +119,7 @@ function discoverController($scope, config, courier, $route, $window, Notifier, $scope.queryDocLinks = documentationLinks.query; $scope.intervalOptions = Private(AggTypesBucketsIntervalOptionsProvider); $scope.showInterval = false; + $scope.minimumVisibleRows = 50; $scope.intervalEnabled = function (interval) { return interval.val !== 'custom'; @@ -575,10 +589,21 @@ function discoverController($scope, config, courier, $route, $window, Notifier, columnActions.moveColumn($scope.state.columns, columnName, newIndex); }; - $scope.toTop = function () { + $scope.scrollToTop = function () { $window.scrollTo(0, 0); }; + $scope.scrollToBottom = function () { + // delay scrolling to after the rows have been rendered + $timeout(() => { + $element.find('#discoverBottomMarker').focus(); + }, 0); + }; + + $scope.showAllRows = function () { + $scope.minimumVisibleRows = $scope.hits; + }; + let loadingVis; function setupVisualization() { // If we're not setting anything up we need to return an empty promise diff --git a/src/core_plugins/kibana/public/discover/index.html b/src/core_plugins/kibana/public/discover/index.html index 5ea49c5bd05ec..1a37a75914157 100644 --- a/src/core_plugins/kibana/public/discover/index.html +++ b/src/core_plugins/kibana/public/discover/index.html @@ -101,6 +101,16 @@

Searching

+ +
@@ -151,6 +161,7 @@

Searching

data-shared-item data-title="{{opts.savedSearch.lastSavedTitle}}" data-description="{{opts.savedSearch.description}}" + minimum-visible-rows="minimumVisibleRows" render-counter on-add-column="addColumn" on-change-sort-order="setSortOrder" @@ -158,10 +169,12 @@

Searching

on-remove-column="removeColumn" > + +
diff --git a/src/core_plugins/kibana/public/discover/styles/main.less b/src/core_plugins/kibana/public/discover/styles/main.less index c7563db61d6e6..6cd6d82bb9bcc 100644 --- a/src/core_plugins/kibana/public/discover/styles/main.less +++ b/src/core_plugins/kibana/public/discover/styles/main.less @@ -301,3 +301,19 @@ disc-field-chooser { width: auto; } } + +.discover-skip-button { + position: absolute; + left: -10000px; + top: 4px; + width: 1px; + height: 1px; + overflow: hidden; + + &:focus { + left: initial; + right: 15px; + width: auto; + height: auto; + } +} diff --git a/src/ui/public/doc_table/doc_table.js b/src/ui/public/doc_table/doc_table.js index 6795faddd21b4..31f38ee587cc7 100644 --- a/src/ui/public/doc_table/doc_table.js +++ b/src/ui/public/doc_table/doc_table.js @@ -24,6 +24,7 @@ uiModules.get('kibana') infiniteScroll: '=?', filter: '=?', filters: '=?', + minimumVisibleRows: '=?', onAddColumn: '=?', onChangeSortOrder: '=?', onMoveColumn: '=?', @@ -31,7 +32,11 @@ uiModules.get('kibana') }, link: function ($scope, $el) { const notify = new Notifier(); - $scope.limit = 50; + + $scope.$watch('minimumVisibleRows', (minimumVisibleRows) => { + $scope.limit = Math.max(minimumVisibleRows || 50, $scope.limit || 50); + }); + $scope.persist = { sorting: $scope.sorting, columns: $scope.columns