Repository: ambari Updated Branches: refs/heads/trunk 66815a1b3 -> 1672cc9d5
AMBARI-17011 Description for some kerberos identities config has period twice. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1672cc9d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1672cc9d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1672cc9d Branch: refs/heads/trunk Commit: 1672cc9d5d48a9ebdd81078ea29020065cba566b Parents: 66815a1 Author: ababiichuk <[email protected]> Authored: Thu Jun 2 19:12:34 2016 +0300 Committer: ababiichuk <[email protected]> Committed: Fri Jun 3 10:48:25 2016 +0300 ---------------------------------------------------------------------- ambari-web/app/messages.js | 2 +- ambari-web/app/utils/config.js | 6 ++++-- ambari-web/test/utils/config_test.js | 13 +++++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1672cc9d/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index ffc6eb2..8426a56 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -2004,7 +2004,7 @@ Em.I18n.translations = { 'services.service.config.nothing.to.display': 'No properties to display.', 'services.service.config.final':'Final', 'services.service.config.password.additionalDescription': 'For security purposes, password changes will not be shown in configuration version comparisons', - 'services.service.config.secure.additionalDescription': ' This config can be changed from Kerberos page under Admin tab by privileged users.', + 'services.service.config.secure.additionalDescription': 'This config can be changed from Kerberos page under Admin tab by privileged users.', 'services.service.config.saved':'Save Configuration Changes', 'services.service.config.notSaved':'Unable to Save Configuration Changes', 'services.service.config.restartService.TooltipMessage':'<b>Restart Service</b><br>Stale configuration used by {0} components on {1} hosts:{2}', http://git-wip-us.apache.org/repos/asf/ambari/blob/1672cc9d/ambari-web/app/utils/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index f3be6b0..840e3c2 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -507,8 +507,10 @@ App.config = Em.Object.create({ * @returns {*} */ kerberosIdentitiesDescription: function(description) { - return description ? (description.endsWith('.') ? description : description + '.') + - Em.I18n.t('services.service.config.secure.additionalDescription') : Em.I18n.t('services.service.config.secure.additionalDescription'); + if (!description) return Em.I18n.t('services.service.config.secure.additionalDescription'); + description = description.trim(); + return (description.endsWith('.') ? description + ' ' : description + '. ') + + Em.I18n.t('services.service.config.secure.additionalDescription'); }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/1672cc9d/ambari-web/test/utils/config_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js index 1e746fc..d0f9c37 100644 --- a/ambari-web/test/utils/config_test.js +++ b/ambari-web/test/utils/config_test.js @@ -959,13 +959,22 @@ describe('App.config', function () { }); describe('#kerberosIdentitiesDescription', function () { + it('update empty description', function() { + expect(App.config.kerberosIdentitiesDescription()).to.eql(Em.I18n.t('services.service.config.secure.additionalDescription')); + }); + it('update description for identities (without dot)', function() { - expect(App.config.kerberosIdentitiesDescription('some text')).to.eql('some text.' + expect(App.config.kerberosIdentitiesDescription('some text')).to.eql('some text. ' + Em.I18n.t('services.service.config.secure.additionalDescription')); }); it('update description for identities (with dot)', function() { - expect(App.config.kerberosIdentitiesDescription('some text.')).to.eql('some text.' + expect(App.config.kerberosIdentitiesDescription('some text.')).to.eql('some text. ' + + Em.I18n.t('services.service.config.secure.additionalDescription')); + }); + + it('update description for identities (with dot and spaces at the end)', function() { + expect(App.config.kerberosIdentitiesDescription('some text. ')).to.eql('some text. ' + Em.I18n.t('services.service.config.secure.additionalDescription')); }); });
