AMBARI-13857 Recommendation popup should distinguish between empty value 
property and absent properties from current configuration. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 4da648d4448a01361229f789457f3b970553474d
Parents: 696e58b
Author: aBabiichuk <ababiic...@cybervisiontech.com>
Authored: Thu Nov 12 14:53:52 2015 +0200
Committer: aBabiichuk <ababiic...@cybervisiontech.com>
Committed: Thu Nov 12 14:58:57 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/messages.js                                   | 2 ++
 ambari-web/app/mixins/common/configs/enhanced_configs.js     | 4 +++-
 .../templates/common/modal_popups/dependent_configs_list.hbs | 8 +++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4da648d4/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index d255877..b617863 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -390,6 +390,8 @@ Em.I18n.translations = {
   'popup.dependent.configs.table.initValue': 'Initial value',
   'popup.dependent.configs.table.currentValue': 'Current Value',
   'popup.dependent.configs.table.recommendedValue': 'Recommended Value',
+  'popup.dependent.configs.table.not.defined': 'Not Defined',
+
 
   'popup.dependent.configs.select.config.group.header': 'Select Config Group',
   'popup.dependent.configs.select.config.group': 'Please select to which 
config group would you like to save dependent properties',

http://git-wip-us.apache.org/repos/asf/ambari/blob/4da648d4/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 fd50fa6..2e2a926 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -471,6 +471,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
           if (!updateOnlyBoundaries && 
!parentPropertiesNames.contains(App.config.configId(propertyName, key)) && 
initialValue != recommendedValue) { //on first initial request we don't need to 
change values
             if (dependentProperty) {
               Em.set(dependentProperty, 'value', initialValue);
+              Em.set(dependentProperty, 'notDefined', Em.isNone(initialValue));
               Em.set(dependentProperty, 'recommendedValue', recommendedValue);
               Em.set(dependentProperty, 'toDelete', false); // handled in 
<code>saveRecommendedAttributes</code>
               Em.set(dependentProperty, 'toAdd', isNewProperty);
@@ -486,6 +487,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
                 propertyName: propertyName,
                 configGroup: group ? group.get('name') : "",
                 value: initialValue,
+                notDefined: Em.isNone(initialValue),
                 parentConfigs: parentPropertiesNames,
                 serviceName: serviceName,
                 allowChangeGroup: !this.get('selectedService.isDefault') && 
service.get('serviceName') != stepConfig.get('serviceName') && 
stepConfig.get('configGroups.length') > 1,
@@ -591,7 +593,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
                 self.get('_dependentConfigValues').pushObject({
                   saveRecommended: true,
                   saveRecommendedDefault: true,
-                  propertyValue: cp && (self.useInitialValue(serviceName) ? 
cp.get('initialValue') : cp.get('savedValue')),
+                  value: cp && (self.useInitialValue(serviceName) ? 
cp.get('initialValue') : cp.get('savedValue')),
                   toDelete: true,
                   toAdd: false,
                   isDeleted: true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/4da648d4/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs 
b/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
index 7b7be9f..ca62592 100644
--- a/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
+++ b/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
@@ -45,7 +45,13 @@
           </a></span>
         </td>
         <td class="config-dependency-filename">{{config.fileName}}</td>
-        <td class="config-dependency-value">{{config.value}}</td>
+        <td class="config-dependency-value">
+          {{#if config.notDefined}}
+            <i>{{t popup.dependent.configs.table.not.defined}}</i>
+          {{else}}
+            {{config.value}}
+          {{/if}}
+        </td>
         <td class="config-dependency-recommended-value">
           {{#if config.isDeleted}}
             <i>{{t common.removed}}</i>

Reply via email to