From 562011647fd4916f8fb40942f5b82ad274ba1912 Mon Sep 17 00:00:00 2001 From: Lukas Olson Date: Fri, 31 Mar 2017 11:37:10 -0700 Subject: [PATCH] Use ui-select for index pattern selector (#10144) * Replace index pattern selector with ui-select * Show index patterns in alphabetical order * Add highlighting to select --- package.json | 1 + .../__tests__/directives/field_chooser.js | 3 ++- .../field_chooser/field_chooser.html | 24 ++++++++++--------- .../components/field_chooser/field_chooser.js | 1 + .../kibana/public/discover/index.html | 1 - src/ui/public/styles/sidebar.less | 7 ++---- webpackShims/angular-ui-select.js | 7 ++++++ 7 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 webpackShims/angular-ui-select.js diff --git a/package.json b/package.json index bfb2ef7acfa68..8c62abea9ab09 100644 --- a/package.json +++ b/package.json @@ -193,6 +193,7 @@ "tinygradient": "0.3.0", "trunc-html": "1.0.2", "trunc-text": "1.0.2", + "ui-select": "0.19.6", "url-loader": "0.5.6", "validate-npm-package-name": "2.2.2", "vision": "4.1.0", diff --git a/src/core_plugins/kibana/public/discover/__tests__/directives/field_chooser.js b/src/core_plugins/kibana/public/discover/__tests__/directives/field_chooser.js index bbe845cf9a338..8e142a59cd919 100644 --- a/src/core_plugins/kibana/public/discover/__tests__/directives/field_chooser.js +++ b/src/core_plugins/kibana/public/discover/__tests__/directives/field_chooser.js @@ -101,7 +101,8 @@ describe('discover field chooser directives', function () { describe('Index list', function () { it('should be in alphabetical order', function (done) { - expect($elem.find('li.sidebar-item-title').text()).to.be('abc'); + $elem.find('.ui-select-toggle').click(); + expect($elem.find('[role=option]').text().replace(/\W+/g, '')).to.be('abc'); done(); }); }); diff --git a/src/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.html b/src/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.html index 5afb01b27983c..2788903fb0c42 100644 --- a/src/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.html +++ b/src/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.html @@ -1,16 +1,18 @@