You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/08/03 15:39:06 UTC

ambari git commit: AMBARI-12620. Wrong 'Affected components' list shown (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk fb28fe7ac -> 2462dbeff


AMBARI-12620. Wrong 'Affected components' list shown (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 2462dbeffd7f3795bdf6259a759190e239db2595
Parents: fb28fe7
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Aug 3 15:19:38 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Aug 3 16:38:59 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/mappers/component_config_mapper.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2462dbef/ambari-web/app/mappers/component_config_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/component_config_mapper.js b/ambari-web/app/mappers/component_config_mapper.js
index 36aa979..50b537f 100644
--- a/ambari-web/app/mappers/component_config_mapper.js
+++ b/ambari-web/app/mappers/component_config_mapper.js
@@ -52,15 +52,18 @@ App.componentConfigMapper = App.QuickDataMapper.create({
         });
       });
       this.get('model').find().forEach(function (hostComponent) {
-        var hostComponentJson = hostComponentJsonMap[hostComponent.get('id')];
+        var id = hostComponent.get('id');
+        var hostComponentJson = hostComponentJsonMap[id];
         var currentStaleConfigsState = Boolean(hostComponentJson);
         var stateChanged = hostComponent.get('staleConfigs') !== currentStaleConfigsState;
 
         if (stateChanged && !hostComponent.get('isMaster')) {
           hostComponent.set('staleConfigs', currentStaleConfigsState);
         }
-        //delete load host-components, so only new ones left
-        delete hostComponentJsonMap[hostComponent.get('id')];
+        //delete loaded host-components, so only new ones left
+        if (hostComponent.get('service.hostComponents').someProperty('id', id)) {
+          delete hostComponentJsonMap[id];
+        }
       });
       hostComponentJsonIds.forEach(function (hcId) {
         var newHostComponent = hostComponentJsonMap[hcId];
@@ -76,6 +79,7 @@ App.componentConfigMapper = App.QuickDataMapper.create({
         }
       }, this);
       if (hostComponents.length > 0) {
+        App.store.commit();
         App.store.loadMany(this.get('model'), hostComponents);
         this.addNewHostComponents(newHostComponentsMap, cacheServices);
       }