Repository: ambari Updated Branches: refs/heads/trunk 277f770a6 -> eaf9a2779
AMBARI-11932. clicking back to go to confirm hosts leads to re-installation (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/eaf9a277 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/eaf9a277 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/eaf9a277 Branch: refs/heads/trunk Commit: eaf9a277910f67420c2622af96192802cc7a8091 Parents: 277f770 Author: Alex Antonenko <[email protected]> Authored: Mon Jun 15 19:49:45 2015 +0300 Committer: Alex Antonenko <[email protected]> Committed: Mon Jun 15 19:49:45 2015 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/wizard.js | 2 ++ .../app/controllers/wizard/step3_controller.js | 17 +++++++++++++---- ambari-web/app/routes/installer.js | 2 -- 3 files changed, 15 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/eaf9a277/ambari-web/app/controllers/wizard.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js index 6693ff7..01d9ec8 100644 --- a/ambari-web/app/controllers/wizard.js +++ b/ambari-web/app/controllers/wizard.js @@ -24,6 +24,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM isStepDisabled: null, + previousStep: 0, /** * map of actions which load data required by which step * used by <code>loadAllPriorSteps</code> @@ -146,6 +147,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM * @param completed */ setCurrentStep: function (currentStep, completed) { + this.set('previousStep', this.get('currentStep')); App.db.setWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10), currentStep, completed); this.set('currentStep', currentStep); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/eaf9a277/ambari-web/app/controllers/wizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js index 52c52ac..1592f28 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -265,10 +265,19 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, { */ loadStep: function () { console.log("TRACE: Loading step3: Confirm Hosts"); - this.disablePreviousSteps(); - this.clearStep(); - App.router.get('clusterController').loadAmbariProperties(); - this.loadHosts(); + var wizardController = this.get('wizardController'); + var previousStep = wizardController && wizardController.get('previousStep'); + var currentStep = wizardController && wizardController.get('currentStep'); + var isHostsLoaded = this.get('hosts').length !== 0; + var isPrevAndCurrStepsSetted = previousStep && currentStep; + var isPrevStepSmallerThenCurrent = previousStep < currentStep; + if (!isHostsLoaded || isPrevStepSmallerThenCurrent || + !wizardController || !isPrevAndCurrStepsSetted) { + this.disablePreviousSteps(); + this.clearStep(); + App.router.get('clusterController').loadAmbariProperties(); + this.loadHosts(); + } }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/eaf9a277/ambari-web/app/routes/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js index 3cd0d68..4a3b26d 100644 --- a/ambari-web/app/routes/installer.js +++ b/ambari-web/app/routes/installer.js @@ -217,7 +217,6 @@ module.exports = Em.Route.extend(App.RouterRedirections, { var wizardStep4Controller = router.get('wizardStep4Controller'); controller.saveServices(wizardStep4Controller); controller.saveClients(wizardStep4Controller); - router.get('wizardStep5Controller').clearRecommendations(); // Force reload recommendation between steps 4 and 5 controller.setDBProperty('recommendations', undefined); controller.setDBProperty('masterComponentHosts', undefined); @@ -417,7 +416,6 @@ module.exports = Em.Route.extend(App.RouterRedirections, { var installerController = router.get('installerController'); var wizardStep9Controller = router.get('wizardStep9Controller'); installerController.saveInstalledHosts(wizardStep9Controller); - installerController.saveClusterState('CLUSTER_INSTALLED_4'); router.transitionTo('step10'); }
