Parcourir la source

AMBARI-11273. "Save" configs button is not enabled after making changes on YARN and HBase. (alexantonenko)

Alex Antonenko il y a 10 ans
Parent
commit
a40b2b6918

+ 2 - 1
ambari-web/app/controllers/main/service/info/configs.js

@@ -1233,7 +1233,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
    * @method getMasterComponentHostValue
    * @method getMasterComponentHostValue
    */
    */
   getMasterComponentHostValue: function (componentName, multiple) {
   getMasterComponentHostValue: function (componentName, multiple) {
-    var components = this.get('content.hostComponents').filterProperty('componentName', componentName);
+    var components = App.HostComponent.find().filterProperty('componentName', componentName);
+  
     if (components.length > 0) {
     if (components.length > 0) {
       return multiple ? components.mapProperty('hostName') : components[0].get('hostName');
       return multiple ? components.mapProperty('hostName') : components[0].get('hostName');
     }
     }

+ 4 - 5
ambari-web/test/controllers/main/service/info/config_test.js

@@ -382,13 +382,12 @@ describe("App.MainServiceInfoConfigsController", function () {
       }
       }
     ];
     ];
     tests.forEach(function(t){
     tests.forEach(function(t){
-      beforeEach(function () {
-        mainServiceInfoConfigsController.set("content", { hostComponents: []});
-      });
-
       it(t.m, function () {
       it(t.m, function () {
-        mainServiceInfoConfigsController.set("content.hostComponents", t.content.hostComponents);
+        sinon.stub(App.HostComponent, 'find', function(){
+          return t.content.hostComponents;
+        });
         expect(mainServiceInfoConfigsController.getMasterComponentHostValue(t.content.hostComponents[0].componentName, t.multiple)).to.eql(t.result);
         expect(mainServiceInfoConfigsController.getMasterComponentHostValue(t.content.hostComponents[0].componentName, t.multiple)).to.eql(t.result);
+        App.HostComponent.find.restore();
       });
       });
     });
     });
   });
   });