ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-9327 Kerberos Wizard: Previous steps are enabled in navigation menu for some pages after page refresh.. (ababiichuk)
Date Mon, 26 Jan 2015 10:58:43 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 736511f00 -> 257c2cf62


AMBARI-9327 Kerberos Wizard: Previous steps are enabled in navigation menu for some pages
after page refresh..  (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/257c2cf6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/257c2cf6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/257c2cf6

Branch: refs/heads/trunk
Commit: 257c2cf62188e185f43042e6233ebb8a84f30619
Parents: 736511f
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Mon Jan 26 12:34:25 2015 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Mon Jan 26 12:35:25 2015 +0200

----------------------------------------------------------------------
 .../main/admin/kerberos/wizard_controller.js    | 21 ++++++++++++++-----
 ambari-web/app/routes/add_kerberos_routes.js    | 22 ++++++++++----------
 2 files changed, 27 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/257c2cf6/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
index 18d5a03..b66049d 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
@@ -48,7 +48,7 @@ App.KerberosWizardController = App.WizardController.extend({
 
   setCurrentStep: function (currentStep, completed) {
     this._super(currentStep, completed);
-    if (App.testMode) {
+    if (App.get('testMode')) {
       return;
     }
     App.clusterStatus.setClusterStatus({
@@ -59,12 +59,23 @@ App.KerberosWizardController = App.WizardController.extend({
     });
   },
 
+  setStepsEnable: function () {
+    for (var i = 1; i <= this.get('totalSteps'); i++) {
+      var step = this.get('isStepDisabled').findProperty('step', i);
+      if (i <= this.get('currentStep') && App.get('router.clusterController.isLoaded'))
{
+        step.set('value', false);
+      } else {
+        step.set('value', i != this.get('currentStep'));
+      }
+    }
+  }.observes('currentStep', 'App.router.clusterController.isLoaded'),
+
   /**
    * return new object extended from clusterStatusTemplate
    * @return Object
    */
   getCluster: function () {
-    return jQuery.extend({}, this.get('clusterStatusTemplate'), {name: App.router.getClusterName()});
+    return jQuery.extend({}, this.get('clusterStatusTemplate'), {name: App.get('router').getClusterName()});
   },
 
   /**
@@ -76,7 +87,7 @@ App.KerberosWizardController = App.WizardController.extend({
     var self = this;
     var siteName = 'cluster-env';
     var tags = [{siteName: siteName}];
-    App.router.get('configurationController').getConfigsByTags(tags).done(function (data)
{
+    App.get('router.configurationController').getConfigsByTags(tags).done(function (data)
{
       var properties = self.updateClusterEnvData(data[0].properties);
       var clusterConfig = {"type": siteName, "tag": 'version' + (new Date).getTime(), "properties":
properties};
       var clusterConfigData = {
@@ -214,7 +225,7 @@ App.KerberosWizardController = App.WizardController.extend({
       {
         type: 'sync',
         callback: function () {
-          var kerberosStep2controller = App.router.get('kerberosWizardStep2Controller');
+          var kerberosStep2controller = App.get('router.kerberosWizardStep2Controller');
           this.loadAdvancedConfigs(kerberosStep2controller);
           this.loadServiceConfigProperties();
           this.load('hosts');
@@ -281,6 +292,6 @@ App.KerberosWizardController = App.WizardController.extend({
     this.setCurrentStep('1');
     // kerberos wizard namespace in the localStorage should be emptied
     this.resetDbNamespace();
-    App.router.get('updateController').updateAll();
+    App.get('router.updateController').updateAll();
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/257c2cf6/ambari-web/app/routes/add_kerberos_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_kerberos_routes.js b/ambari-web/app/routes/add_kerberos_routes.js
index 28fce57..0e59931 100644
--- a/ambari-web/app/routes/add_kerberos_routes.js
+++ b/ambari-web/app/routes/add_kerberos_routes.js
@@ -65,9 +65,9 @@ module.exports = App.WizardRoute.extend({
           var controller = App.router.get('kerberosWizardController');
           controller.clearTasksData();
           controller.finish();
-          App.router.get('updateController').set('isWorking', true);
+          App.get('router.updateController').set('isWorking', true);
           if (App.get('testMode')) {
-            App.router.transitionTo('adminKerberos.index');
+            App.get('router').transitionTo('adminKerberos.index');
             location.reload();
           }
           App.clusterStatus.setClusterStatus({
@@ -77,7 +77,7 @@ module.exports = App.WizardRoute.extend({
           }, {
             alwaysCallback: function () {
               self.hide();
-              App.router.transitionTo('adminKerberos.index');
+              App.get('router').transitionTo('adminKerberos.index');
             }
           });
         }
@@ -85,7 +85,7 @@ module.exports = App.WizardRoute.extend({
       kerberosWizardController.set('popup', popup);
       var currentClusterStatus = App.clusterStatus.get('value');
       if (currentClusterStatus) {
-        if (App.testMode) {
+        if (App.get('testMode')) {
           kerberosWizardController.setCurrentStep(App.db.data.KerberosWizard.currentStep);
         } else {
           switch (currentClusterStatus.clusterState) {
@@ -93,7 +93,7 @@ module.exports = App.WizardRoute.extend({
               kerberosWizardController.setCurrentStep(currentClusterStatus.localdb.KerberosWizard.currentStep);
               break;
             default:
-              var currStep = App.router.get('kerberosWizardController.currentStep');
+              var currStep = App.get('router.kerberosWizardController.currentStep');
               kerberosWizardController.setCurrentStep(currStep);
               break;
           }
@@ -232,8 +232,8 @@ module.exports = App.WizardRoute.extend({
     connectOutlets: function (router) {
       console.log('in kerberosWizardController.step5:connectOutlets');
       var controller = router.get('kerberosWizardController');
-      controller.setLowerStepsDisable(5);
       controller.dataLoading().done(function () {
+        controller.setLowerStepsDisable(5);
         controller.loadAllPriorSteps();
         controller.connectOutlet('kerberosWizardStep5', controller.get('content'));
       });
@@ -257,8 +257,8 @@ module.exports = App.WizardRoute.extend({
       console.log('in kerberosWizardController.step6:connectOutlets');
       var controller = router.get('kerberosWizardController');
       var stepController = router.get('kerberosWizardStep6Controller');
-      controller.setLowerStepsDisable(6);
       controller.dataLoading().done(function () {
+        controller.setLowerStepsDisable(6);
         controller.loadAllPriorSteps();
         controller.getClusterEnvData().done(function (clusterEnvdata) {
           var kerberosDescriptor = controller.get('kerberosDescriptorConfigs');
@@ -270,7 +270,7 @@ module.exports = App.WizardRoute.extend({
       });
     },
     retry: function () {
-      var router = App.router;
+      var router = App.get('router');
       var controller = router.get('kerberosWizardController');
       controller.getClusterEnvData().done(function (data) {
         var stepController = router.get('kerberosWizardStep6Controller');
@@ -296,8 +296,8 @@ module.exports = App.WizardRoute.extend({
     connectOutlets: function (router) {
       console.log('in kerberosWizardController.step7:connectOutlets');
       var controller = router.get('kerberosWizardController');
-      controller.setLowerStepsDisable(7);
       controller.dataLoading().done(function () {
+        controller.setLowerStepsDisable(7);
         controller.loadAllPriorSteps();
         controller.connectOutlet('kerberosWizardStep7', controller.get('content'));
       });
@@ -310,13 +310,13 @@ module.exports = App.WizardRoute.extend({
       var controller = router.get('kerberosWizardController');
       controller.finish();
       App.clusterStatus.setClusterStatus({
-        clusterName: App.router.getClusterName(),
+        clusterName: App.get('router').getClusterName(),
         clusterState: 'DEFAULT',
         localdb: App.db.data
       }, {
         alwaysCallback: function () {
           controller.get('popup').hide();
-          App.router.transitionTo('adminKerberos.index');
+          App.get('router').transitionTo('adminKerberos.index');
         }
       });
 


Mime
View raw message