This is an automated email from the ASF dual-hosted git repository. ishanbha pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push: new ad36582 [AMBARI-24836] Service Auto start is enabled after page refresh ad36582 is described below commit ad3658288c795a49bef612059e7fa8b5bcd1245f Author: Ishan Bhatt <ishanbhatt.1...@gmail.com> AuthorDate: Wed Nov 7 13:42:17 2018 -0800 [AMBARI-24836] Service Auto start is enabled after page refresh --- .../app/controllers/main/admin/service_auto_start.js | 17 +++++++++++------ .../controllers/main/admin/service_auto_start_test.js | 4 ++++ 2 files changed, 15 insertions(+), 6 deletions(-) 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 4338f4c..1eb4cc7 100644 --- a/ambari-web/app/controllers/main/admin/service_auto_start.js +++ b/ambari-web/app/controllers/main/admin/service_auto_start.js @@ -116,14 +116,19 @@ App.MainAdminServiceAutoStartController = Em.Controller.extend({ }, 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 e79271d..5e8983e 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 @@ -92,6 +92,9 @@ describe('App.MainAdminServiceAutoStartController', function() { ]); } }); + sinon.stub(App.router.get('configurationController'), 'updateConfigTags').returns({ + always: Em.clb + }); sinon.stub(controller, 'loadComponentsConfigs').returns({ then: Em.clb }); @@ -99,6 +102,7 @@ describe('App.MainAdminServiceAutoStartController', function() { }); afterEach(function() { App.router.get('configurationController').getCurrentConfigsBySites.restore(); + App.router.get('configurationController').updateConfigTags.restore(); controller.loadComponentsConfigs.restore(); });