Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 81BD2200C2C for ; Fri, 3 Mar 2017 13:42:50 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 80465160B6D; Fri, 3 Mar 2017 12:42:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A590D160B57 for ; Fri, 3 Mar 2017 13:42:49 +0100 (CET) Received: (qmail 97663 invoked by uid 500); 3 Mar 2017 12:42:48 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 97654 invoked by uid 99); 3 Mar 2017 12:42:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Mar 2017 12:42:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 933DDDFCA1; Fri, 3 Mar 2017 12:42:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: onechiporenko@apache.org To: commits@ambari.apache.org Message-Id: <063e72b6ebe144b49b12fedebeffe650@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-20286. While Comparing versions, value in latest version is not shown for custom property (onechiporenko) Date: Fri, 3 Mar 2017 12:42:48 +0000 (UTC) archived-at: Fri, 03 Mar 2017 12:42:50 -0000 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 Authored: Fri Mar 3 14:42:42 2017 +0200 Committer: Oleg Nechiporenko 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 @@ {{/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')) {