Repository: ambari Updated Branches: refs/heads/trunk 4c8b84d0f -> 91ec0fb86
AMBARI-11900. Config History Buttons are active but should be disabled (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d580761f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d580761f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d580761f Branch: refs/heads/trunk Commit: d580761f64f05f0006331ff4ee269a6ef8647cb4 Parents: 4c8b84d Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Sat Jun 13 15:17:14 2015 +0300 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Sat Jun 13 18:00:17 2015 +0300 ---------------------------------------------------------------------- .../app/models/configs/objects/service_config_property.js | 10 +++++++++- .../configs/objects/service_config_property_test.js | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/d580761f/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 799c79f..a2ef828 100644 --- a/ambari-web/app/models/configs/objects/service_config_property.js +++ b/ambari-web/app/models/configs/objects/service_config_property.js @@ -115,6 +115,14 @@ App.ServiceConfigProperty = Em.Object.extend({ warn: false, /** + * List of <code>isFinal</code>-values for overrides + * Set in the controller + * Should be empty array by default! + * @type {boolean[]} + */ + overrideIsFinalValues: [], + + /** * true if property has warning or error * @type {boolean} */ @@ -183,7 +191,7 @@ App.ServiceConfigProperty = Em.Object.extend({ if (Em.isNone(this.get('overrides')) && this.get('overrideValues.length') === 0) return false; return JSON.stringify(this.get('overrides').mapProperty('isFinal')) !== JSON.stringify(this.get('overrideIsFinalValues')) || JSON.stringify(this.get('overrides').mapProperty('value')) !== JSON.stringify(this.get('overrideValues')); - }.property('isOverridden', 'overrides.@each.isNotDefaultValue'), + }.property('isOverridden', 'overrides.@each.isNotDefaultValue', 'overrideValues.length'), isRemovable: function() { var isOriginalSCP = this.get('isOriginalSCP'); http://git-wip-us.apache.org/repos/asf/ambari/blob/d580761f/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 c932d87..b52bad9 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 @@ -652,4 +652,10 @@ describe('App.ServiceConfigProperty', function () { }); + describe('#overrideIsFinalValues', function () { + it('should be defined as empty array', function () { + expect(serviceConfigProperty.get('overrideIsFinalValues')).to.eql([]); + }); + }) + });