Преглед изворни кода

AMBARI-7541. FE: Changing services during install does not call right /recommend API. (akovalenko)

Aleksandr Kovalenko пре 10 година
родитељ
комит
377280bf31

+ 2 - 2
ambari-web/app/controllers/wizard/step7_controller.js

@@ -150,7 +150,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
    */
   selectedServiceNames: function () {
     return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false).mapProperty('serviceName');
-  }.property('content.services', 'content.stacks.@each.isSelected').cacheable(),
+  }.property('content.services', 'content.services.@each.isSelected', 'content.services.@each.isInstalled', 'content.stacks.@each.isSelected').cacheable(),
 
   /**
    * List of installed and selected to install service names
@@ -160,7 +160,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
     return this.get('content.services').filter(function (service) {
       return service.get('isInstalled') || service.get('isSelected');
     }).mapProperty('serviceName');
-  }.property('content.services', 'content.stacks.@each.isSelected').cacheable(),
+  }.property('content.services', 'content.services.@each.isSelected', 'content.services.@each.isInstalled', 'content.stacks.@each.isSelected').cacheable(),
 
   /**
    * List of installed service names

+ 4 - 6
ambari-web/app/mixins/common/serverValidator.js

@@ -61,10 +61,8 @@ App.ServerValidatorMixin = Em.Mixin.create({
    * @type {Array} - of strings (serviceNames)
    */
   serviceNames: function() {
-    return this.get('content.serviceName')
-        ? [this.get('content.serviceName')]
-        : App.StackService.find().filter(function(s){return s.get('isSelected') || s.get('isInstalled')}).mapProperty('serviceName');
-  }.property('content.serviceName'),
+    return this.get('content.serviceName') ? [this.get('content.serviceName')] : this.get('allSelectedServiceNames');
+  }.property('content.serviceName', 'allSelectedServiceNames.@each'),
 
   /**
    * by default loads data from model otherwise must be overridden as computed property
@@ -74,10 +72,10 @@ App.ServerValidatorMixin = Em.Mixin.create({
   services: function() {
     return this.get('content.serviceName')
         ? [App.StackService.find(this.get('content.serviceName'))]
-        : App.StackService.find().filter(function(s){
+        : this.get('content.services').filter(function(s){
           return (s.get('isSelected') || s.get('isInstalled'))
         }).concat(require("data/service_configs"));
-  }.property('content.serviceName'),
+  }.property('content.serviceName', 'content.services', 'content.services.@each.isSelected', 'content.services.@each.isInstalled', 'content.stacks.@each.isSelected'),
 
   /**
    * by default loads data from model otherwise must be overridden as computed property