Преглед на файлове

AMBARI-13025 Switching config versions results in 'Restart Required' message showing up with delay. (atkach)

Andrii Tkach преди 10 години
родител
ревизия
45c172f3b5

+ 5 - 5
ambari-web/app/controllers/global/cluster_controller.js

@@ -221,6 +221,11 @@ App.ClusterController = Em.Controller.extend({
       self.updateLoadStatus('stackComponents');
       updater.updateServices(function () {
         self.updateLoadStatus('services');
+
+        //hosts should be loaded after services in order to properly populate host-component relation in App.cache.services
+        updater.updateHost(function () {
+          self.set('isHostsLoaded', true);
+        });
         App.config.loadConfigsFromStack(App.Service.find().mapProperty('serviceName')).complete(function () {
           App.config.loadClusterConfigsFromStack().complete(function () {
             self.set('isConfigsPropertiesLoaded', true);
@@ -245,11 +250,6 @@ App.ClusterController = Em.Controller.extend({
     //force clear filters  for hosts page to load all data
     App.db.setFilterConditions('mainHostController', null);
 
-    // hosts loading doesn't affect overall progress
-    updater.updateHost(function () {
-      self.set('isHostsLoaded', true);
-    });
-
     // alerts loading doesn't affect overall progress
     console.time('Overall alerts loading time');
     updater.updateAlertGroups(function () {

+ 2 - 1
ambari-web/app/views/common/configs/config_history_flow.js

@@ -432,7 +432,8 @@ App.ConfigHistoryFlowView = Em.View.extend({
   sendRevertCallSuccess: function (data, opt, params) {
     // revert to an old version would generate a new version with latest version number,
     // so, need to loadStep to update
-     this.get('controller').loadStep();
+    App.router.get('updateController').updateComponentConfig(Em.K);
+    this.get('controller').loadStep();
   },
 
   /**

+ 9 - 2
ambari-web/test/views/common/configs/config_history_flow_test.js

@@ -569,12 +569,19 @@ describe.skip('App.ConfigHistoryFlowView', function () {
   });
 
   describe('#sendRevertCallSuccess()', function () {
-    it('', function () {
+    beforeEach(function () {
       sinon.spy(view.get('controller'), 'loadStep');
+      sinon.stub(App.router.get('updateController'), 'updateComponentConfig', Em.K);
+    });
+    afterEach(function () {
+      view.get('controller').loadStep.restore();
+      App.router.get('updateController').updateComponentConfig.restore();
+    });
+    it('', function () {
       view.sendRevertCallSuccess();
 
       expect(view.get('controller').loadStep.calledOnce).to.be.true;
-      view.get('controller').loadStep.restore();
+      expect(App.router.get('updateController').updateComponentConfig.calledOnce).to.be.true;
     });
   });