Repository: ambari Updated Branches: refs/heads/branch-2.2 95ce453bd -> 6eb9e78d4
AMBARI-14873. Capacity Scheduler View: Cannot delete 'root.default' queue when it should be. (Akhil PB via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6eb9e78d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6eb9e78d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6eb9e78d Branch: refs/heads/branch-2.2 Commit: 6eb9e78d438383df2ba38867f664a1c7a90785f6 Parents: 95ce453 Author: Dipayan Bhowmick <dipayan.bhowm...@gmail.com> Authored: Fri Feb 26 13:09:30 2016 +0530 Committer: Dipayan Bhowmick <dipayan.bhowm...@gmail.com> Committed: Fri Feb 26 13:10:18 2016 +0530 ---------------------------------------------------------------------- .../src/main/resources/ui/app/components/confirmDelete.js | 7 ++++++- .../src/main/resources/ui/app/controllers/queue.js | 8 +++++++- .../src/main/resources/ui/app/styles/application.less | 7 +++++++ .../src/main/resources/ui/app/templates/queue.hbs | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/6eb9e78d/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js ---------------------------------------------------------------------- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js index 5ada051..d90d349 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/confirmDelete.js @@ -36,11 +36,16 @@ App.ConfirmDeleteComponent = Em.Component.extend(App.ClickElsewhereMixin,{ tagName:'a', tooltip:function () { var element = this.$(); + var tooltipMsg = 'Click again to confirm'; + + if (this.get('param.id') === 'root.default') { + tooltipMsg = "If default queue is removed, applications need to specify the queue name on submission. Click again to confirm."; + } if (this.get('confirm')) { element.tooltip({ placement:'left', - title:'Click again to confirm' + title:tooltipMsg }).tooltip('show'); } else { element.tooltip('destroy'); http://git-wip-us.apache.org/repos/asf/ambari/blob/6eb9e78d/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js ---------------------------------------------------------------------- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js index 6d58e6d..589dcd0 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/controllers/queue.js @@ -200,7 +200,13 @@ App.QueueController = Ember.ObjectController.extend({ * Returns true if queue is root. * @type {Boolean} */ - isRoot:Ember.computed.match('content.id', /^(root|root.default)$/), + isRoot:Ember.computed.match('content.id', /^(root)$/), + + /** + * Returns true if queue is default. + * @type {Boolean} + */ + isDefaultQ:Ember.computed.match('content.id', /^(root.default)$/), /** * Represents queue run state. Returns true if state is null. http://git-wip-us.apache.org/repos/asf/ambari/blob/6eb9e78d/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less ---------------------------------------------------------------------- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less index cd7de10..be79229 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/styles/application.less @@ -262,6 +262,13 @@ text-shadow: 0px -1px 3px #111; } } + .del-default-q { + .tooltip { + .tooltip-inner { + max-width: 350px; + } + } + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/6eb9e78d/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs index bff1e4e..87f00d9 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/queue.hbs @@ -38,7 +38,7 @@ <i class="fa fa-edit"></i> </a> </small> - <small> + <small {{bind-attr class="isDefaultQ:del-default-q"}}> {{confirm-delete action="delQ" param=content}} </small> {{/unless}}