AMBARI-18389 - Config compare shows incorrect value after enabling kerberos 
<fix1> (rzang)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 561dc8ee0f524744b92c19e860e923ed890c1a36
Parents: 1123ba2
Author: Richard Zang <rz...@apache.org>
Authored: Thu Sep 15 04:42:32 2016 -0700
Committer: Richard Zang <rz...@apache.org>
Committed: Thu Sep 15 04:52:05 2016 -0700

----------------------------------------------------------------------
 .../configs/widgets/plain_config_text_field.js  |  2 +-
 .../objects/service_config_property_test.js     | 38 ++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/561dc8ee/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js 
b/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
index 5444b27..b70fb40 100644
--- a/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
+++ b/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
@@ -29,7 +29,7 @@ App.PlainConfigTextField = 
Ember.View.extend(App.SupportsDependentConfigs, App.W
   templateName: 
require('templates/common/configs/widgets/plain_config_text_field'),
   valueBinding: 'config.value',
   classNames: ['widget-config-plain-text-field'],
-  placeholderBinding: 'config.savedValue',
+  placeholderBinding: 'config.placeholder',
 
   disabled: Em.computed.not('config.isEditable'),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/561dc8ee/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 d462025..49613a44 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
@@ -188,6 +188,44 @@ describe('App.ServiceConfigProperty', function () {
 
   App.TestAliases.testAsComputedAnd(getProperty(), 'hideFinalIcon', 
['!isFinal', 'isNotEditable']);
 
+  describe('#placeholder', function () {
+    it('should equal foo', function() {
+      serviceConfigProperty.set('isEditable', true);
+      var testCases = [
+        {
+          placeholderText: 'foo',
+          savedValue: ''
+        },
+        {
+          placeholderText: '',
+          savedValue: 'foo'
+        },
+        {
+          placeholderText: 'foo',
+          savedValue: 'bar'
+        }
+      ];
+      testCases.forEach(function (item) {
+        serviceConfigProperty.set('placeholderText', item.placeholderText);
+        serviceConfigProperty.set('savedValue', item.savedValue);
+        expect(serviceConfigProperty.get('placeholder')).to.equal('foo');
+      });
+    });
+    it('should equal null', function() {
+      serviceConfigProperty.set('isEditable', false);
+      var testCases = [
+        {
+          placeholderText: 'foo',
+          savedValue: 'bar'
+        }
+      ];
+      testCases.forEach(function (item) {
+        serviceConfigProperty.set('placeholderText', item.placeholderText);
+        serviceConfigProperty.set('savedValue', item.savedValue);
+        expect(serviceConfigProperty.get('placeholder')).to.equal(null);
+      });
+    });
+  });
   describe('#isPropertyOverridable', function () {
     overridableFalseData.forEach(function (item) {
       it('should be false', function () {

Reply via email to