Repository: ambari Updated Branches: refs/heads/trunk 4e7bf34a7 -> c655d7c08
AMBARI-20087. HiveView 2.0: Table search is case sensitive, show table only if name match exactly. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c655d7c0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c655d7c0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c655d7c0 Branch: refs/heads/trunk Commit: c655d7c08edd82fa5de1a009a7af399dd4b09eb7 Parents: 4e7bf34 Author: Dipayan Bhowmick <[email protected]> Authored: Wed Feb 22 12:55:09 2017 +0530 Committer: Dipayan Bhowmick <[email protected]> Committed: Wed Feb 22 12:55:36 2017 +0530 ---------------------------------------------------------------------- .../hive20/src/main/resources/ui/app/components/list-filter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c655d7c0/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js index d538aa3..db0b5c0 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js @@ -22,6 +22,7 @@ export default Ember.Component.extend({ classNames: ['list-filter'], header: '', subHeader: '', + caseInsensitive: true, items: [], filterText: '', emptyFilterText: Ember.computed('filterText', function() { @@ -29,7 +30,9 @@ export default Ember.Component.extend({ }), filteredItems: Ember.computed('filterText', 'items.@each', function() { return this.get('items').filter((item) => { - return item.get('name').indexOf(this.get('filterText')) !== -1; + let filterText = this.get('caseInsensitive') ? this.get('filterText').toLowerCase() : this.get('filterText'); + let itemName = this.get('caseInsensitive') ? item.get('name').toLowerCase() : item.get('name') + return itemName.indexOf(filterText) !== -1; }); }),
