Repository: ambari Updated Branches: refs/heads/trunk 7af320663 -> 0ea54c830
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/0ea54c83 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0ea54c83 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0ea54c83 Branch: refs/heads/trunk Commit: 0ea54c830fdc553d150fe2805e4cd88b843141fa Parents: 7af3206 Author: Dipayan Bhowmick <[email protected]> Authored: Fri Feb 26 13:09:30 2016 +0530 Committer: Dipayan Bhowmick <[email protected]> Committed: Fri Feb 26 13:09:30 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/0ea54c83/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/0ea54c83/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/0ea54c83/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/0ea54c83/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}}
