Просмотр исходного кода

AMBARI-12354. Check that all wizards correctly save their statuses on close (onechiporenko)

Oleg Nechiporenko 10 лет назад
Родитель
Сommit
c952878e28

+ 13 - 0
ambari-web/app/controllers/application.js

@@ -49,6 +49,19 @@ App.ApplicationController = Em.Controller.extend(App.UserPref, {
     return App.router.get('clusterInstallCompleted') && this.get('isClusterDataLoaded');
   }.property('App.router.clusterInstallCompleted', 'isClusterDataLoaded'),
 
+  /**
+   * Determines if "Exit" menu-item should be shown
+   * It should if cluster isn't installed
+   * If cluster is installer, <code>isClusterDataLoaded</code> is checked
+   * @type {boolean}
+   */
+  showExitLink: function () {
+    if (App.router.get('clusterInstallCompleted')) {
+      return this.get('isClusterDataLoaded');
+    }
+    return true;
+  }.property('App.router.clusterInstallCompleted', 'isClusterDataLoaded'),
+
   init: function(){
     this._super();
   },

+ 0 - 1
ambari-web/app/controllers/main/alerts/add_alert_definition/add_alert_definition_controller.js

@@ -45,7 +45,6 @@ App.AddAlertDefinitionController = App.WizardController.extend({
 
   finish: function() {
     this.clear();
-    this.setCurrentStep('1');
   }
 
 });

+ 0 - 1
ambari-web/app/controllers/main/service/reassign_controller.js

@@ -352,7 +352,6 @@ App.ReassignMasterController = App.WizardController.extend({
    * Clear all temporary data
    */
   finish: function () {
-    this.setCurrentStep('1');
     this.clearAllSteps();
     this.clearStorageData();
     this.resetDbNamespace();

+ 1 - 1
ambari-web/app/templates/application.hbs

@@ -81,7 +81,7 @@
                     <li><a href="" {{action showSettingsPopup target="controller"}}>{{t app.settings}}</a></li>
                   {{/isAccessible}}
                 {{/if}}
-                {{#if isClusterDataLoaded}}
+                {{#if showExitLink}}
                   <li class="break"></li>
                   <li><a href="" id="sign-out" {{action logoff}}>{{t app.signout}}</a></li>
                 {{/if}}