AMBARI-6944. Remove HA category from 'Admin' tab. (Denys Buzhor via akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/85d181dd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/85d181dd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/85d181dd Branch: refs/heads/branch-alerts-dev Commit: 85d181dd04da7fd19a8c06a9aa09b0dd291358b7 Parents: 3b2bb33 Author: Aleksandr Kovalenko <[email protected]> Authored: Wed Aug 20 18:35:19 2014 +0300 Committer: Aleksandr Kovalenko <[email protected]> Committed: Wed Aug 20 18:36:59 2014 +0300 ---------------------------------------------------------------------- .../main/admin/highAvailability_controller.js | 4 +- ambari-web/app/router.js | 7 ++- .../app/routes/high_availability_routes.js | 4 +- ambari-web/app/routes/main.js | 30 +++--------- .../app/routes/rm_high_availability_routes.js | 14 ++++-- ambari-web/app/routes/rollbackHA_routes.js | 2 +- .../templates/main/admin/highAvailability.hbs | 51 -------------------- ambari-web/app/views.js | 1 - ambari-web/app/views/main/admin.js | 7 --- .../views/main/admin/highAvailability_view.js | 27 ----------- ambari-web/app/views/main/menu.js | 7 --- .../admin/highAvailability_controller_test.js | 2 +- .../service/reassign/step2_controller_test.js | 12 ++--- 13 files changed, 33 insertions(+), 135 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/controllers/main/admin/highAvailability_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js index c40e99a..8d79f96 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js @@ -56,7 +56,7 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({ return false; } } - App.router.transitionTo('main.admin.enableHighAvailability'); + App.router.transitionTo('main.services.enableHighAvailability'); return true; }, @@ -82,7 +82,7 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({ this.showErrorPopup(message); return false; } - App.router.transitionTo('main.admin.enableRMHighAvailability'); + App.router.transitionTo('main.services.enableRMHighAvailability'); return true; }, http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/router.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index 8bc0cf3..3b4fb07 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -306,10 +306,13 @@ App.Router = Em.Router.extend({ route = 'main.reassign'; } else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('highAvailabilityWizardController.name')) { // if wizardControllerName == "highAvailabilityWizardController", then it means someone closed the browser or the browser was crashed when we were last in NameNode High Availability wizard - route = 'main.admin.enableHighAvailability'; + route = 'main.services.enableHighAvailability'; + } else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('rMHighAvailabilityWizardController.name')) { + // if wizardControllerName == "highAvailabilityWizardController", then it means someone closed the browser or the browser was crashed when we were last in NameNode High Availability wizard + route = 'main.services.enableRMHighAvailability'; } else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('rollbackHighAvailabilityWizardController.name')) { // if wizardControllerName == "highAvailabilityRollbackController", then it means someone closed the browser or the browser was crashed when we were last in NameNode High Availability Rollback wizard - route = 'main.admin.rollbackHighAvailability'; + route = 'main.services.rollbackHighAvailability'; } callback(route); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/routes/high_availability_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/high_availability_routes.js b/ambari-web/app/routes/high_availability_routes.js index c414192..93a3ca1 100644 --- a/ambari-web/app/routes/high_availability_routes.js +++ b/ambari-web/app/routes/high_availability_routes.js @@ -72,7 +72,7 @@ module.exports = App.WizardRoute.extend({ clusterName: controller.get('content.cluster.name'), clusterState: 'DEFAULT', localdb: App.db.data - },{alwaysCallback: function() {self.hide();App.router.transitionTo('main.index');location.reload();}}); + },{alwaysCallback: function() {self.hide();App.router.transitionTo('main.services.index');location.reload();}}); } }, didInsertElement: function () { @@ -306,7 +306,7 @@ module.exports = App.WizardRoute.extend({ clusterName: controller.get('content.cluster.name'), clusterState: 'DEFAULT', localdb: App.db.data - },{alwaysCallback: function() {controller.get('popup').hide();router.transitionTo('main.index');location.reload();}}); + },{alwaysCallback: function() {controller.get('popup').hide();router.transitionTo('main.services.index');location.reload();}}); } }), http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/routes/main.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index 1501f0f..7598695 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -366,28 +366,6 @@ module.exports = Em.Route.extend({ } }), - adminHighAvailability: Em.Route.extend({ - route: '/highAvailability', - enter: function (router) { - Em.run.next(function () { - router.transitionTo('adminHighAvailability.index'); - }); - }, - index: Ember.Route.extend({ - route: '/', - connectOutlets: function (router, context) { - router.set('mainAdminController.category', "highAvailability"); - router.get('mainAdminController').connectOutlet('mainAdminHighAvailability'); - } - }) - }), - - enableHighAvailability: require('routes/high_availability_routes'), - - rollbackHighAvailability: require('routes/rollbackHA_routes'), - - enableRMHighAvailability: require('routes/rm_high_availability_routes'), - adminSecurity: Em.Route.extend({ route: '/security', enter: function (router) { @@ -660,7 +638,13 @@ module.exports = Em.Route.extend({ }), showService: Em.Router.transitionTo('service'), addService: Em.Router.transitionTo('serviceAdd'), - reassign: Em.Router.transitionTo('reassign') + reassign: Em.Router.transitionTo('reassign'), + + enableHighAvailability: require('routes/high_availability_routes'), + + enableRMHighAvailability: require('routes/rm_high_availability_routes'), + + rollbackHighAvailability: require('routes/rollbackHA_routes') }), reassign: require('routes/reassign_master_routes'), http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/routes/rm_high_availability_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/rm_high_availability_routes.js b/ambari-web/app/routes/rm_high_availability_routes.js index b989489..bdf4d9e 100644 --- a/ambari-web/app/routes/rm_high_availability_routes.js +++ b/ambari-web/app/routes/rm_high_availability_routes.js @@ -49,15 +49,17 @@ module.exports = App.WizardRoute.extend({ localdb: App.db.data }, {alwaysCallback: function () { self.hide(); - router.transitionTo('main.index'); - location.reload(); + router.route('/main/services/YARN/summary'); + Em.run.next(function() { + location.reload(); + }); }}); }, Em.I18n.t('admin.rm_highAvailability.closePopup')); } else { this.hide(); rMHighAvailabilityWizardController.setCurrentStep('1'); router.get('updateController').set('isWorking', true); - router.transitionTo('main.index') + router.transitionTo('main.services.index'); } }, didInsertElement: function () { @@ -175,8 +177,10 @@ module.exports = App.WizardRoute.extend({ localdb: App.db.data }, {alwaysCallback: function () { controller.get('popup').hide(); - router.transitionTo('main.index'); - location.reload(); + router.route('/main/services/YARN/summary'); + Em.run.next(function() { + location.reload(); + }); }}); } }), http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/routes/rollbackHA_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/rollbackHA_routes.js b/ambari-web/app/routes/rollbackHA_routes.js index 9c91761..99e893e 100644 --- a/ambari-web/app/routes/rollbackHA_routes.js +++ b/ambari-web/app/routes/rollbackHA_routes.js @@ -47,7 +47,7 @@ module.exports = App.WizardRoute.extend({ this.hide(); App.router.get('rollbackHighAvailabilityWizardController').setCurrentStep('1'); App.router.get('updateController').set('isWorking', true); - App.router.transitionTo('main.admin.adminHighAvailability'); + App.router.transitionTo('main.services'); }, didInsertElement: function () { this.fitHeight(); http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/templates/main/admin/highAvailability.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability.hbs b/ambari-web/app/templates/main/admin/highAvailability.hbs deleted file mode 100644 index 29d70ef..0000000 --- a/ambari-web/app/templates/main/admin/highAvailability.hbs +++ /dev/null @@ -1,51 +0,0 @@ -{{! -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -}} - -<div> - {{#if App.isHaEnabled}} - {{#if App.supports.autoRollbackHA}} - <p class="text-success"> - {{t admin.highAvailability.enabled}} - <a class="btn btn-padding btn-success" {{action disableHighAvailability target="controller"}}>{{t admin.highAvailability.button.disable}}</a> - </p> - {{else}} - <p class="text-success"> - {{t admin.highAvailability.enabled}} - </p> - {{/if}} - {{else}} - <p class="muted"> - {{t admin.highAvailability.disabled}} - </p> - <a class="btn btn-padding btn-success ha-btn" {{action enableHighAvailability target="controller"}}>{{t admin.highAvailability.button.enable}}</a> - {{/if}} - {{#if view.supportRMHA}} - <div class="rm-ha"> - {{#if App.isRMHaEnabled}} - <p class="text-success"> - {{t admin.rm_highAvailability.enabled}} - </p> - {{else}} - <p class="muted"> - {{t admin.rm_highAvailability.disabled}} - </p> - <a class="btn btn-padding btn-success ha-btn" {{action enableRMHighAvailability target="controller"}}>{{t admin.rm_highAvailability.button.enable}}</a> - {{/if}} - </div> - {{/if}} -</div> http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/views.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js index a1d1a4e..baaee39 100644 --- a/ambari-web/app/views.js +++ b/ambari-web/app/views.js @@ -65,7 +65,6 @@ require('views/main/host/metrics/network'); require('views/main/host/metrics/processes'); require('views/main/host/addHost/step4_view'); require('views/main/admin'); -require('views/main/admin/highAvailability_view'); require('views/main/admin/highAvailability/nameNode/wizard_view'); require('views/main/admin/highAvailability/progress_view'); require('views/main/admin/highAvailability/nameNode/rollback_view'); http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/views/main/admin.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin.js b/ambari-web/app/views/main/admin.js index 789a845..89c0d6d 100644 --- a/ambari-web/app/views/main/admin.js +++ b/ambari-web/app/views/main/admin.js @@ -40,13 +40,6 @@ App.MainAdminView = Em.View.extend({ label: Em.I18n.t('common.security') }); } - if (App.get('isHadoop2Stack') && App.supports.highAvailability) { - items.push({ - name: 'highAvailability', - url: 'adminHighAvailability', - label: Em.I18n.t('admin.highAvailability') - }); - } return items; }.property(''), http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/views/main/admin/highAvailability_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability_view.js b/ambari-web/app/views/main/admin/highAvailability_view.js deleted file mode 100644 index 2338f5a..0000000 --- a/ambari-web/app/views/main/admin/highAvailability_view.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var App = require('app'); - -App.MainAdminHighAvailabilityView = Em.View.extend({ - templateName: require('templates/main/admin/highAvailability'), - - supportRMHA: function () { - return App.get('isHadoop21Stack') && App.get('supports.resourceManagerHighAvailability'); - } -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/app/views/main/menu.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js index 888a806..ea4a2bd 100644 --- a/ambari-web/app/views/main/menu.js +++ b/ambari-web/app/views/main/menu.js @@ -154,13 +154,6 @@ App.MainMenuView = Em.CollectionView.extend({ label: Em.I18n.t('common.security') }); } - if (App.get('isHadoop2Stack') && App.supports.highAvailability) { - categories.push({ - name: 'highAvailability', - url: 'adminHighAvailability', - label: Em.I18n.t('admin.highAvailability') - }); - } } return categories; }.property('') http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js index 5547dfe..1cdb75d 100644 --- a/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js +++ b/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js @@ -158,7 +158,7 @@ describe('App.MainAdminHighAvailabilityController', function () { return 3; }); expect(controller.enableHighAvailability()).to.be.true; - expect(App.router.transitionTo.calledWith('main.admin.enableHighAvailability')).to.be.true; + expect(App.router.transitionTo.calledWith('main.services.enableHighAvailability')).to.be.true; expect(controller.showErrorPopup.calledOnce).to.be.false; App.router.get.restore(); controller.get.restore(); http://git-wip-us.apache.org/repos/asf/ambari/blob/85d181dd/ambari-web/test/controllers/main/service/reassign/step2_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/service/reassign/step2_controller_test.js b/ambari-web/test/controllers/main/service/reassign/step2_controller_test.js index 94eba0d..8b5d8d5 100644 --- a/ambari-web/test/controllers/main/service/reassign/step2_controller_test.js +++ b/ambari-web/test/controllers/main/service/reassign/step2_controller_test.js @@ -239,7 +239,7 @@ describe('App.ReassignMasterWizardStep2Controller', function () { }); }); - describe('#getIsSubmitDisabled', function () { + describe('#updateIsSubmitDisabled', function () { var hostComponents = []; var isSubmitDisabled = false; @@ -256,7 +256,7 @@ describe('App.ReassignMasterWizardStep2Controller', function () { controller._super.restore(); }); it('No host-components, reassigned equal 0', function () { - expect(controller.getIsSubmitDisabled()).to.be.true; + expect(controller.updateIsSubmitDisabled()).to.be.true; expect(controller.get('submitDisabled')).to.be.true; }); it('Reassign component match existed components, reassigned equal 0', function () { @@ -269,7 +269,7 @@ describe('App.ReassignMasterWizardStep2Controller', function () { selectedHost: 'host1' }]); - expect(controller.getIsSubmitDisabled()).to.be.true; + expect(controller.updateIsSubmitDisabled()).to.be.true; expect(controller.get('submitDisabled')).to.be.true; }); it('Reassign component do not match existed components, reassigned equal 1', function () { @@ -280,7 +280,7 @@ describe('App.ReassignMasterWizardStep2Controller', function () { })]; controller.set('servicesMasters', []); - expect(controller.getIsSubmitDisabled()).to.be.false; + expect(controller.updateIsSubmitDisabled()).to.be.false; expect(controller.get('submitDisabled')).to.be.false; }); it('Reassign component do not match existed components, reassigned equal 2', function () { @@ -297,14 +297,14 @@ describe('App.ReassignMasterWizardStep2Controller', function () { ]; controller.set('servicesMasters', []); - expect(controller.getIsSubmitDisabled()).to.be.true; + expect(controller.updateIsSubmitDisabled()).to.be.true; expect(controller.get('submitDisabled')).to.be.true; }); it('submitDisabled is already true', function () { isSubmitDisabled = true; - expect(controller.getIsSubmitDisabled()).to.be.true; + expect(controller.updateIsSubmitDisabled()).to.be.true; expect(controller.get('submitDisabled')).to.be.true; }); });
