Repository: ambari
Updated Branches:
  refs/heads/trunk 3cb71c0ba -> 73b6d6b13


AMBARI-8075. Add Service: coming back on step 1 does not show previously 
selected services for install (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 73b6d6b13c7253f0613d3c58d05474b6e13e166e
Parents: 3cb71c0
Author: Alex Antonenko <hiv...@gmail.com>
Authored: Fri Oct 31 20:46:45 2014 +0200
Committer: Alex Antonenko <hiv...@gmail.com>
Committed: Fri Oct 31 21:22:27 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/add_controller.js | 6 +++---
 ambari-web/app/routes/add_service_routes.js               | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/73b6d6b1/ambari-web/app/controllers/main/service/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/add_controller.js 
b/ambari-web/app/controllers/main/service/add_controller.js
index 0bdba89..1fc7fd0 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -66,7 +66,7 @@ App.AddServiceController = App.WizardController.extend({
   /**
    * Load services data. Will be used at <code>Select services(step4)</code> 
step
    */
-  loadServices: function () {
+  loadServices: function (isStep1) {
     var services = this.getDBProperty('services');
     if (!services) {
       services = {
@@ -87,7 +87,7 @@ App.AddServiceController = App.WizardController.extend({
       App.StackService.find().forEach(function (item) {
         var isSelected = 
services.selectedServices.contains(item.get('serviceName'));
         var isInstalled = 
services.installedServices.contains(item.get('serviceName'));
-        item.set('isSelected', isSelected);
+        item.set('isSelected', isSelected || (isStep1 ? isInstalled : 
isSelected));
         item.set('isInstalled', isInstalled);
       }, this);
       var isServiceWithSlave = 
App.StackService.find().filterProperty('isSelected').filterProperty('hasSlave').filterProperty('isInstalled',
 false).mapProperty('serviceName').length;
@@ -355,7 +355,7 @@ App.AddServiceController = App.WizardController.extend({
         this.loadMasterComponentHosts();
         this.load('hosts');
       case '1':
-        this.loadServices();
+        this.loadServices(true);
     }
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/73b6d6b1/ambari-web/app/routes/add_service_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_service_routes.js 
b/ambari-web/app/routes/add_service_routes.js
index 73485b9..9f2be68 100644
--- a/ambari-web/app/routes/add_service_routes.js
+++ b/ambari-web/app/routes/add_service_routes.js
@@ -100,7 +100,6 @@ module.exports = App.WizardRoute.extend({
       console.log('in addService.step1:connectOutlets');
       var controller = router.get('addServiceController');
       controller.setCurrentStep('1');
-      controller.setDBProperty('services',undefined);
       controller.set('hideBackButton', true);
       controller.dataLoading().done(function () {
         controller.loadAllPriorSteps();

Reply via email to