ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [11/50] ambari git commit: AMBARI-20087. HiveView 2.0: Table search is case sensitive, show table only if name match exactly. (dipayanb)
Date Fri, 24 Feb 2017 14:19:18 GMT
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/branch-feature-AMBARI-12556
Commit: c655d7c08edd82fa5de1a009a7af399dd4b09eb7
Parents: 4e7bf34
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Wed Feb 22 12:55:09 2017 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
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;
     });
   }),
 


Mime
View raw message