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-20286. While Comparing versions, value in latest version is not shown for custom property (onechiporenko)
Date Fri, 03 Mar 2017 12:42:48 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d14bd4560 -> 63ba7d682


AMBARI-20286. While Comparing versions, value in latest version is not shown for custom property
(onechiporenko)


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

Branch: refs/heads/branch-2.5
Commit: 63ba7d682acc83a55aa5e5a1e7eff0ea6d60a9cb
Parents: d14bd45
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Fri Mar 3 14:42:42 2017 +0200
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Fri Mar 3 14:42:42 2017 +0200

----------------------------------------------------------------------
 .../app/mixins/common/configs/configs_comparator.js   | 14 ++++++++++----
 .../models/configs/objects/service_config_property.js |  7 +++++++
 .../common/configs/service_config_category.hbs        |  3 +++
 ambari-web/app/utils/config.js                        |  3 ++-
 4 files changed, 22 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/63ba7d68/ambari-web/app/mixins/common/configs/configs_comparator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/configs_comparator.js b/ambari-web/app/mixins/common/configs/configs_comparator.js
index aa595ca..18ab899 100644
--- a/ambari-web/app/mixins/common/configs/configs_comparator.js
+++ b/ambari-web/app/mixins/common/configs/configs_comparator.js
@@ -173,6 +173,10 @@ App.ConfigsComparator = Em.Mixin.create({
     Em.set(serviceConfig, 'compareConfigs', []);
     Em.set(serviceConfig, 'isComparison', true);
 
+    if (!Em.get(serviceConfig, 'isCustomGroupConfig')) {
+      Em.set(serviceConfig, 'hasCompareDiffs', false);
+    }
+
     if (compareConfig && selectedConfig) {
       Em.get(serviceConfig, 'compareConfigs').push(this.getComparisonConfig(serviceConfig,
compareConfig));
       Em.get(serviceConfig, 'compareConfigs').push(this.getComparisonConfig(serviceConfig,
selectedConfig));
@@ -250,16 +254,18 @@ App.ConfigsComparator = Em.Mixin.create({
 
     Em.set(serviceConfig, 'compareConfigs', []);
     Em.set(serviceConfig, 'isComparison', true);
-
     //if config isn't reconfigurable then it can't have changed value to compare
     if (compareConfig) {
       compareObject = this.getComparisonConfig(serviceConfig, compareConfig);
       Em.set(serviceConfig, 'hasCompareDiffs', Em.get(serviceConfig, 'isMock') || this.hasCompareDiffs(serviceConfig,
compareObject));
       Em.get(serviceConfig, 'compareConfigs').push(compareObject);
       // user custom property or property that was added during upgrade
-    } else if (Em.get(serviceConfig, 'isUserProperty') || (!isEmptyProp && !compareConfig
&& Em.get(serviceConfig, 'isRequiredByAgent') !== false)) {
-      Em.get(serviceConfig, 'compareConfigs').push(this.getMockComparisonConfig(serviceConfig,
this.get('compareServiceVersion.version')));
-      Em.set(serviceConfig, 'hasCompareDiffs', true);
+    } else {
+      var addToComparison = !Em.get(serviceConfig, 'isCustomGroupConfig') && (Em.get(serviceConfig,
'isUserProperty') || !isEmptyProp && !compareConfig && Em.get(serviceConfig,
'isRequiredByAgent') !== false);
+      if (addToComparison) {
+        Em.get(serviceConfig, 'compareConfigs').push(this.getMockComparisonConfig(serviceConfig,
this.get('compareServiceVersion.version')));
+        Em.set(serviceConfig, 'hasCompareDiffs', true);
+      }
     }
 
     return serviceConfig;

http://git-wip-us.apache.org/repos/asf/ambari/blob/63ba7d68/ambari-web/app/models/configs/objects/service_config_property.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js b/ambari-web/app/models/configs/objects/service_config_property.js
index 4459946..b99d774 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -160,6 +160,13 @@ App.ServiceConfigProperty = Em.Object.extend({
   isConfigIdentity: false,
   copy: '',
 
+  /**
+   * Determines if config exists in the non-default config group but is loaded for default
config group
+   *
+   * @type {boolean}
+   */
+  isCustomGroupConfig: false,
+
   error: Em.computed.bool('errorMessage.length'),
   warn: Em.computed.bool('warnMessage.length'),
   hasValidationErrors: Em.computed.bool('validationErrors.length'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/63ba7d68/ambari-web/app/templates/common/configs/service_config_category.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config_category.hbs b/ambari-web/app/templates/common/configs/service_config_category.hbs
index d3a2c31..f6a4ed6 100644
--- a/ambari-web/app/templates/common/configs/service_config_category.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_category.hbs
@@ -76,6 +76,9 @@
                 </div>
               {{/if}}
               {{#if this.isComparison}}
+                {{#unless this.isOriginalSCP}}
+                  {{view viewClass serviceConfigBinding="this" categoryConfigsAllBinding="view.categoryConfigsAll"
}}
+                {{/unless}}
                 {{view App.ServiceConfigView.SCPComparisonRowsView serviceConfigPropertyBinding="this"}}
               {{else}}
                 {{#if this.isOverridden}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/63ba7d68/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index d039ec7..a7f4edf 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1165,7 +1165,8 @@ App.config = Em.Object.create({
       'isOriginalSCP': false,
       'overrides': null,
       'group': configGroup,
-      'parentSCP': null
+      'parentSCP': null,
+      isCustomGroupConfig: true
     });
 
     if (!configGroup.get('properties.length')) {


Mime
View raw message