Repository: ambari Updated Branches: refs/heads/branch-2.4 05ecaae27 -> 341fcf186
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/341fcf18 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/341fcf18 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/341fcf18 Branch: refs/heads/branch-2.4 Commit: 341fcf186de0e06b0313cf8fbc63786f1ffe20b4 Parents: 05ecaae Author: Richard Zang <[email protected]> Authored: Thu Sep 15 04:42:32 2016 -0700 Committer: Richard Zang <[email protected]> Committed: Thu Sep 15 04:53:25 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/341fcf18/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 cdfd347..f4dac9d 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/341fcf18/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 () {
