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:24 UTC

[1/2] ambari git commit: AMBARI-11782. DataNode directories overrides values with "\n" symbol (onechiporenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 ccc2af97c -> fade596e0


AMBARI-11782. DataNode directories overrides values with "\n" symbol (onechiporenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/13aad89e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/13aad89e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/13aad89e

Branch: refs/heads/branch-2.1
Commit: 13aad89ee84593510e09e276b22eed4f10acd500
Parents: ccc2af9
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Sat Jun 13 14:28:09 2015 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Sat Jun 13 14:28:09 2015 +0300

----------------------------------------------------------------------
 .../configs/objects/service_config_property.js     |  2 +-
 .../objects/service_config_property_test.js        | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/13aad89e/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..ed64387 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -530,7 +530,7 @@ App.ServiceConfigProperty = Em.Object.extend({
     value = '' + value;
     switch(this.get('displayType')) {
       case 'directories':
-        return value.replace(/(\n\r?)+/g, '\n');
+        return value.replace(/(\n\r?)+/g, '\n').trim();
         break;
       default:
         return value;

http://git-wip-us.apache.org/repos/asf/ambari/blob/13aad89e/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..4eaa522 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
@@ -581,6 +581,19 @@ describe('App.ServiceConfigProperty', function () {
             value: "/hadoop/hdfs/data\n"
           })
         }
+      },
+      {
+        m: '`directories`-config with almost equal value (2)',
+        e: true,
+        c: {
+          value: "/hadoop/hdfs/data",
+          displayType: 'directories',
+          supportsFinal: false,
+          isOriginalSCP: false,
+          parentSCP: App.ServiceConfigProperty.create({
+            value: "/hadoop/hdfs/data\n"
+          })
+        }
       }
     ]).forEach(function (test) {
       it(test.m, function () {
@@ -643,11 +656,11 @@ describe('App.ServiceConfigProperty', function () {
     });
 
     it('should trim value', function () {
-      expect(serviceConfigProperty._getValueForCheck(serviceConfigProperty.get('value'))).to.equal('/hadoop/hdfs/data\n');
+      expect(serviceConfigProperty._getValueForCheck(serviceConfigProperty.get('value'))).to.equal('/hadoop/hdfs/data');
     });
 
     it('should trim value 2', function () {
-      expect(serviceConfigProperty._getValueForCheck(serviceConfigProperty.get('overrides.0.value'))).to.equal('/hadoop/hdfs/data\n');
+      expect(serviceConfigProperty._getValueForCheck(serviceConfigProperty.get('overrides.0.value'))).to.equal('/hadoop/hdfs/data');
     });
 
   });


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

Posted by on...@apache.org.
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([]);
+    });
+  })
+
 });