Author: yusaku
Date: Mon Jun 3 19:10:40 2013
New Revision: 1489107
URL: http://svn.apache.org/r1489107
Log:
AMBARI-2257. Reassign Master Wizard: should update changes on step 2. (Oleg
Nechiporenko via yusaku)
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js
incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js
Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js?rev=1489107&r1=1489106&r2=1489107&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js
(original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/service/item.js Mon
Jun 3 19:10:40 2013
@@ -192,9 +192,10 @@ App.MainServiceItemController = Em.Contr
* @param hostComponent
*/
reassignMaster: function (hostComponent) {
+ var component = App.HostComponent.find().findProperty('componentName',
hostComponent.get('componentName'));
console.log('In Reassign Master', hostComponent);
var reassignMasterController = App.router.get('reassignMasterController');
- reassignMasterController.saveComponentToReassign(hostComponent);
+ reassignMasterController.saveComponentToReassign(component);
reassignMasterController.setCurrentStep('1');
App.router.transitionTo('reassignMaster');
},
Modified: incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js?rev=1489107&r1=1489106&r2=1489107&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js (original)
+++ incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js Mon Jun 3
19:10:40 2013
@@ -198,6 +198,20 @@ App.servicesMapper = App.QuickDataMapper
this.calculateState(hcJson);
}, this);
+ var oldHostComponents = App.HostComponent.find();
+ var item;
+ for (var i = 0; i < oldHostComponents.content.length; i++) {
+ item = oldHostComponents.objectAt(i);
+ if (item && !result.findProperty('id', item.get('id'))) {
+ item.deleteRecord();
+ }
+ }
+ result.forEach(function (item) {
+ if (App.HostComponent.find(item.id).get('componentName') &&
+ !App.HostComponent.find().filterProperty('componentName',
item.component_name).someProperty('host.hostName', item.host_id)) {
+ item.id = (new Date).getTime();
+ }
+ });
App.store.loadMany(this.get('model3'), result);
for(var hostComponentId in hostComponentToActualConfigsMap){
var hostComponentObj = App.HostComponent.find(hostComponentId);