From 67e1dbd3ce0651fab8be13a48e900b406708582b Mon Sep 17 00:00:00 2001 From: Elastic Jasper Date: Thu, 16 Feb 2017 13:27:07 -0500 Subject: [PATCH] Re-use the filter function for inline filtering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backports PR #10395 **Commit 1:** Re-use the filter function for inline filtering Re-using the passed filter function improves consistency with the implementation of the filters in the document details table. * Original sha: 44cdfe8eaf4e8559825e1779703c8cc8266f5b01 * Authored by Felix Stürmer on 2017-02-16T14:45:42Z **Commit 2:** Revert back to using $event to avoid encoding problems * Original sha: eefba7348cf7d80dd0caffb7ee4b9bb76dfbbf36 * Authored by Felix Stürmer on 2017-02-16T17:33:49Z --- src/ui/public/doc_table/components/table_row.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ui/public/doc_table/components/table_row.js b/src/ui/public/doc_table/components/table_row.js index 283e1660a1019..0d00b58dab18b 100644 --- a/src/ui/public/doc_table/components/table_row.js +++ b/src/ui/public/doc_table/components/table_row.js @@ -9,7 +9,6 @@ import noWhiteSpace from 'ui/utils/no_white_space'; import openRowHtml from 'ui/doc_table/components/table_row/open.html'; import detailsHtml from 'ui/doc_table/components/table_row/details.html'; import uiModules from 'ui/modules'; -import FilterManagerProvider from 'ui/filter_manager'; const module = uiModules.get('app/discover'); @@ -25,10 +24,9 @@ const MIN_LINE_LENGTH = 20; * * ``` */ -module.directive('kbnTableRow', ['$compile', 'Private', function ($compile, Private) { +module.directive('kbnTableRow', ['$compile', function ($compile) { const cellTemplate = _.template(noWhiteSpace(require('ui/doc_table/components/table_row/cell.html'))); const truncateByHeightTemplate = _.template(noWhiteSpace(require('ui/partials/truncate_by_height.html'))); - const filterManager = Private(FilterManagerProvider); return { restrict: 'A', @@ -88,8 +86,7 @@ module.directive('kbnTableRow', ['$compile', 'Private', function ($compile, Priv $scope.inlineFilter = function inlineFilter($event, type) { const column = $($event.target).data().column; const field = $scope.indexPattern.fields.byName[column]; - $scope.indexPattern.popularizeField(field, 1); - filterManager.add(field, $scope.flattenedRow[column], type, $scope.indexPattern.id); + $scope.filter(field, $scope.flattenedRow[column], type); }; // create a tr element that lists the value for each *column*