Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F246A11250 for ; Mon, 4 Aug 2014 20:55:00 +0000 (UTC) Received: (qmail 59054 invoked by uid 500); 4 Aug 2014 20:55:00 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 59031 invoked by uid 500); 4 Aug 2014 20:55:00 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 59012 invoked by uid 99); 4 Aug 2014 20:55:00 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2014 20:55:00 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7E67A91F7DF; Mon, 4 Aug 2014 20:55:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaimin@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-6738. Add hosts / Enable HA / Enable Security wizards appears instead dashboard after re-login. (jaimin) Date: Mon, 4 Aug 2014 20:55:00 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk a431c7588 -> f67cd91db AMBARI-6738. Add hosts / Enable HA / Enable Security wizards appears instead dashboard after re-login. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f67cd91d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f67cd91d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f67cd91d Branch: refs/heads/trunk Commit: f67cd91db8e392d42d8234aba0b8fa2884a57282 Parents: a431c75 Author: Jaimin Jetly Authored: Mon Aug 4 13:54:42 2014 -0700 Committer: Jaimin Jetly Committed: Mon Aug 4 13:54:42 2014 -0700 ---------------------------------------------------------------------- .../stacks/HDP/1.3/services/HUE/metainfo.xml | 41 -------------------- .../nameNode/wizard_controller.js | 2 +- .../resourceManager/wizard_controller.js | 3 +- .../security/add/addSecurity_controller.js | 7 ++++ .../app/controllers/main/host/add_controller.js | 20 +--------- .../controllers/main/service/add_controller.js | 2 +- .../main/service/reassign_controller.js | 1 + ambari-web/app/mixins/common/localStorage.js | 9 +++++ ambari-web/app/routes/add_host_routes.js | 17 ++++---- ambari-web/app/routes/add_security.js | 9 +++-- ambari-web/app/routes/add_service_routes.js | 9 ++--- .../app/routes/high_availability_routes.js | 16 +++----- ambari-web/app/routes/main.js | 1 + ambari-web/app/routes/reassign_master_routes.js | 38 ++++++++---------- .../app/routes/rm_high_availability_routes.js | 27 +++++++------ 15 files changed, 75 insertions(+), 127 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-server/src/main/resources/stacks/HDP/1.3/services/HUE/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3/services/HUE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/1.3/services/HUE/metainfo.xml deleted file mode 100644 index de0552d..0000000 --- a/ambari-server/src/main/resources/stacks/HDP/1.3/services/HUE/metainfo.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - 2.0 - - - HUE - Hue is a graphical user interface to operate and develop - applications for Apache Hadoop. - 2.2.0.1.3 - - - - HUE_SERVER - MASTER - 1 - - - - - global - hue-site - - - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js index f876c4f..dd14232 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js @@ -250,8 +250,8 @@ App.HighAvailabilityWizardController = App.WizardController.extend({ * Clear all temporary data */ finish: function () { - App.db.data.HighAvailabilityWizard = {}; App.db.data.Installer = {}; + this.resetDbNamespace(); App.router.get('updateController').updateAll(); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js index 89d64e8..7c94cbd 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js @@ -139,8 +139,7 @@ App.RMHighAvailabilityWizardController = App.WizardController.extend({ * Clear all temporary data */ finish: function () { - this.setCurrentStep(1); - App.db.data.RMHighAvailabilityWizard = {}; + this.resetDbNamespace(); App.router.get('updateController').updateAll(); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js b/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js index b7f5cb7..697c434 100644 --- a/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js +++ b/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js @@ -143,6 +143,13 @@ App.AddSecurityController = App.WizardController.extend({ */ loadServiceConfigs: function () { this.set('content.serviceConfigProperties', App.db.getSecureConfigProperties()); + }, + + /** + * Clear all local storage data for Add security wizard namespace + */ + finish: function () { + this.resetDbNamespace(); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/controllers/main/host/add_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/host/add_controller.js b/ambari-web/app/controllers/main/host/add_controller.js index 25e79e0..d371e24 100644 --- a/ambari-web/app/controllers/main/host/add_controller.js +++ b/ambari-web/app/controllers/main/host/add_controller.js @@ -367,23 +367,7 @@ App.AddHostController = App.WizardController.extend({ clearStorageData: function () { this._super(); - App.db.cleanAddHost(); - }, - - /** - * save the local db data stored on the server as value to the key api/v1/persist/CLUSTER_CURRENT_STATUS - */ - saveClusterState: function () { - App.clusterStatus.setClusterStatus({ - clusterName: App.router.getClusterName(), - clusterState: 'DEFAULT' - }); - }, - - clearData: function () { - // Clear Add Host namespace in Browser Local storage and save it to server persist data - this.clearStorageData(); - this.saveClusterState(); + this.resetDbNamespace(); }, /** @@ -392,7 +376,7 @@ App.AddHostController = App.WizardController.extend({ finish: function () { this.setCurrentStep('1'); this.clearAllSteps(); - this.clearData(); + this.clearStorageData(); App.router.get('updateController').updateAll(); App.updater.immediateRun('updateHost'); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/controllers/main/service/add_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/add_controller.js b/ambari-web/app/controllers/main/service/add_controller.js index 6c4728f..e349882 100644 --- a/ambari-web/app/controllers/main/service/add_controller.js +++ b/ambari-web/app/controllers/main/service/add_controller.js @@ -363,9 +363,9 @@ App.AddServiceController = App.WizardController.extend({ * Clear all temporary data */ finish: function () { - this.setCurrentStep('1'); this.clearAllSteps(); this.clearStorageData(); + this.resetDbNamespace(); App.router.get('updateController').updateAll(); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/controllers/main/service/reassign_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js index 870b281..c71cecb 100644 --- a/ambari-web/app/controllers/main/service/reassign_controller.js +++ b/ambari-web/app/controllers/main/service/reassign_controller.js @@ -306,6 +306,7 @@ App.ReassignMasterController = App.WizardController.extend({ this.setCurrentStep('1'); this.clearAllSteps(); this.clearStorageData(); + this.resetDbNamespace(); App.router.get('updateController').updateAll(); } http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/mixins/common/localStorage.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/common/localStorage.js b/ambari-web/app/mixins/common/localStorage.js index 9e5dda8..5cd9484 100644 --- a/ambari-web/app/mixins/common/localStorage.js +++ b/ambari-web/app/mixins/common/localStorage.js @@ -53,6 +53,15 @@ App.LocalStorage = Em.Mixin.create({ */ setDBProperty: function(key, value){ App.db.set(this.get('dbNamespace'), key, value); + }, + + /** + * Delete the dbNamespace from the localStorage + * Usually this function is called on quiting/completing the wizard + */ + resetDbNamespace: function() { + App.db.data[this.get('dbNamespace')] = {}; + localStorage.setObject('ambari', App.db.data); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/routes/add_host_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_host_routes.js b/ambari-web/app/routes/add_host_routes.js index fb3d951..bec3867 100644 --- a/ambari-web/app/routes/add_host_routes.js +++ b/ambari-web/app/routes/add_host_routes.js @@ -21,11 +21,15 @@ var App = require('app'); module.exports = App.WizardRoute.extend({ route: '/host/add', - clearData: function (router) { + leaveWizard: function (router,context) { var addHostController = router.get('addHostController'); App.router.get('updateController').set('isWorking', true); addHostController.finish(); - router.transitionTo('hosts.index'); + App.clusterStatus.setClusterStatus({ + clusterName: App.router.get('content.cluster.name'), + clusterState: 'DEFAULT', + localdb: App.db.data + }, {alwaysCallback: function() {context.hide();App.router.transitionTo('hosts.index');location.reload();}}); }, enter: function (router) { @@ -52,19 +56,17 @@ module.exports = App.WizardRoute.extend({ router.transitionTo('hosts.index'); }, onClose: function() { + var popupContext = this; if (addHostController.get('currentStep') == '6') { App.ModalPopup.show({ header: Em.I18n.t('hosts.add.exit.header'), body: Em.I18n.t('hosts.add.exit.body'), onPrimary: function () { - this.hide(); - self.clearData(router); - location.reload(); + self.leaveWizard(router,popupContext); } }); } else { - this.hide(); - self.clearData(router); + self.leaveWizard(router,this); } }, didInsertElement: function(){ @@ -346,7 +348,6 @@ module.exports = App.WizardRoute.extend({ }); router.get('updateController').updateAll(); $(context.currentTarget).parents("#modal").find(".close").trigger('click'); - location.reload(); } }), http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/routes/add_security.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_security.js b/ambari-web/app/routes/add_security.js index 1b1599d..099b752 100644 --- a/ambari-web/app/routes/add_security.js +++ b/ambari-web/app/routes/add_security.js @@ -73,18 +73,19 @@ module.exports = App.WizardRoute.extend({ self.proceedOnClose(); }, proceedOnClose: function () { - this.hide(); + var self = this; router.get('mainAdminSecurityAddStep4Controller').clearStep(); router.get('addSecurityController.content.services').clear(); router.set('addSecurityController.content.serviceConfigProperties', null); App.router.get('updateController').set('isWorking', true); mainAdminSecurityController.setAddSecurityWizardStatus(null); App.db.setSecurityDeployCommands(undefined); - router.get('addSecurityController').setCurrentStep(1); + addSecurityController.finish(); App.clusterStatus.setClusterStatus({ clusterName: router.get('content.cluster.name'), - clusterState: 'DEFAULT' - },{alwaysCallback: function() {router.transitionTo('adminSecurity.index');location.reload();}}); + clusterState: 'DEFAULT', + localdb: App.db.data + },{alwaysCallback: function() {self.hide();router.transitionTo('adminSecurity.index');location.reload();}}); }, didInsertElement: function () { this.fitHeight(); http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/routes/add_service_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js index e1f0c96..4900af1 100644 --- a/ambari-web/app/routes/add_service_routes.js +++ b/ambari-web/app/routes/add_service_routes.js @@ -48,11 +48,11 @@ module.exports = App.WizardRoute.extend({ App.router.get('updateController').updateServices(function(){ App.router.get('updateController').updateServiceMetric(); }); + addServiceController.finish(); + // We need to do recovery based on whether we are in Add Host or Installer wizard App.clusterStatus.setClusterStatus({ clusterName: App.router.get('content.cluster.name'), - clusterState: 'DEFAULT', - wizardControllerName: App.router.get('addServiceController.name'), - localdb: App.db.data + clusterState: 'DEFAULT' }, {alwaysCallback: function() {self.hide();App.router.transitionTo('main.services.index');location.reload();}}); }, @@ -324,9 +324,6 @@ module.exports = App.WizardRoute.extend({ complete: function (router, context) { var addServiceController = router.get('addServiceController'); addServiceController.get('popup').onClose(); - addServiceController.finish(); - // We need to do recovery based on whether we are in Add Host or Installer wizard - addServiceController.saveClusterState('DEFAULT'); } }), http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/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 d3d2827..92a56fa 100644 --- a/ambari-web/app/routes/high_availability_routes.js +++ b/ambari-web/app/routes/high_availability_routes.js @@ -52,6 +52,7 @@ module.exports = App.WizardRoute.extend({ }.observes('App.router.highAvailabilityWizardController.currentStep'), onClose: function () { + var self = this; var currStep = App.router.get('highAvailabilityWizardController.currentStep'); var highAvailabilityProgressPageController = App.router.get('highAvailabilityProgressPageController'); @@ -63,21 +64,17 @@ module.exports = App.WizardRoute.extend({ App.router.get('highAvailabilityWizardController').setCurrentStep('1'); App.router.transitionTo('rollbackHighAvailability'); } - }else { + } else { var controller = App.router.get('highAvailabilityWizardController'); - controller.clearStorageData(); - controller.setCurrentStep('1'); + controller.clearTasksData(); + controller.finish(); App.router.get('updateController').set('isWorking', true); App.clusterStatus.setClusterStatus({ - clusterName: App.router.get('content.cluster.name'), + clusterName: controller.get('content.cluster.name'), clusterState: 'DEFAULT', - wizardControllerName: App.router.get('highAvailabilityWizardController.name'), localdb: App.db.data - }); - this.hide(); - App.router.transitionTo('main.admin.adminHighAvailability'); + },{alwaysCallback: function() {self.hide();App.router.transitionTo('main.admin.adminHighAvailability');location.reload();}}); } - }, didInsertElement: function () { this.fitHeight(); @@ -314,7 +311,6 @@ module.exports = App.WizardRoute.extend({ App.clusterStatus.setClusterStatus({ clusterName: controller.get('content.cluster.name'), clusterState: 'DEFAULT', - wizardControllerName: 'highAvailabilityWizardController', localdb: App.db.data },{alwaysCallback: function() {controller.get('popup').hide();router.transitionTo('main.index');location.reload();}}); } http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/routes/main.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index b383c9a..89c2388 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -560,6 +560,7 @@ module.exports = Em.Route.extend({ App.db.setSecurityDeployCommands(undefined); App.router.get('updateController').set('isWorking', true); router.get('mainAdminSecurityController').setDisableSecurityStatus(undefined); + router.get('addServiceController').finish(); App.clusterStatus.setClusterStatus({ clusterName: router.get('content.cluster.name'), clusterState: 'DEFAULT' http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/ambari-web/app/routes/reassign_master_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/reassign_master_routes.js b/ambari-web/app/routes/reassign_master_routes.js index 26ee6c1..85f91aa 100644 --- a/ambari-web/app/routes/reassign_master_routes.js +++ b/ambari-web/app/routes/reassign_master_routes.js @@ -21,8 +21,20 @@ var App = require('app'); module.exports = App.WizardRoute.extend({ route: '/service/reassign', + leaveWizard: function (router,context) { + var reassignMasterController = router.get('reassignMasterController'); + App.router.get('updateController').set('isWorking', true); + reassignMasterController.finish(); + App.clusterStatus.setClusterStatus({ + clusterName: App.router.get('content.cluster.name'), + clusterState: 'DEFAULT', + localdb: App.db.data + }, {alwaysCallback: function() {context.hide(); router.transitionTo('main.index');location.reload();}}); + }, + enter: function (router) { console.log('in /service/reassign:enter'); + var context = this; Em.run.next(function () { var reassignMasterController = router.get('reassignMasterController'); App.router.get('updateController').set('isWorking', false); @@ -48,23 +60,11 @@ module.exports = App.WizardRoute.extend({ if (parseInt(currStep) > 3) { var self = this; App.showConfirmationPopup(function(){ - self.hide(); - reassignMasterController.setCurrentStep('1'); router.get('reassignMasterWizardStep' + currStep + 'Controller').removeObserver('tasks.@each.status', this, 'onTaskStatusChange'); - App.clusterStatus.setClusterStatus({ - clusterName: router.get('reassignMasterController.content.cluster.name'), - clusterState: 'DEFAULT', - wizardControllerName: 'reassignMasterController', - localdb: App.db.data - }); - router.get('updateController').set('isWorking', true); - router.transitionTo('main.services.index') + context.leaveWizard(router,self); }, Em.I18n.t('services.reassign.closePopup').format(reassignMasterController.get('content.reassign.display_name'))); } else { - this.hide(); - reassignMasterController.setCurrentStep('1'); - router.get('updateController').set('isWorking', true); - router.transitionTo('main.services.index') + context.leaveWizard(router,this); } }, didInsertElement: function () { @@ -208,11 +208,8 @@ module.exports = App.WizardRoute.extend({ App.clusterStatus.setClusterStatus({ clusterName: router.get('reassignMasterController.content.cluster.name'), clusterState: 'DEFAULT', - wizardControllerName: 'reassignMasterController', localdb: App.db.data - }); - router.transitionTo('main.index'); - location.reload(); + },{alwaysCallback: function() {controller.get('popup').hide();router.transitionTo('main.index');location.reload();}}); } }, @@ -272,11 +269,8 @@ module.exports = App.WizardRoute.extend({ App.clusterStatus.setClusterStatus({ clusterName: router.get('reassignMasterController.content.cluster.name'), clusterState: 'DEFAULT', - wizardControllerName: 'reassignMasterController', localdb: App.db.data - }); - router.transitionTo('main.index'); - location.reload(); + },{alwaysCallback: function() {controller.get('popup').hide();router.transitionTo('main.index');location.reload();}}); } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/f67cd91d/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 dcc7c8d..167656a 100644 --- a/ambari-web/app/routes/rm_high_availability_routes.js +++ b/ambari-web/app/routes/rm_high_availability_routes.js @@ -42,17 +42,16 @@ module.exports = App.WizardRoute.extend({ if (parseInt(currStep) === 4) { var self = this; App.showConfirmationPopup(function () { - self.hide(); - rMHighAvailabilityWizardController.setCurrentStep('1'); + router.get('updateController').set('isWorking', true); App.clusterStatus.setClusterStatus({ clusterName: App.router.getClusterName(), clusterState: 'DEFAULT', - wizardControllerName: rMHighAvailabilityWizardController.get('name'), localdb: App.db.data - }); - router.get('updateController').set('isWorking', true); - router.transitionTo('main.admin.adminHighAvailability.index'); - location.reload(); + }, {alwaysCallback: function () { + self.hide(); + router.transitionTo('main.admin.adminHighAvailability.index'); + location.reload(); + }}); }, Em.I18n.t('admin.rm_highAvailability.closePopup')); } else { this.hide(); @@ -136,7 +135,7 @@ module.exports = App.WizardRoute.extend({ controller.setCurrentStep('3'); controller.dataLoading().done(function () { controller.loadAllPriorSteps(); - controller.connectOutlet('rMHighAvailabilityWizardStep3', controller.get('content')); + controller.connectOutlet('rMHighAvailabilityWizardStep3', controller.get('content')); }) }, unroutePath: function () { @@ -160,7 +159,7 @@ module.exports = App.WizardRoute.extend({ controller.setLowerStepsDisable(4); controller.dataLoading().done(function () { controller.loadAllPriorSteps(); - controller.connectOutlet('rMHighAvailabilityWizardStep4', controller.get('content')); + controller.connectOutlet('rMHighAvailabilityWizardStep4', controller.get('content')); }) }, unroutePath: function () { @@ -169,15 +168,15 @@ module.exports = App.WizardRoute.extend({ next: function (router) { var controller = router.get('rMHighAvailabilityWizardController'); controller.finish(); - controller.get('popup').hide(); App.clusterStatus.setClusterStatus({ clusterName: controller.get('content.cluster.name'), clusterState: 'DEFAULT', - wizardControllerName: 'rMHighAvailabilityWizardController', localdb: App.db.data - }); - router.transitionTo('main.admin.adminHighAvailability.index'); - location.reload(); + }, {alwaysCallback: function () { + controller.get('popup').hide(); + router.transitionTo('main.admin.adminHighAvailability.index'); + location.reload(); + }}); } }),