You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2017/03/03 12:40:44 UTC
ambari git commit: AMBARI-20286. While Comparing versions,
value in latest version is not shown for custom property
(onechiporenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 07076bd76 -> b624ed6d4
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/b624ed6d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b624ed6d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b624ed6d
Branch: refs/heads/trunk
Commit: b624ed6d4002c79143a4c34fc18bed9df965d3c7
Parents: 07076bd
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Fri Mar 3 13:32:59 2017 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Fri Mar 3 13:32:59 2017 +0200
----------------------------------------------------------------------
.../app/mixins/common/configs/configs_comparator.js | 14 ++++++++++----
.../models/configs/objects/service_config_property.js | 7 +++++++
.../common/configs/service_config_category.hbs | 5 ++++-
ambari-web/app/utils/config.js | 3 ++-
ambari-web/test/views/common/table_view_test.js | 1 -
5 files changed, 23 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b624ed6d/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 4adc5ae..d4551b4 100644
--- a/ambari-web/app/mixins/common/configs/configs_comparator.js
+++ b/ambari-web/app/mixins/common/configs/configs_comparator.js
@@ -196,6 +196,10 @@ App.ConfigsComparator = Em.Mixin.create({
Em.set(serviceConfig, 'isComparison', true);
+ if (!Em.get(serviceConfig, 'isCustomGroupConfig')) {
+ Em.set(serviceConfig, 'hasCompareDiffs', false);
+ }
+
if (compareConfig && selectedConfig) {
compareConfigs.push(this.getComparisonConfig(serviceConfig, compareConfig));
compareConfigs.push(this.getComparisonConfig(serviceConfig, selectedConfig));
@@ -276,16 +280,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 && 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/b624ed6d/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 ed72dc3..5d306eb 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/b624ed6d/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 c9bedc5..9890525 100644
--- a/ambari-web/app/templates/common/configs/service_config_category.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_category.hbs
@@ -85,6 +85,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}}
@@ -116,4 +119,4 @@
</form>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b624ed6d/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 8eeca5f..28881bb 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1148,7 +1148,8 @@ App.config = Em.Object.create({
'isOriginalSCP': false,
'overrides': null,
'group': configGroup,
- 'parentSCP': null
+ 'parentSCP': null,
+ isCustomGroupConfig: true
});
if (!configGroup.get('properties.length')) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/b624ed6d/ambari-web/test/views/common/table_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/table_view_test.js b/ambari-web/test/views/common/table_view_test.js
index dd289b0..3d11e30 100644
--- a/ambari-web/test/views/common/table_view_test.js
+++ b/ambari-web/test/views/common/table_view_test.js
@@ -396,7 +396,6 @@ describe('App.TableView', function () {
});
describe('#clearStartIndex', function() {
- var view;
beforeEach(function() {
view = getView();