ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-10344 Min/Max/Step/etc from '/recommendations' API should override '/stacks' data. (ababiichuk)
Date Fri, 03 Apr 2015 13:53:25 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 5d817eaee -> 0055b86bf


AMBARI-10344 Min/Max/Step/etc from '/recommendations' API should override '/stacks' data.
(ababiichuk)


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

Branch: refs/heads/trunk
Commit: 0055b86bfa5a2b3d498dacd5d8440df6a3aa201f
Parents: 5d817ea
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Fri Apr 3 16:48:57 2015 +0300
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Fri Apr 3 16:48:57 2015 +0300

----------------------------------------------------------------------
 .../mixins/common/configs/enhanced_configs.js   | 38 ++++++++++----------
 ambari-web/app/mixins/common/serverValidator.js |  1 +
 .../configs/widgets/config_widget_view.js       |  1 +
 ambari-web/app/views/common/controls_view.js    |  2 +-
 4 files changed, 23 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0055b86b/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 549b783..f6b4588 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -464,7 +464,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
    * @private
    */
   _getConfigsByGroup: function(stepConfigs) {
-    if (this.get('selectedConfigGroup.isDefault')) {
+    if (this.get('selectedConfigGroup.isDefault') || this.get('controller.name') === 'wizardStep7Controller')
{
       return stepConfigs;
     } else {
       var configsToSend = [];
@@ -505,7 +505,8 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
     for (var key in configs) {
 
       /**  defines main info for file name (service name, config group, config that belongs
to filename) **/
-      var serviceName = App.config.getServiceByConfigType(key).get('serviceName');
+      var service = App.config.getServiceByConfigType(key);
+      var serviceName = service.get('serviceName');
       var stepConfig = stepConfigsByGroup.findProperty('serviceName', serviceName);
       var configProperties = stepConfig ? stepConfig.get('configs').filterProperty('filename',
App.config.getOriginalFileName(key)) : [];
 
@@ -531,7 +532,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
                   saveRecommendedDefault: true,
                   fileName: key,
                   propertyName: propertyName,
-                  configGroup: group.get('name'),
+                  configGroup: group ? group.get('name') : service.get('displayName') + "
Default",
                   value: value,
                   serviceName: serviceName,
                   recommendedValue: configs[key].properties[propertyName]
@@ -539,22 +540,23 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
               }
             }
           }
-          /**
-           * 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].min) {
-                stackProperty.set('valueAttributes.minimum', configs[key].property_attributes[propertyName].min);
-              }
-              if (configs[key].property_attributes[propertyName].max) {
-                stackProperty.set('valueAttributes.maximum', configs[key].property_attributes[propertyName].max);
-              }
-              if (configs[key].property_attributes[propertyName].step) {
-                stackProperty.set('valueAttributes.step', configs[key].property_attributes[propertyName].step);
-              }
+        /**
+         * 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].min) {
+              stackProperty.set('valueAttributes.minimum', configs[key].property_attributes[propertyName].min);
+            }
+            if (configs[key].property_attributes[propertyName].max) {
+              stackProperty.set('valueAttributes.maximum', configs[key].property_attributes[propertyName].max);
+            }
+            if (configs[key].property_attributes[propertyName].step) {
+              stackProperty.set('valueAttributes.step', configs[key].property_attributes[propertyName].step);
             }
           }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/0055b86b/ambari-web/app/mixins/common/serverValidator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/serverValidator.js b/ambari-web/app/mixins/common/serverValidator.js
index d6eeef3..76c338b 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -144,6 +144,7 @@ App.ServerValidatorMixin = Em.Mixin.create({
     if (!data) {
       console.warn('error while loading default config values');
     }
+    this._saveRecommendedValues(data, true);
     this.set("recommendationsConfigs", Em.get(data.resources[0] , "recommendations.blueprint.configurations"));
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0055b86b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/config_widget_view.js b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
index a1aaeab..6277253 100644
--- a/ambari-web/app/views/common/configs/widgets/config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
@@ -82,6 +82,7 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
    */
   restoreValue: function () {
     this.set('config.value', this.get('config.defaultValue'));
+    this.sendRequestRorDependentConfigs(this.get('config'));
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/0055b86b/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js
index b41f3c5..1b9e54b 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -67,7 +67,7 @@ App.SupportsDependentConfigs = Ember.Mixin.create({
    * and in case there was changes shows popup with info about changed configs
    */
   sendRequestRorDependentConfigs: function(config) {
-    if (App.get('supports.enhancedConfigs') && App.router.get('clusterInstallCompleted')
&& ['mainServiceInfoConfigsController','wizardStep7Controller'].contains(this.get('controller.name')))
{
+    if (App.get('supports.enhancedConfigs') && ['mainServiceInfoConfigsController','wizardStep7Controller'].contains(this.get('controller.name')))
{
       var name = config.get('name');
       var type = App.config.getConfigTagFromFileName(config.get('filename'));
       var p = App.StackConfigProperty.find(name + '_' + type);


Mime
View raw message