Repository: ambari Updated Branches: refs/heads/trunk 07616603c -> b19cee169
AMBARI-11066. ACID Transactions override issue (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b19cee16 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b19cee16 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b19cee16 Branch: refs/heads/trunk Commit: b19cee16915f28b95deef881c1b520cb1b2458ee Parents: 0761660 Author: Oleg Nechiporenko <[email protected]> Authored: Mon May 18 20:11:45 2015 +0300 Committer: Oleg Nechiporenko <[email protected]> Committed: Mon May 18 20:11:45 2015 +0300 ---------------------------------------------------------------------- .../configs/objects/service_config_property.js | 28 +++++++++++++++----- .../configs/service_configs_by_category_view.js | 15 +++-------- .../objects/service_config_property_test.js | 2 +- 3 files changed, 26 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b19cee16/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 6abf4ac..2357467 100644 --- a/ambari-web/app/models/configs/objects/service_config_property.js +++ b/ambari-web/app/models/configs/objects/service_config_property.js @@ -432,18 +432,34 @@ App.ServiceConfigProperty = Em.Object.extend({ var parentSCP = this.get('parentSCP'); if (!isOriginalSCP) { if (!Em.isNone(parentSCP)) { - if (value === parentSCP.get('value') || supportsFinal && isFinal === parentSCP.get('isFinal')) { - this.set('errorMessage', Em.I18n.t('config.override.valueEqualToParentConfig')); - isError = true; + if (value === parentSCP.get('value')) { + if (supportsFinal) { + if (isFinal === parentSCP.get('isFinal')) { + this.set('errorMessage', Em.I18n.t('config.override.valueEqualToParentConfig')); + isError = true; + } + } + else { + this.set('errorMessage', Em.I18n.t('config.override.valueEqualToParentConfig')); + isError = true; + } } else { var overrides = parentSCP.get('overrides'); if (overrides) { overrides.forEach(function (override) { if (self == override) return; - if (value === override.get('value') || supportsFinal && isFinal === parentSCP.get('isFinal')) { - self.set('errorMessage', Em.I18n.t('config.override.valueEqualToAnotherOverrideConfig')); - isError = true; + if (value === override.get('value')) { + if (supportsFinal) { + if (isFinal === parentSCP.get('isFinal')) { + self.set('errorMessage', Em.I18n.t('config.override.valueEqualToAnotherOverrideConfig')); + isError = true; + } + } + else { + self.set('errorMessage', Em.I18n.t('config.override.valueEqualToAnotherOverrideConfig')); + isError = true; + } } }); } http://git-wip-us.apache.org/repos/asf/ambari/blob/b19cee16/ambari-web/app/views/common/configs/service_configs_by_category_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_configs_by_category_view.js b/ambari-web/app/views/common/configs/service_configs_by_category_view.js index 3df706e..314822d 100644 --- a/ambari-web/app/views/common/configs/service_configs_by_category_view.js +++ b/ambari-web/app/views/common/configs/service_configs_by_category_view.js @@ -61,8 +61,7 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri * they were not visible initially. */ categoryConfigsAll: function () { - var configs = this.get('serviceConfigs').filterProperty('category', this.get('category.name')); - return configs; + return this.get('serviceConfigs').filterProperty('category', this.get('category.name')); }.property('serviceConfigs.@each').cacheable(), /** @@ -74,12 +73,6 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri return this.get('category.isCollapsed') ? "display: none;" : "display: block;" }.property('serviceConfigs.length'), - childView: App.ServiceConfigsOverridesView, - - changeFlag: Ember.Object.create({ - val: 1 - }), - /** * Should we show config group or not * @type {boolean} @@ -97,12 +90,10 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri */ orderContentAtLast: function (categoryConfigs) { var contentProperties = categoryConfigs.filterProperty('displayType', 'content'); - var self = this; if (!contentProperties.length) { return categoryConfigs } else { - var comparator; return categoryConfigs.sort(function (a, b) { var aContent = contentProperties.someProperty('name', a.get('name')); var bContent = contentProperties.someProperty('name', b.get('name')); @@ -192,12 +183,12 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri self.get("controller").set("miscModalVisible", false); this.hide(); }, - footerClass: Ember.View.extend({ + footerClass: Em.View.extend({ classNames: ['modal-footer'], templateName: require('templates/common/configs/propertyDependence_footer'), canIgnore: serviceId == 'MISC' }), - bodyClass: Ember.View.extend({ + bodyClass: Em.View.extend({ templateName: require('templates/common/configs/propertyDependence'), controller: this, propertyChange: self.get("newAffectedProperties"), http://git-wip-us.apache.org/repos/asf/ambari/blob/b19cee16/ambari-web/test/models/configs/objects/service_config_property_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/models/configs/objects/service_config_property_test.js b/ambari-web/test/models/configs/objects/service_config_property_test.js index a364810..004153a 100644 --- a/ambari-web/test/models/configs/objects/service_config_property_test.js +++ b/ambari-web/test/models/configs/objects/service_config_property_test.js @@ -500,7 +500,7 @@ describe('App.ServiceConfigProperty', function () { }, { m: 'not original config, isFinal equal to parent', - e: true, + e: false, c: { value: 'on', isOriginalSCP: false,
