Repository: ambari
Updated Branches:
  refs/heads/trunk e5d261f84 -> 335ddb1fd


AMBARI-15362 Combo Search: use component models instead of host component model 
to populate dropdown list (Joe Wang via rzang)


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

Branch: refs/heads/trunk
Commit: 335ddb1fda405782399517d49077738fa533b47d
Parents: e5d261f
Author: Richard Zang <rz...@apache.org>
Authored: Wed Mar 9 15:24:48 2016 -0800
Committer: Richard Zang <rz...@apache.org>
Committed: Wed Mar 9 15:24:48 2016 -0800

----------------------------------------------------------------------
 .../controllers/main/host/combo_search_box.js   |  4 --
 .../templates/main/host/component_filter.hbs    | 73 --------------------
 .../app/templates/main/host/version_filter.hbs  | 30 --------
 .../app/views/main/host/combo_search_box.js     | 12 ++--
 4 files changed, 6 insertions(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/335ddb1f/ambari-web/app/controllers/main/host/combo_search_box.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/combo_search_box.js 
b/ambari-web/app/controllers/main/host/combo_search_box.js
index 6f64170..2fa4479 100644
--- a/ambari-web/app/controllers/main/host/combo_search_box.js
+++ b/ambari-web/app/controllers/main/host/combo_search_box.js
@@ -56,10 +56,6 @@ App.MainHostComboSearchBoxController = Em.Controller.extend({
     return App.HostComponent.find().filterProperty('componentName', 
facet).length > 0;
   },
 
-  isClientComponent: function(name) {
-    return name.indexOf('CLIENT') >= 0;
-  },
-
   generateQueryParam: function(param) {
     var expressions = param.key;
     var pHash = this.createComboParamHash(param);

http://git-wip-us.apache.org/repos/asf/ambari/blob/335ddb1f/ambari-web/app/templates/main/host/component_filter.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/component_filter.hbs 
b/ambari-web/app/templates/main/host/component_filter.hbs
deleted file mode 100644
index d212533..0000000
--- a/ambari-web/app/templates/main/host/component_filter.hbs
+++ /dev/null
@@ -1,73 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-<button class="btn single-btn-group filter-btn" 
id="host-components-filter-button" {{action "clickFilterButton" 
target="view"}}>{{t common.filter}} <i class="icon-filter"></i></button>
-    <ul class="dropdown-menu filter-components">
-      <li id="title-bar">{{t hosts.filters.filterComponents}}
-        <a class="close" {{action "closeFilter" target="view"}}>X</a>
-      </li>
-      <li id="list-area">
-        <ul>
-          <li>
-            <label class="checkbox">
-            {{view Ember.Checkbox 
checkedBinding="view.masterComponentsChecked"}} {{t 
host.host.componentFilter.master}}:
-            </label>
-            <ul>
-            {{#each component in view.masterComponents}}
-              <li>
-                <label class="checkbox">
-                {{view Ember.Checkbox 
checkedBinding="component.checkedForHostFilter" }} {{unbound 
component.displayName}}
-                </label>
-              </li>
-            {{/each}}
-            </ul>
-          </li>
-          <li>
-            <label class="checkbox">
-            {{view Ember.Checkbox 
checkedBinding="view.slaveComponentsChecked"}} {{t 
host.host.componentFilter.slave}}:
-            </label>
-            <ul>
-            {{#each component in view.slaveComponents}}
-              <li>
-                <label class="checkbox">
-                {{view Ember.Checkbox 
checkedBinding="component.checkedForHostFilter" }} {{unbound 
component.displayName}}
-                </label>
-              </li>
-            {{/each}}
-            </ul>
-          </li>
-          <li>
-            <label class="checkbox">
-            {{view Ember.Checkbox 
checkedBinding="view.clientComponentsChecked"}} {{t 
host.host.componentFilter.client}}:
-            </label>
-            <ul>
-            {{#each component in view.clientComponents}}
-              <li>
-              <label class="checkbox">
-              {{view Ember.Checkbox 
checkedBinding="component.checkedForHostFilter" }} {{unbound 
component.displayName}}
-              </label>
-              </li>
-            {{/each}}
-            </ul>
-          </li>
-        </ul>
-      </li>
-      <li id="button-bar">
-        <button class="btn btn-inverse" {{action "applyFilter" 
target="view"}}>{{t common.apply}}</button>
-      </li>
-    </ul>

http://git-wip-us.apache.org/repos/asf/ambari/blob/335ddb1f/ambari-web/app/templates/main/host/version_filter.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/version_filter.hbs 
b/ambari-web/app/templates/main/host/version_filter.hbs
deleted file mode 100644
index f16e8b5..0000000
--- a/ambari-web/app/templates/main/host/version_filter.hbs
+++ /dev/null
@@ -1,30 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-
-<button class="btn single-btn-group filter-btn" 
id="host-version-filter-button" {{action "clickFilterButton" target="view"}}>
-  {{t common.filter}}
-  <i class="icon-filter"></i>
-</button>
-<ul class="dropdown-menu filter-components">
-  <li>{{view view.versionSelectView}}</li>
-  <li>{{view view.statusSelectView}}</li>
-  <li id="button-bar">
-    <button class="btn btn-inverse" {{action "applyFilter" target="view"}}>{{t 
common.apply}}</button>
-  </li>
-</ul>

http://git-wip-us.apache.org/repos/asf/ambari/blob/335ddb1f/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 3ccacf2..c1d00f4 100644
--- a/ambari-web/app/views/main/host/combo_search_box.js
+++ b/ambari-web/app/views/main/host/combo_search_box.js
@@ -33,14 +33,14 @@ App.MainHostComboSearchBoxView = Em.View.extend({
   },
 
   getHostComponentList: function() {
-    var controller = App.router.get('mainHostComboSearchBoxController');
     var hostComponentList = [];
-    App.HostComponent.find().toArray().forEach(function(component) {
+    App.MasterComponent.find().rejectProperty('totalCount', 0).toArray()
+        .concat(App.SlaveComponent.find().rejectProperty('totalCount', 
0).toArray())
+        .forEach(function(component) {
       var displayName = component.get('displayName');
-      var name = component.get('componentName');
-      if (displayName != null && !controller.isClientComponent(name)) {
+      if (displayName) {
         hostComponentList.push({label: displayName, category: 'Component'});
-        App.router.get('mainHostController.labelValueMap')[displayName] = name;
+        App.router.get('mainHostController.labelValueMap')[displayName] = 
component.get('componentName');
       }
     });
     return hostComponentList;
@@ -130,7 +130,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
             case 'rack':
               
callback(App.Host.find().toArray().mapProperty('rack').uniq().reject(function 
(item) {
                 return visualSearch.searchQuery.values(facet).indexOf(item) >= 
0;
-              }), {preserveMatches: true});
+              }));
               break;
             case 'version':
               callback(App.HostStackVersion.find().toArray()

Reply via email to