AMBARI-14539 Disable Kerberos link in Config History table if Kerberos is not enabled (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e8deead6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e8deead6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e8deead6 Branch: refs/heads/trunk Commit: e8deead668a09affd94374f3bd3f9d95a6501eb4 Parents: d6883af Author: Aleksandr Kovalenko <[email protected]> Authored: Mon Jan 4 19:34:38 2016 +0200 Committer: Aleksandr Kovalenko <[email protected]> Committed: Mon Jan 4 19:34:38 2016 +0200 ---------------------------------------------------------------------- ambari-web/app/templates/main/dashboard/config_history.hbs | 8 ++++++-- ambari-web/app/views/main/dashboard/config_history_view.js | 9 +++++++-- .../test/views/main/dashboard/config_history_view_test.js | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/e8deead6/ambari-web/app/templates/main/dashboard/config_history.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/dashboard/config_history.hbs b/ambari-web/app/templates/main/dashboard/config_history.hbs index d20c514..e189e62 100644 --- a/ambari-web/app/templates/main/dashboard/config_history.hbs +++ b/ambari-web/app/templates/main/dashboard/config_history.hbs @@ -42,9 +42,13 @@ {{#view view.ConfigVersionView contentBinding="item"}} <td class="first"> <span class="label label-info">{{item.versionText}}</span> - <a {{action goToServiceConfigs item}} class="service-name"> + {{#if view.isServiceLinkDisabled}} {{item.displayName}} - </a> + {{else}} + <a {{action goToServiceConfigs item}} class="service-name"> + {{item.displayName}} + </a> + {{/if}} <i {{bindAttr class=":icon-refresh :restart-required-service item.isRestartRequired::hidden"}} rel="Tooltip" {{translateAttr data-original-title="dashboard.configHistory.table.restart.tooltip"}}></i> </td> http://git-wip-us.apache.org/repos/asf/ambari/blob/e8deead6/ambari-web/app/views/main/dashboard/config_history_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/config_history_view.js b/ambari-web/app/views/main/dashboard/config_history_view.js index a0737c4..88f9025 100644 --- a/ambari-web/app/views/main/dashboard/config_history_view.js +++ b/ambari-web/app/views/main/dashboard/config_history_view.js @@ -115,7 +115,7 @@ App.MainConfigHistoryView = App.TableView.extend(App.TableServerViewMixin, { value: '', label: Em.I18n.t('common.all') } - ].concat(App.Service.find().map(function (service) { + ].concat(App.StackService.find().map(function (service) { return { value: service.get('serviceName'), label: service.get('displayName') @@ -188,7 +188,12 @@ App.MainConfigHistoryView = App.TableView.extend(App.TableServerViewMixin, { }, didInsertElement: function () { App.tooltip(this.$("[rel='Tooltip']"), {html: false}); - } + }, + + // Define if show plain text label or link + isServiceLinkDisabled: function () { + return this.get('content.serviceName') === 'KERBEROS' && !App.Service.find().someProperty('serviceName', 'KERBEROS'); + }.property('content.serviceName') }), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/e8deead6/ambari-web/test/views/main/dashboard/config_history_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/dashboard/config_history_view_test.js b/ambari-web/test/views/main/dashboard/config_history_view_test.js index 4ac8401..af1733d 100644 --- a/ambari-web/test/views/main/dashboard/config_history_view_test.js +++ b/ambari-web/test/views/main/dashboard/config_history_view_test.js @@ -60,13 +60,13 @@ describe('App.MainConfigHistoryView', function() { }); before(function () { - sinon.stub(App.Service, 'find').returns([Em.Object.create({ + sinon.stub(App.StackService, 'find').returns([Em.Object.create({ serviceName: 'S1', displayName: 's1' })]) }); after(function () { - App.Service.find.restore(); + App.StackService.find.restore(); }); it("content", function () { expect(subView.get('content')).to.eql([
