瀏覽代碼

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

Alex Antonenko 10 年之前
父節點
當前提交
73b6d6b13c

+ 3 - 3
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);
     }
   },
 

+ 0 - 1
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();