Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 c126b37e6 -> ba9ab71ed


AMBARI-21724 Hosts filters work incorrectly. (atkach)


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

Branch: refs/heads/branch-2.6
Commit: ba9ab71ed7463b9a4d02b4dc279979856afbd7f3
Parents: c126b37
Author: Andrii Tkach <atk...@apache.org>
Authored: Thu Aug 17 10:35:43 2017 +0300
Committer: Andrii Tkach <atk...@apache.org>
Committed: Thu Aug 17 10:36:06 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/mappers/hosts_mapper.js |  2 ++
 ambari-web/app/models/host.js          |  2 ++
 ambari-web/app/views/main/host.js      | 10 ++++++++++
 3 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ba9ab71e/ambari-web/app/mappers/hosts_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/hosts_mapper.js 
b/ambari-web/app/mappers/hosts_mapper.js
index 5042e67..a2d64bf 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -206,6 +206,7 @@ App.hostsMapper = App.QuickDataMapper.create({
         parsedItem.not_started_components = notStartedComponents;
         parsedItem.components_in_passive_state = componentsInPassiveState;
         parsedItem.components_with_stale_configs = componentsWithStaleConfigs;
+        parsedItem.is_filtered = true;
 
         hostIds[item.Hosts.host_name] = parsedItem;
 
@@ -224,6 +225,7 @@ App.hostsMapper = App.QuickDataMapper.create({
 
       //"itemTotal" present only for Hosts page request
       if (!Em.isNone(json.itemTotal)) {
+        App.Host.find().setEach('isFiltered', false);
         App.Host.find().clear();
         //App.HostComponent.find contains master components which requested 
across the app hence it should not be cleared
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba9ab71e/ambari-web/app/models/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js
index 58ffd41..69e43ba 100644
--- a/ambari-web/app/models/host.js
+++ b/ambari-web/app/models/host.js
@@ -55,6 +55,8 @@ App.Host = DS.Model.extend({
   index: DS.attr('number'),
   stackVersions: DS.hasMany('App.HostStackVersion'),
 
+  isFiltered: DS.attr('boolean'),
+
   /**
    * Is host checked at the main Hosts page
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba9ab71e/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js 
b/ambari-web/app/views/main/host.js
index 52692cc..273fd10 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -50,6 +50,16 @@ App.MainHostView = 
App.TableView.extend(App.TableServerViewMixin, {
    */
   contentBinding: 'controller.content',
 
+  filteredContent: [],
+
+  filteredContentObserver: function() {
+    Em.run.once(this, this.setFilteredContentOnce);
+  }.observes('content.@each'),
+
+  setFilteredContentOnce: function() {
+    this.set('filteredContent', 
this.get('content').filterProperty('isFiltered'));
+  },
+
   onRequestErrorHandler: function() {
     this.set('requestError', null);
     this.set('filteringComplete', true);

Reply via email to