Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 5a73290c6 -> d44782131


AMBARI-17511 - Hosts filter works incorrect with Flume (rzang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d4478213
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d4478213
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d4478213

Branch: refs/heads/branch-2.4
Commit: d44782131685d5d4919a2d041345748f4196865e
Parents: 5a73290
Author: Richard Zang <[email protected]>
Authored: Thu Jun 30 14:50:05 2016 -0700
Committer: Richard Zang <[email protected]>
Committed: Thu Jun 30 14:52:05 2016 -0700

----------------------------------------------------------------------
 ambari-web/app/views/main/host/combo_search_box.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d4478213/ambari-web/app/views/main/host/combo_search_box.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/combo_search_box.js 
b/ambari-web/app/views/main/host/combo_search_box.js
index 29a35ef..f417cc6 100644
--- a/ambari-web/app/views/main/host/combo_search_box.js
+++ b/ambari-web/app/views/main/host/combo_search_box.js
@@ -22,6 +22,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
   templateName: require('templates/main/host/combo_search_box'),
   healthStatusCategories: require('data/host/categories'),
   errMsg: '',
+  serviceMap : {},
 
   didInsertElement: function () {
     this.initVS();
@@ -104,6 +105,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
     var controller = App.router.get('mainHostComboSearchBoxController');
     this.showHideClearButton();
     var map = App.router.get('mainHostController.labelValueMap');
+    var serviceMap = this.get('serviceMap')
     var facetValue = map[facet] || facet;
     if (controller.isComponentStateFacet(facetValue)) {
       facetValue = 'componentState'
@@ -147,7 +149,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
         break;
       case 'services':
         callback(App.Service.find().toArray().map(function (service) {
-          map[App.format.role(service.get('serviceName'), true)] = 
service.get('serviceName');
+          serviceMap[App.format.role(service.get('serviceName'), true)] = 
service.get('serviceName');
           return App.format.role(service.get('serviceName'), true);
         }).reject(function (item) {
           return visualSearch.searchQuery.values(facet).indexOf(item) >= 0;
@@ -289,12 +291,13 @@ App.MainHostComboSearchBoxView = Em.View.extend({
   createFilterConditions: function(searchCollection) {
     var self = this;
     var mainHostController = App.router.get('mainHostController');
+    var map = mainHostController.get('labelValueMap');
+    var serviceMap = this.get('serviceMap');
     var filterConditions = Em.A();
     searchCollection.models.forEach(function (model) {
       var tag = model.attributes;
-      var map = mainHostController.get('labelValueMap');
       var category = map[tag.category] || tag.category;
-      var value = map[tag.value] || tag.value;
+      var value = (category == 'services')? (serviceMap[tag.value] || 
tag.value) : (map[tag.value] || tag.value);
 
       var iColumn = self.getFilterColumn(category, value);
       var filterValue = self.getFilterValue(category, value);

Reply via email to