ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-17877. Some configs with empty value shown on "Customize Service" page are not saved in the configuration type (onechiporenko)
Date Mon, 25 Jul 2016 10:11:59 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 3f613ebf9 -> 1c653d7ab


AMBARI-17877. Some configs with empty value shown on "Customize Service" page are not saved
in the configuration type (onechiporenko)


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

Branch: refs/heads/branch-2.4
Commit: 1c653d7abd743f9b88e7b4457ef1fe2704552fa4
Parents: 3f613eb
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Mon Jul 25 12:59:14 2016 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Mon Jul 25 13:03:38 2016 +0300

----------------------------------------------------------------------
 .../app/mappers/configs/stack_config_properties_mapper.js      | 3 +++
 .../app/mixins/common/configs/config_recommendation_parser.js  | 6 ++++--
 .../mixins/common/configs/config_recommendation_parser_test.js | 6 ++++--
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1c653d7a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js b/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
index 2c8959d..9eda557 100644
--- a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
+++ b/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
@@ -141,6 +141,9 @@ App.stackConfigPropertiesMapper = App.QuickDataMapper.create({
           }
 
           var staticConfigInfo = this.parseIt(config, this.get('configToPlain'));
+          if (Em.isNone(staticConfigInfo.value)) {
+            staticConfigInfo.isVisible = false;
+          }
           var v = Em.isNone(staticConfigInfo.recommendedValue) ? staticConfigInfo.recommendedValue
: staticConfigInfo.value;
           staticConfigInfo.value = staticConfigInfo.recommendedValue = App.config.formatPropertyValue(staticConfigInfo,
v);
           staticConfigInfo.isSecureConfig = App.config.getIsSecure(staticConfigInfo.name);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c653d7a/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/config_recommendation_parser.js b/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
index ec5358b..582c083 100644
--- a/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
+++ b/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
@@ -17,7 +17,6 @@
  */
 
 var App = require('app');
-var validator = require('utils/validator');
 
 App.ConfigRecommendationParser = Em.Mixin.create(App.ConfigRecommendations, {
 
@@ -81,7 +80,7 @@ App.ConfigRecommendationParser = Em.Mixin.create(App.ConfigRecommendations,
{
             for (var attr in propertyAttributes) {
               if (attr === 'delete' && this.allowUpdateProperty(parentProperties,
name, fileName)) {
                 propertiesToDelete.push(config);
-              } else if ((attr === 'visible') || stackProperty) {
+              } else if (attr === 'visible' || stackProperty) {
                 /** update config boundaries **/
                 updateBoundariesCallback(stackProperty, attr, propertyAttributes[attr], name,
fileName, configGroup);
               }
@@ -161,6 +160,9 @@ App.ConfigRecommendationParser = Em.Mixin.create(App.ConfigRecommendations,
{
         errorMessage: '',
         warnMessage: ''
       });
+      if (!Em.isNone(recommendedValue)) {
+        Em.set(config, 'isVisible', true);
+      }
       this.applyRecommendation(Em.get(config, 'name'), Em.get(config, 'filename'), Em.get(config,
'group.name'), recommendedValue, this._getInitialValue(config), parentProperties);
     }
     if (this.updateInitialOnRecommendations(Em.get(config, 'serviceName'))) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c653d7a/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js b/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
index c5ccdb9..f08bbad 100644
--- a/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
+++ b/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
@@ -196,7 +196,8 @@ describe('App.ConfigRecommendationParser', function() {
           'value': 'recommendedValue',
           'initialValue': 'recommendedValue',
           'errorMessage': '',
-          'warnMessage': ''
+          'warnMessage': '',
+          'isVisible': true
         }
       },
       {
@@ -208,7 +209,8 @@ describe('App.ConfigRecommendationParser', function() {
           'value': 'recommendedValue',
           'initialValue': null,
           'errorMessage': '',
-          'warnMessage': ''
+          'warnMessage': '',
+          'isVisible': true
         }
       },
       {


Mime
View raw message