You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2015/04/19 21:18:40 UTC

ambari git commit: AMBARI-10588. 'dtnode_heapsize' maximum not being used by the widget

Repository: ambari
Updated Branches:
  refs/heads/trunk 1cc1526c2 -> 027ac6769


AMBARI-10588. 'dtnode_heapsize' maximum not being used by the widget


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

Branch: refs/heads/trunk
Commit: 027ac67694a0f4f96352a997890673e70af47cad
Parents: 1cc1526
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Sun Apr 19 12:16:15 2015 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Sun Apr 19 12:16:15 2015 -0700

----------------------------------------------------------------------
 .../mixins/common/configs/enhanced_configs.js   | 42 +++++++++++---------
 1 file changed, 24 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/027ac676/ambari-web/app/mixins/common/configs/enhanced_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/enhanced_configs.js b/ambari-web/app/mixins/common/configs/enhanced_configs.js
index a040ad3..c027c93 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -440,26 +440,32 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
             }
           }
         }
+      }
+      this._saveRecommendedAttributes(configs);
+    }
+  },
 
-        /**
-         * saving new attribute values
-         */
-        if (configs[key].property_attributes && configs[key].property_attributes[propertyName]) {
-
-          var stackProperty = App.StackConfigProperty.find(propertyName + '_' + key);
-          if (stackProperty && stackProperty.get('valueAttributes')) {
-            if (configs[key].property_attributes[propertyName].minimum) {
-              stackProperty.set('valueAttributes.minimum', configs[key].property_attributes[propertyName].minimum);
-            }
-            if (configs[key].property_attributes[propertyName].maximum) {
-              stackProperty.set('valueAttributes.maximum', configs[key].property_attributes[propertyName].maximum);
-            }
-            if (configs[key].property_attributes[propertyName].increment_step) {
-              stackProperty.set('valueAttributes.increment_step', configs[key].property_attributes[propertyName].increment_step);
-            }
+  /**
+   * Save property attributes recieved from recommendations. These attributes are minimum, maximum,
+   * increment_step. Attributes are stored in <code>App.StackConfigProperty</code> model.
+   *
+   * @param {Object[]} configs
+   */
+  _saveRecommendedAttributes: function(configs) {
+    Em.keys(configs).forEach(function(siteName) {
+      var properties = configs[siteName].property_attributes;
+      if (properties) {
+        Em.keys(properties).forEach(function(propertyName) {
+          var stackProperty = App.StackConfigProperty.find(propertyName + '_' + siteName);
+          if (stackProperty && properties) {
+            var attributes = properties[propertyName];
+            Em.keys(attributes || []).forEach(function(attributeName) {
+              Em.set(stackProperty.get('valueAttributes'), attributeName, attributes[attributeName]);
+            });
           }
-        }
+        });
       }
-    }
+    });
   }
+
 });