You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by is...@apache.org on 2018/11/07 23:49:31 UTC

[ambari] branch branch-2.7 updated: [AMBARI-24836] Service Auto start is enabled after page refresh

This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 6354fb8  [AMBARI-24836] Service Auto start is enabled after page refresh
6354fb8 is described below

commit 6354fb8fdf6fb424a9ca1e1ae37aff26d2eaf508
Author: Ishan Bhatt <is...@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 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 @@ 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 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 @@ describe('App.MainAdminServiceAutoStartController', function() {
           ]);
         }
       });
+      sinon.stub(App.router.get('configurationController'), 'updateConfigTags').returns({
+        always: Em.clb
+      });
       sinon.stub(controller, 'loadComponentsConfigs').returns({
         then: Em.clb
       });
@@ -87,6 +90,7 @@ describe('App.MainAdminServiceAutoStartController', function() {
     });
     afterEach(function() {
       App.router.get('configurationController').getCurrentConfigsBySites.restore();
+      App.router.get('configurationController').updateConfigTags.restore();
       controller.loadComponentsConfigs.restore();
     });