ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-7543. Hosts filter by component does not reset after click on Hosts tab. (Max Shepel via akovalenko)
Date Mon, 29 Sep 2014 17:54:30 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 7faf263af -> 8cfd5cd29


AMBARI-7543. Hosts filter by component does not reset after click on Hosts tab. (Max Shepel
via akovalenko)


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

Branch: refs/heads/trunk
Commit: 8cfd5cd29c671995218b392238eadf4c7257d3c4
Parents: 7faf263
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon Sep 29 20:51:08 2014 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon Sep 29 20:51:08 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js         | 24 -------------
 .../templates/main/host/component_filter.hbs    |  6 ++--
 ambari-web/app/views/main/host.js               | 36 +++++++++++++++++---
 3 files changed, 35 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8cfd5cd2/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index 227a091..f589fd2 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -47,30 +47,6 @@ App.MainHostController = Em.ArrayController.extend({
     return installedComponents;
   }.property('App.router.clusterController.isLoaded'),
 
-  /**
-   * Master components
-   * @returns {Array}
-   */
-  masterComponents: function () {
-    return this.get('componentsForFilter').filterProperty('isMaster', true);
-  }.property('componentsForFilter'),
-
-  /**
-   * Slave components
-   * @returns {Array}
-   */
-  slaveComponents: function () {
-    return this.get('componentsForFilter').filterProperty('isSlave', true);
-  }.property('componentsForFilter'),
-
-  /**
-   * Client components
-   * @returns {Array}
-   */
-  clientComponents: function () {
-    return this.get('componentsForFilter').filterProperty('isClient', true);
-  }.property('componentsForFilter'),
-
   content: function () {
     return this.get('dataSource').filterProperty('isRequested');
   }.property('dataSource.@each.isRequested'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cfd5cd2/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
index 9902708..3f938de 100644
--- a/ambari-web/app/templates/main/host/component_filter.hbs
+++ b/ambari-web/app/templates/main/host/component_filter.hbs
@@ -28,7 +28,7 @@
             {{view Ember.Checkbox checkedBinding="view.masterComponentsChecked"}} {{t host.host.componentFilter.master}}:
             </label>
             <ul>
-            {{#each component in masterComponents}}
+            {{#each component in view.masterComponents}}
               <li>
                 <label class="checkbox">
                 {{view Ember.Checkbox checkedBinding="component.checkedForHostFilter" }}
{{unbound component.displayName}}
@@ -42,7 +42,7 @@
             {{view Ember.Checkbox checkedBinding="view.slaveComponentsChecked"}} {{t host.host.componentFilter.slave}}:
             </label>
             <ul>
-            {{#each component in slaveComponents}}
+            {{#each component in view.slaveComponents}}
               <li>
                 <label class="checkbox">
                 {{view Ember.Checkbox checkedBinding="component.checkedForHostFilter" }}
{{unbound component.displayName}}
@@ -56,7 +56,7 @@
             {{view Ember.Checkbox checkedBinding="view.clientComponentsChecked"}} {{t host.host.componentFilter.client}}:
             </label>
             <ul>
-            {{#each component in clientComponents}}
+            {{#each component in view.clientComponents}}
               <li>
               <label class="checkbox">
               {{view Ember.Checkbox checkedBinding="component.checkedForHostFilter" }} {{unbound
component.displayName}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cfd5cd2/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 3c9a148..48fe603 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -860,12 +860,40 @@ App.MainHostView = App.TableView.extend(App.TableServerProvider, {
     filterView: filters.componentFieldView.extend({
       templateName: require('templates/main/host/component_filter'),
 
+
+      /**
+       * Components which will be shown in component filter
+       * @returns {Array}
+       */
+      componentsForFilter: function () {
+        var installedComponents = App.StackServiceComponent.find().toArray();
+        installedComponents.setEach('checkedForHostFilter', false);
+        return installedComponents;
+      }.property('App.router.clusterController.isLoaded'),
+
+      /**
+       * Master components
+       * @returns {Array}
+       */
+      masterComponents: function () {
+        return this.get('componentsForFilter').filterProperty('isMaster', true);
+      }.property('componentsForFilter'),
+
+      /**
+       * Slave components
+       * @returns {Array}
+       */
+      slaveComponents: function () {
+        return this.get('componentsForFilter').filterProperty('isSlave', true);
+      }.property('componentsForFilter'),
+
       /**
-       * Next three lines bind data to this view
+       * Client components
+       * @returns {Array}
        */
-      masterComponentsBinding: 'controller.masterComponents',
-      slaveComponentsBinding: 'controller.slaveComponents',
-      clientComponentsBinding: 'controller.clientComponents',
+      clientComponents: function () {
+        return this.get('componentsForFilter').filterProperty('isClient', true);
+      }.property('componentsForFilter'),
 
       /**
        * Checkbox for quick selecting/deselecting of master components


Mime
View raw message