Procházet zdrojové kódy

AMBARI-17407 Wizard in progress for other users after Move Wizard (akovalenko)

Aleksandr Kovalenko před 9 roky
rodič
revize
c7d145a19f
1 změnil soubory, kde provedl 4 přidání a 30 odebrání
  1. 4 30
      ambari-web/app/routes/reassign_master_routes.js

+ 4 - 30
ambari-web/app/routes/reassign_master_routes.js

@@ -57,8 +57,8 @@ module.exports = App.WizardRoute.extend({
                 var step4Controller = router.get('reassignMasterWizardStep4Controller');
                 var testDBTaskId = step4Controller.get('tasks').filterProperty('command', 'testDBConnection').get('firstObject.id');
 
-                if(currStep !== "7" 
-                   && testDBTaskId 
+                if(currStep !== "7"
+                   && testDBTaskId
                    && reassignMasterController.get('content.tasksStatuses').get(testDBTaskId) === "FAILED")
                 {
                   App.showConfirmationPopup(function () {
@@ -224,19 +224,7 @@ module.exports = App.WizardRoute.extend({
       var controller = router.get('reassignMasterController');
       var reassignMasterWizardStep4 = router.get('reassignMasterWizardStep4Controller');
       if (!reassignMasterWizardStep4.get('isSubmitDisabled')) {
-        controller.finish();
-        controller.get('popup').hide();
-        App.clusterStatus.setClusterStatus({
-          clusterName: router.get('reassignMasterController.content.cluster.name'),
-          clusterState: 'DEFAULT',
-          localdb: App.db.data
-        }, {alwaysCallback: function () {
-          controller.get('popup').hide();
-          router.transitionTo('main.index');
-          Em.run.next(function() {
-            location.reload();
-          });
-        }});
+        controller.resetOnClose(controller, 'main.index');
       }
     },
 
@@ -328,21 +316,7 @@ module.exports = App.WizardRoute.extend({
       var controller = router.get('reassignMasterController');
       var reassignMasterWizardStep7 = router.get('reassignMasterWizardStep7Controller');
       if (!reassignMasterWizardStep7.get('isSubmitDisabled')) {
-        controller.finish();
-        controller.get('popup').hide();
-        App.clusterStatus.setClusterStatus({
-          clusterName: router.get('reassignMasterController.content.cluster.name'),
-          clusterState: 'DEFAULT',
-          localdb: App.db.data
-        }, {
-          alwaysCallback: function () {
-            controller.get('popup').hide();
-            router.transitionTo('main.index');
-            Em.run.next(function() {
-              location.reload();
-            });
-          }
-        });
+        controller.resetOnClose(controller, 'main.index');
       }
     },