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 2015/06/13 16:59:25 UTC

[2/2] ambari git commit: AMBARI-11900. Config History Buttons are active but should be disabled (onechiporenko)

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/fade596e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fade596e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fade596e

Branch: refs/heads/branch-2.1
Commit: fade596e042f5702e30869b61945c2698b968dfa
Parents: 13aad89
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Sat Jun 13 15:17:14 2015 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Sat Jun 13 15:17:14 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/fade596e/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 ed64387..089b249 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/fade596e/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 4eaa522..8541668 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
@@ -665,4 +665,10 @@ describe('App.ServiceConfigProperty', function () {
 
   });
 
+  describe('#overrideIsFinalValues', function () {
+    it('should be defined as empty array', function () {
+      expect(serviceConfigProperty.get('overrideIsFinalValues')).to.eql([]);
+    });
+  })
+
 });