ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject [1/2] ambari git commit: AMBARI-11234 Installer not overriding /stacks values with /recommendations values. (ababiichuk)
Date Tue, 19 May 2015 10:45:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 558925301 -> fddbaf4dd


AMBARI-11234 Installer not overriding /stacks values with /recommendations values. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 3441765407ee544f80e97fa9ebe3de2e2f9ccb71
Parents: 5589253
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Tue May 19 13:08:00 2015 +0300
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Tue May 19 13:08:00 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/mixins/common/configs/enhanced_configs.js | 9 +++++----
 ambari-web/app/views/common/controls_view.js             | 5 +++--
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/34417654/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 5d67ee7..85df56b 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -207,16 +207,17 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
   /**
    * disable saving recommended value for current config
    * @param config
+   * @param {boolean} saveRecommended
    * @method removeCurrentFromDependentList
    */
-  removeCurrentFromDependentList: function (config) {
+  removeCurrentFromDependentList: function (config, saveRecommended) {
     var current = this.get('_dependentConfigValues').find(function(dependentConfig) {
       return Em.get(dependentConfig, 'propertyName') == config.get('name') && Em.get(dependentConfig,
'fileName') == App.config.getConfigTagFromFileName(config.get('filename'))
     });
     if (current) {
       Em.setProperties(current, {
-          'saveRecommended': false,
-          'saveRecommendedDefault': false
+          'saveRecommended': !!saveRecommended,
+          'saveRecommendedDefault': !!saveRecommended
         });
     }
   },
@@ -419,7 +420,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
 
         for (var propertyName in configObject[key].properties) {
 
-          var dependentProperty = this.get('_dependentConfigValues').findProperty('propertyName',
propertyName);
+          var dependentProperty = this.get('_dependentConfigValues').filterProperty('propertyName',
propertyName).findProperty('fileName', key);
           var cp = configProperties.findProperty('name', propertyName);
           var override = (notDefaultGroup && group && cp && cp.get('overrides'))
? cp.get('overrides').findProperty('group.name', group.get('name')) : null;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/34417654/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 7263475..995ace7 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -90,6 +90,7 @@ App.SupportsDependentConfigs = Ember.Mixin.create({
     if (!config.get('isValid')) return $.Deferred().resolve().promise();
     if (App.get('isClusterSupportsEnhancedConfigs') && ['mainServiceInfoConfigsController','wizardStep7Controller'].contains(this.get('controller.name')))
{
       var name = config.get('name');
+      var saveRecommended = (this.get('config.value') === this.get('config.recommendedValue'));
       var controller = this.get('controller');
       var type = App.config.getConfigTagFromFileName(config.get('filename'));
       var p = App.StackConfigProperty.find(name + '_' + type);
@@ -98,10 +99,10 @@ App.SupportsDependentConfigs = Ember.Mixin.create({
           "type": type,
           "name": name
         }], false, function() {
-          controller.removeCurrentFromDependentList(config);
+          controller.removeCurrentFromDependentList(config, saveRecommended);
         });
       } else {
-        controller.removeCurrentFromDependentList(config);
+        controller.removeCurrentFromDependentList(config, saveRecommended);
       }
     }
 


Mime
View raw message