ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject git commit: AMBARI-6503 Remove synchronous calls that load configs. (atkach)
Date Wed, 16 Jul 2014 14:50:27 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4cc243df0 -> 2293a285a


AMBARI-6503 Remove synchronous calls that load configs. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2293a285
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2293a285
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2293a285

Branch: refs/heads/trunk
Commit: 2293a285a8f018f6e2da45e24e213c5192d447a4
Parents: 4cc243d
Author: atkach <atkach@hortonworks.com>
Authored: Wed Jul 16 17:48:18 2014 +0300
Committer: atkach <atkach@hortonworks.com>
Committed: Wed Jul 16 17:48:18 2014 +0300

----------------------------------------------------------------------
 .../global/configuration_controller.js          | 51 +++++++++-----
 .../main/admin/highAvailability_controller.js   | 12 ++--
 .../controllers/main/admin/misc_controller.js   | 24 ++++---
 .../app/controllers/main/admin/security.js      |  9 +--
 .../controllers/main/mirroring_controller.js    |  7 +-
 .../controllers/main/service/info/configs.js    | 40 ++++++-----
 .../main/service/reassign_controller.js         | 20 +++---
 .../app/controllers/wizard/step7_controller.js  | 73 ++++++++++----------
 ambari-web/app/utils/ajax/ajax.js               |  7 +-
 ambari-web/app/utils/config.js                  | 18 +----
 .../app/views/common/quick_view_link_view.js    | 10 +--
 11 files changed, 144 insertions(+), 127 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/controllers/global/configuration_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/configuration_controller.js b/ambari-web/app/controllers/global/configuration_controller.js
index f5aaa7a..d163be0 100644
--- a/ambari-web/app/controllers/global/configuration_controller.js
+++ b/ambari-web/app/controllers/global/configuration_controller.js
@@ -21,6 +21,12 @@ var App = require('app');
 App.ConfigurationController = Em.Controller.extend({
   name: 'configurationController',
 
+  /**
+   * get configs by tags
+   * return Deferred object with configs as argument
+   * @param tags
+   * @return {object}
+   */
   getConfigsByTags: function (tags) {
     var storedTags = [];
     App.db.getConfigs().forEach(function (site) {
@@ -54,10 +60,12 @@ App.ConfigurationController = Em.Controller.extend({
     return isDifferent;
   },
   loadFromDB: function (siteNames) {
-    var configs = App.db.getConfigs();
-    return configs.filter(function (site) {
+    var dfd = $.Deferred();
+    var configs = App.db.getConfigs().filter(function (site) {
       return (siteNames.contains(site.type));
-    })
+    });
+    dfd.resolve(configs);
+    return dfd.promise()
   },
   /**
    * load configs from server
@@ -66,19 +74,30 @@ App.ConfigurationController = Em.Controller.extend({
    * @return {Array}
    */
   loadFromServer: function (tags) {
-    var loadedConfigs = App.config.loadConfigsByTags(tags);
-    var storedConfigs = App.db.getConfigs();
-    loadedConfigs.forEach(function (loadedSite) {
-      var storedSite = storedConfigs.findProperty('type', loadedSite.type);
-      if (storedSite) {
-        storedSite.tag = loadedSite.tag;
-        storedSite.properties = loadedSite.properties;
-        storedSite.properties_attributes = loadedSite.properties_attributes;
-      } else {
-        storedConfigs.push(loadedSite);
+    var dfd = $.Deferred();
+    var loadedConfigs = [];
+    App.config.loadConfigsByTags(tags).done(function (data) {
+      if (data.items) {
+        data.items.forEach(function (item) {
+          App.config.loadedConfigurationsCache[item.type + "_" + item.tag] = item.properties;
+          loadedConfigs.push(item);
+        });
       }
-    });
-    App.db.setConfigs(storedConfigs);
-    return loadedConfigs;
+    }).complete(function () {
+        var storedConfigs = App.db.getConfigs();
+        loadedConfigs.forEach(function (loadedSite) {
+          var storedSite = storedConfigs.findProperty('type', loadedSite.type);
+          if (storedSite) {
+            storedSite.tag = loadedSite.tag;
+            storedSite.properties = loadedSite.properties;
+            storedSite.properties_attributes = loadedSite.properties_attributes;
+          } else {
+            storedConfigs.push(loadedSite);
+          }
+        });
+        App.db.setConfigs(storedConfigs);
+        dfd.resolve(loadedConfigs);
+      });
+    return dfd.promise();
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/controllers/main/admin/highAvailability_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 2f38124..bffd178 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -118,17 +118,19 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({
    * indicate whether security is enabled
    */
   getServiceConfigsFromServer: function () {
+    var self = this;
     var tags = [
       {
         siteName: "hadoop-env",
         tagName: this.get('tag')
       }
     ];
-    var data = App.router.get('configurationController').getConfigsByTags(tags);
-    var configs = data.findProperty('tag', this.get('tag')).properties;
-    var securityEnabled = !!(configs && (configs['security_enabled'] === 'true' ||
configs['security_enabled'] === true));
-    this.set('securityEnabled', securityEnabled);
-    this.set('dataIsLoaded', true);
+    App.router.get('configurationController').getConfigsByTags(tags).done(function (data)
{
+      var configs = data.findProperty('tag', self.get('tag')).properties;
+      var securityEnabled = !!(configs && (configs['security_enabled'] === 'true'
|| configs['security_enabled'] === true));
+      self.set('securityEnabled', securityEnabled);
+      self.set('dataIsLoaded', true);
+    });
   },
   /**
    * join or wrap message depending on whether it is array or string

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/controllers/main/admin/misc_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/misc_controller.js b/ambari-web/app/controllers/main/admin/misc_controller.js
index 83e15a2..ed43a3e 100644
--- a/ambari-web/app/controllers/main/admin/misc_controller.js
+++ b/ambari-web/app/controllers/main/admin/misc_controller.js
@@ -43,6 +43,7 @@ App.MainAdminMiscController = App.MainServiceInfoConfigsController.extend({
     });
   },
   loadServiceTagSuccess: function (data, opt, params) {
+    var self = this;
     var installedServices = App.Service.find().mapProperty("serviceName");
     var serviceConfigsDef = params.serviceConfigsDef;
     var serviceName = this.get('content.serviceName');
@@ -54,24 +55,25 @@ App.MainAdminMiscController = App.MainServiceInfoConfigsController.extend({
       }
     }
     this.setServiceConfigTags(loadedClusterSiteToTagMap);
-    var configGroups = App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags'));
-    var configSet = App.config.mergePreDefinedWithLoaded(configGroups, [], this.get('serviceConfigTags'),
serviceName);
+    App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function(configGroups){
+      var configSet = App.config.mergePreDefinedWithLoaded(configGroups, [], self.get('serviceConfigTags'),
serviceName);
 
-    var misc_configs = configSet.configs.filterProperty('serviceName', this.get('selectedService')).filterProperty('category',
'Users and Groups').filterProperty('isVisible', true);
+      var misc_configs = configSet.globalConfigs.filterProperty('serviceName', self.get('selectedService')).filterProperty('category',
'Users and Groups').filterProperty('isVisible', true);
 
-    misc_configs = App.config.miscConfigVisibleProperty(misc_configs, installedServices);
+      misc_configs = App.config.miscConfigVisibleProperty(misc_configs, installedServices);
 
-    var sortOrder = this.get('configs').filterProperty('serviceName', this.get('selectedService')).filterProperty('category',
'Users and Groups').filterProperty('isVisible', true).mapProperty('name');
+      var sortOrder = self.get('configs').filterProperty('serviceName', self.get('selectedService')).filterProperty('category',
'Users and Groups').filterProperty('isVisible', true).mapProperty('name');
 
-    //stack, with version lower than 2.1, doesn't have Falcon service
-    this.setProxyUserGroupLabel(misc_configs);
+      //stack, with version lower than 2.1, doesn't have Falcon service
+      self.setProxyUserGroupLabel(misc_configs);
 
-    this.set('users', this.sortByOrder(sortOrder, misc_configs));
+      self.set('users', self.sortByOrder(sortOrder, misc_configs));
 
-    this.setContentProperty('hdfsUser', 'hdfs_user', misc_configs);
-    this.setContentProperty('group', 'user_group', misc_configs);
+      self.setContentProperty('hdfsUser', 'hdfs_user', misc_configs);
+      self.setContentProperty('group', 'user_group', misc_configs);
 
-    this.set('dataIsLoaded', true);
+      self.set('dataIsLoaded', true);
+    });
   },
   /**
    * set config value to property of "content"

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/controllers/main/admin/security.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/security.js b/ambari-web/app/controllers/main/admin/security.js
index bbf21b0..8ed62c5 100644
--- a/ambari-web/app/controllers/main/admin/security.js
+++ b/ambari-web/app/controllers/main/admin/security.js
@@ -90,6 +90,7 @@ App.MainAdminSecurityController = Em.Controller.extend({
   loadStep: function () {
     var step2Controller = App.router.get('mainAdminSecurityAddStep2Controller');
     var services = this.get('services');
+    var self = this;
     step2Controller.set('content', Em.Object.create({services: []}));
     step2Controller.set('content.services', services);
     this.get('stepConfigs').clear();
@@ -106,10 +107,10 @@ App.MainAdminSecurityController = Em.Controller.extend({
     services.forEach(function (_secureService) {
       this.setServiceTagNames(_secureService, this.get('desiredConfigs'));
     }, this);
-    var serverConfigs = App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags'));
-    this.setConfigValuesFromServer(this.get('stepConfigs'), serverConfigs);
-
-    this.set('installedServices', App.Service.find().mapProperty('serviceName'));
+    App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function
(serverConfigs) {
+      self.setConfigValuesFromServer(self.get('stepConfigs'), serverConfigs);
+      self.set('installedServices', App.Service.find().mapProperty('serviceName'));
+    });
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/controllers/main/mirroring_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring_controller.js b/ambari-web/app/controllers/main/mirroring_controller.js
index ea838da..4a36266 100644
--- a/ambari-web/app/controllers/main/mirroring_controller.js
+++ b/ambari-web/app/controllers/main/mirroring_controller.js
@@ -292,13 +292,14 @@ App.MainMirroringController = Em.ArrayController.extend({
 
   onLoadConfigTagsSuccess: function (data, opt, params) {
     this.set('tag', data.Clusters.desired_configs['core-site'].tag);
-    var configs = App.router.get('configurationController').getConfigsByTags([
+    App.router.get('configurationController').getConfigsByTags([
       {
         siteName: "core-site",
         tagName: this.get('tag')
       }
-    ]);
-    params.callback(configs[0].properties['fs.defaultFS']);
+    ]).done(function (configs) {
+        params.callback(configs[0].properties['fs.defaultFS']);
+      });
   },
 
   onLoadConfigTagsError: function (request, ajaxOptions, error, opt, params) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 03f6b97..27d9967 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -321,6 +321,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
   },
 
   onConfigGroupChange: function () {
+    var self = this;
     this.get('stepConfigs').clear();
     var selectedConfigGroup = this.get('selectedConfigGroup');
     var serviceName = this.get('content.serviceName');
@@ -340,25 +341,26 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
     //STEP 3: Load advanced configs
     var advancedConfigs = this.get('advancedConfigs');
     //STEP 4: Load on-site config by service from server
-    var configGroups = App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags'));
-    //STEP 5: Merge on-site configs with pre-defined
-    var configSet = App.config.mergePreDefinedWithLoaded(configGroups, advancedConfigs, this.get('serviceConfigTags'),
serviceName);
-    configSet = App.config.syncOrderWithPredefined(configSet);
-    //var serviceConfigs = this.getSitesConfigProperties(advancedConfigs);
-    var configs = configSet.configs;
-    //STEP 6: add advanced configs
-    App.config.addAdvancedConfigs(configs, advancedConfigs, serviceName);
-    //STEP 7: add custom configs
-    App.config.addCustomConfigs(configs);
-    //put properties from capacity-scheduler.xml into one config with textarea view
-    if (this.get('content.serviceName') === 'YARN' && !App.supports.capacitySchedulerUi)
{
-      configs = App.config.fileConfigsIntoTextarea(configs, 'capacity-scheduler.xml');
-    }
-    this.set('allConfigs', configs);
-    //STEP 8: add configs as names of host components
-    this.addHostNamesToConfig();
-    //STEP 9: Load and add overriden configs of group
-    App.config.loadServiceConfigGroupOverrides(this.get('allConfigs'), this.loadedGroupToOverrideSiteToTagMap,
this.get('configGroups'), this.onLoadOverrides, this);
+    App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function(configGroups){
+      //STEP 5: Merge on-site configs with pre-defined
+      var configSet = App.config.mergePreDefinedWithLoaded(configGroups, advancedConfigs,
self.get('serviceConfigTags'), serviceName);
+      configSet = App.config.syncOrderWithPredefined(configSet);
+      //var serviceConfigs = this.getSitesConfigProperties(advancedConfigs);
+      var configs = configSet.configs;
+      //STEP 6: add advanced configs
+      App.config.addAdvancedConfigs(configs, advancedConfigs, serviceName);
+      //STEP 7: add custom configs
+      App.config.addCustomConfigs(configs);
+      //put properties from capacity-scheduler.xml into one config with textarea view
+      if (self.get('content.serviceName') === 'YARN' && !App.supports.capacitySchedulerUi)
{
+        configs = App.config.fileConfigsIntoTextarea(configs, 'capacity-scheduler.xml');
+      }
+      self.set('allConfigs', configs);
+      //STEP 8: add configs as names of host components
+      self.addHostNamesToConfig();
+      //STEP 9: Load and add overriden configs of group
+      App.config.loadServiceConfigGroupOverrides(self.get('allConfigs'), self.get('loadedGroupToOverrideSiteToTagMap'),
self.get('configGroups'), self.onLoadOverrides, self);
+    });
   }.observes('selectedConfigGroup'),
 
   checkDatabaseProperties: function (serviceConfig) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/controllers/main/service/reassign_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js
index db39b6a..8e2feca 100644
--- a/ambari-web/app/controllers/main/service/reassign_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign_controller.js
@@ -111,21 +111,23 @@ App.ReassignMasterController = App.WizardController.extend({
   },
 
   getServiceConfigsFromServer: function (tag) {
+    var self = this;
     var tags = [
       {
         siteName: "hadoop-env",
         tagName: tag
       }
     ];
-    var data = App.router.get('configurationController').getConfigsByTags(tags);
-    var configs = data.findProperty('tag', tag).properties;
-    var result = configs && (configs['security_enabled'] === 'true' || configs['security_enabled']
=== true);
-    this.saveSecurityEnabled(result);
-    App.clusterStatus.setClusterStatus({
-      clusterName: this.get('content.cluster.name'),
-      clusterState: 'DEFAULT',
-      wizardControllerName: 'reassignMasterController',
-      localdb: App.db.data
+    App.router.get('configurationController').getConfigsByTags(tags).data(function (data)
{
+      var configs = data.findProperty('tag', tag).properties;
+      var result = configs && (configs['security_enabled'] === 'true' || configs['security_enabled']
=== true);
+      self.saveSecurityEnabled(result);
+      App.clusterStatus.setClusterStatus({
+        clusterName: self.get('content.cluster.name'),
+        clusterState: 'DEFAULT',
+        wizardControllerName: 'reassignMasterController',
+        localdb: App.db.data
+      });
     });
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 1c4debc..357b54a 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -805,44 +805,47 @@ App.WizardStep7Controller = Em.Controller.extend({
     var configsMap = {};
     var configTypeMap = {};
     var configMixin = App.get('config');
+    var self = this;
 
-    App.router.get('configurationController').getConfigsByTags(serviceConfigTags).forEach(function
(configSite) {
-      $.extend(configsMap, configSite.properties);
-      for (var name in configSite.properties) {
-        configTypeMap[name] = configSite.type;
-      }
-    });
-    configs.forEach(function (_config) {
-      if (!Em.isNone(configsMap[_config.name])) {
-        // prevent overriding already edited properties
-        if (_config.defaultValue != configsMap[_config.name])
-          _config.value = configsMap[_config.name];
-        _config.defaultValue = configsMap[_config.name];
-        _config.hasInitialValue = true;
-        App.config.handleSpecialProperties(_config);
-        delete configsMap[_config.name];
+    App.router.get('configurationController').getConfigsByTags(serviceConfigTags).done(function
(configsByTags) {
+      configsByTags.forEach(function (configSite) {
+        $.extend(configsMap, configSite.properties);
+        for (var name in configSite.properties) {
+          configTypeMap[name] = configSite.type;
+        }
+      });
+      configs.forEach(function (_config) {
+        if (!Em.isNone(configsMap[_config.name])) {
+          // prevent overriding already edited properties
+          if (_config.defaultValue != configsMap[_config.name])
+            _config.value = configsMap[_config.name];
+          _config.defaultValue = configsMap[_config.name];
+          _config.hasInitialValue = true;
+          App.config.handleSpecialProperties(_config);
+          delete configsMap[_config.name];
+        }
+      });
+
+      self.setServiceDatabaseConfigs(configs);
+      //add user properties
+      for (var name in configsMap) {
+        configs.push(configMixin.addUserProperty({
+          id: 'site property',
+          name: name,
+          serviceName: configMixin.getServiceNameByConfigType(configTypeMap[name]),
+          value: configsMap[name],
+          defaultValue: configsMap[name],
+          filename: (configMixin.get('filenameExceptions').contains(configTypeMap[name]))
? configTypeMap[name] : configTypeMap[name] + '.xml',
+          category: 'Advanced',
+          isUserProperty: true,
+          isOverridable: true,
+          overrides: [],
+          isRequired: true,
+          isVisible: true,
+          showLabel: true
+        }, false, []));
       }
     });
-
-    this.setServiceDatabaseConfigs(configs);
-    //add user properties
-    for (var name in configsMap) {
-      configs.push(configMixin.addUserProperty({
-        id: 'site property',
-        name: name,
-        serviceName: configMixin.getServiceNameByConfigType(configTypeMap[name]),
-        value: configsMap[name],
-        defaultValue: configsMap[name],
-        filename: (configMixin.get('filenameExceptions').contains(configTypeMap[name])) ?
configTypeMap[name] : configTypeMap[name] + '.xml',
-        category: 'Advanced',
-        isUserProperty: true,
-        isOverridable: true,
-        overrides: [],
-        isRequired: true,
-        isVisible: true,
-        showLabel: true
-      }, false, []));
-    }
   },
   /**
    * Check if Oozie or Hive use existing database then need

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 67d1689..8037570 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -355,12 +355,7 @@ var urls = {
   },
   'config.on_site': {
     'real': '/clusters/{clusterName}/configurations?{params}',
-    'mock': '/data/configurations/cluster_level_configs.json?{params}',
-    'format': function() {
-      return {
-        async: false
-      };
-    }
+    'mock': '/data/configurations/cluster_level_configs.json?{params}'
   },
   'config.host_overrides': {
     'real': '/clusters/{clusterName}/configurations?{params}',

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 0cd61db..b90f3f1 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -757,7 +757,7 @@ App.config = Em.Object.create({
   /**
    * GETs all cluster level sites in one call.
    *
-   * @return Array of all site configs
+   * @return {object}
    */
   loadConfigsByTags: function (tags) {
     var urlParams = [];
@@ -765,25 +765,13 @@ App.config = Em.Object.create({
       urlParams.push('(type=' + _tag.siteName + '&tag=' + _tag.tagName + ')');
     });
     var params = urlParams.join('|');
-    App.ajax.send({
+    return App.ajax.send({
       name: 'config.on_site',
       sender: this,
       data: {
         params: params
-      },
-      success: 'loadConfigsByTagsSuccess'
+      }
     });
-    return configGroupsByTag;
-  },
-
-  loadConfigsByTagsSuccess: function (data) {
-    if (data.items) {
-      configGroupsByTag = [];
-      data.items.forEach(function (item) {
-        this.loadedConfigurationsCache[item.type + "_" + item.tag] = item.properties;
-        configGroupsByTag.push(item);
-      }, this);
-    }
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2293a285/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index a3f1ce7..4eaf8a8 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -35,6 +35,7 @@ App.QuickViewLinks = Em.View.extend({
   loadTagsSuccess: function (data) {
     this.get('actualTags').clear();
     var tags = [];
+    var self = this;
     for (var prop in data.Clusters.desired_configs) {
       tags.push(Em.Object.create({
         siteName: prop,
@@ -42,8 +43,10 @@ App.QuickViewLinks = Em.View.extend({
       }));
     }
     this.get('actualTags').pushObjects(tags);
-    this.setConfigProperties();
-    this.getQuickLinksHosts();
+    this.setConfigProperties().done(function (data) {
+      self.get('configProperties').pushObjects(data);
+      self.getQuickLinksHosts();
+    });
   },
 
   loadTagsError: function() {
@@ -91,8 +94,7 @@ App.QuickViewLinks = Em.View.extend({
     var tags = this.get('actualTags').filter(function (tag) {
       return requiredSiteNames.contains(tag.siteName);
     });
-    var data = App.router.get('configurationController').getConfigsByTags(tags);
-    this.get('configProperties').pushObjects(data);
+    return App.router.get('configurationController').getConfigsByTags(tags);
   },
 
   ambariProperties: function () {


Mime
View raw message