[AMBARI-24836] Service Auto start is enabled after page refresh
diff --git a/ambari-web/app/controllers/main/admin/service_auto_start.js b/ambari-web/app/controllers/main/admin/service_auto_start.js
index 82b9258..6809cd7 100644
--- a/ambari-web/app/controllers/main/admin/service_auto_start.js
+++ b/ambari-web/app/controllers/main/admin/service_auto_start.js
@@ -113,14 +113,19 @@
},
load: function() {
- App.router.get('configurationController').getCurrentConfigsBySites(['cluster-env']).done((data) => {
- this.set('clusterConfigs', data[0].properties);
- this.set('isGeneralRecoveryEnabled', data[0].properties.recovery_enabled === 'true');
- this.set('isGeneralRecoveryEnabledCached', this.get('isGeneralRecoveryEnabled'));
- this.loadComponentsConfigs().then(() => {
- this.set('isLoaded', true);
+ const self = this;
+ const clusterConfigController = App.router.get('configurationController');
+ clusterConfigController.updateConfigTags().always(function () {
+ clusterConfigController.getCurrentConfigsBySites(['cluster-env']).done((data) => {
+ self.set('clusterConfigs', data[0].properties);
+ self.set('isGeneralRecoveryEnabled', data[0].properties.recovery_enabled === 'true');
+ self.set('isGeneralRecoveryEnabledCached', self.get('isGeneralRecoveryEnabled'));
+ self.loadComponentsConfigs().then(() => {
+ self.set('isLoaded', true);
+ });
});
});
+
},
loadComponentsConfigs: function () {
diff --git a/ambari-web/test/controllers/main/admin/service_auto_start_test.js b/ambari-web/test/controllers/main/admin/service_auto_start_test.js
index 248bf44..6965cd3 100644
--- a/ambari-web/test/controllers/main/admin/service_auto_start_test.js
+++ b/ambari-web/test/controllers/main/admin/service_auto_start_test.js
@@ -80,6 +80,9 @@
]);
}
});
+ sinon.stub(App.router.get('configurationController'), 'updateConfigTags').returns({
+ always: Em.clb
+ });
sinon.stub(controller, 'loadComponentsConfigs').returns({
then: Em.clb
});
@@ -87,6 +90,7 @@
});
afterEach(function() {
App.router.get('configurationController').getCurrentConfigsBySites.restore();
+ App.router.get('configurationController').updateConfigTags.restore();
controller.loadComponentsConfigs.restore();
});