Bladeren bron

AMBARI-12311. Add Host Wizard appears on every login and cannot get it to go away (onechiporenko)

Oleg Nechiporenko 10 jaren geleden
bovenliggende
commit
29ca92f7ab

+ 0 - 1
ambari-web/app/controllers/main/host/add_controller.js

@@ -391,7 +391,6 @@ App.AddHostController = App.WizardController.extend({
    * Clear all temporary data
    */
   finish: function () {
-    this.setCurrentStep('1');
     this.clearAllSteps();
     this.clearStorageData();
     App.router.get('updateController').updateAll();

+ 7 - 1
ambari-web/app/routes/add_host_routes.js

@@ -29,7 +29,13 @@ module.exports = App.WizardRoute.extend({
       clusterName: App.router.get('content.cluster.name'),
       clusterState: 'DEFAULT',
       localdb: App.db.data
-    }, {alwaysCallback: function() {context.hide();App.router.transitionTo('hosts.index');location.reload();}});
+    }, {
+      alwaysCallback: function() {
+        context.hide();
+        App.router.transitionTo('hosts.index');
+        location.reload();
+      }
+    });
   },
 
   enter: function (router) {

+ 4 - 2
ambari-web/app/templates/application.hbs

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

+ 0 - 3
ambari-web/test/controllers/main/host/add_controller_test.js

@@ -1282,7 +1282,6 @@ describe('App.AddHostController', function () {
       getAllHostNames: Em.K
     };
     beforeEach(function () {
-      sinon.stub(controller, 'setCurrentStep', Em.K);
       sinon.stub(controller, 'clearAllSteps', Em.K);
       sinon.stub(controller, 'clearStorageData', Em.K);
       sinon.stub(App.updater, 'immediateRun', Em.K);
@@ -1291,7 +1290,6 @@ describe('App.AddHostController', function () {
       sinon.spy(mock, 'getAllHostNames');
     });
     afterEach(function () {
-      controller.setCurrentStep.restore();
       controller.clearAllSteps.restore();
       controller.clearStorageData.restore();
       App.updater.immediateRun.restore();
@@ -1301,7 +1299,6 @@ describe('App.AddHostController', function () {
     });
     it("", function () {
       controller.finish();
-      expect(controller.setCurrentStep.calledWith('1')).to.be.true;
       expect(controller.clearAllSteps.calledOnce).to.be.true;
       expect(controller.clearStorageData.calledOnce).to.be.true;
       expect(mock.updateAll.calledOnce).to.be.true;