Repository: ambari
Updated Branches:
  refs/heads/trunk 5a71e013d -> 64cae309c


AMBARI-10704. Installer showing incorrect error count for enhanced config tab 
(onechiporenko)


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

Branch: refs/heads/trunk
Commit: 64cae309c91d3d4b82b4ca1eaa758dae78123680
Parents: 5a71e01
Author: Oleg Nechiporenko <[email protected]>
Authored: Thu Apr 23 18:29:26 2015 +0300
Committer: Oleg Nechiporenko <[email protected]>
Committed: Thu Apr 23 18:29:26 2015 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    |  2 +-
 .../app/controllers/wizard/step7_controller.js  |  2 +-
 .../main/service/info/config_test.js            | 24 +++++++++++++++---
 .../test/controllers/wizard/step7_test.js       | 26 ++++++++++++++++----
 4 files changed, 43 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/64cae309/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index de4e87e..5f22112 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -179,7 +179,7 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.ServerValidatorM
   errorsCount: function () {
     return this.get('selectedService.configs').filter(function (config) {
       return Em.isNone(config.get('widget'));
-    }).filterProperty('isValid', false).length;
+    }).filterProperty('isValid', false).filterProperty('isVisible').length;
   }.property('[email protected]'),
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/64cae309/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index a0b58c4..ede0579 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -139,7 +139,7 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
   errorsCount: function () {
     return this.get('selectedService.configs').filter(function (config) {
       return Em.isNone(config.get('widget'));
-    }).filterProperty('isValid', false).length;
+    }).filterProperty('isValid', false).filterProperty('isVisible').length;
   }.property('[email protected]'),
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/64cae309/ambari-web/test/controllers/main/service/info/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/info/config_test.js 
b/ambari-web/test/controllers/main/service/info/config_test.js
index e1d93c3..7bed552 100644
--- a/ambari-web/test/controllers/main/service/info/config_test.js
+++ b/ambari-web/test/controllers/main/service/info/config_test.js
@@ -1311,10 +1311,26 @@ describe("App.MainServiceInfoConfigsController", 
function () {
 
       mainServiceInfoConfigsController.reopen({selectedService: {
         configs: [
-          Em.Object.create({widget: Em.View, isValid: false}),
-          Em.Object.create({widget: Em.View, isValid: true}),
-          Em.Object.create({isValid: true}),
-          Em.Object.create({isValid: false})
+          Em.Object.create({isVisible: true, widget: Em.View, isValid: false}),
+          Em.Object.create({isVisible: true, widget: Em.View, isValid: true}),
+          Em.Object.create({isVisible: true, isValid: true}),
+          Em.Object.create({isVisible: true, isValid: false})
+        ]
+      }});
+
+      expect(mainServiceInfoConfigsController.get('errorsCount')).to.equal(1);
+
+    });
+
+    it('should ignore configs with widgets (enhanced configs) and hidden 
configs', function () {
+
+      mainServiceInfoConfigsController.reopen({selectedService: {
+        configs: [
+          Em.Object.create({isVisible: true, widget: Em.View, isValid: false}),
+          Em.Object.create({isVisible: true, widget: Em.View, isValid: true}),
+          Em.Object.create({isVisible: false, isValid: false}),
+          Em.Object.create({isVisible: true, isValid: true}),
+          Em.Object.create({isVisible: true, isValid: false})
         ]
       }});
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/64cae309/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js 
b/ambari-web/test/controllers/wizard/step7_test.js
index a37170b..347a859 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -1958,10 +1958,26 @@ describe('App.InstallerStep7Controller', function () {
 
       installerStep7Controller.reopen({selectedService: {
         configs: [
-          Em.Object.create({widget: Em.View, isValid: false}),
-          Em.Object.create({widget: Em.View, isValid: true}),
-          Em.Object.create({isValid: true}),
-          Em.Object.create({isValid: false})
+          Em.Object.create({isVisible: true, widget: Em.View, isValid: false}),
+          Em.Object.create({isVisible: true, widget: Em.View, isValid: true}),
+          Em.Object.create({isVisible: true, isValid: true}),
+          Em.Object.create({isVisible: true, isValid: false})
+        ]
+      }});
+
+      expect(installerStep7Controller.get('errorsCount')).to.equal(1);
+
+    });
+
+    it('should ignore configs with widgets (enhanced configs) and hidden 
configs', function () {
+
+      installerStep7Controller.reopen({selectedService: {
+        configs: [
+          Em.Object.create({isVisible: true, widget: Em.View, isValid: false}),
+          Em.Object.create({isVisible: true, widget: Em.View, isValid: true}),
+          Em.Object.create({isVisible: false, isValid: false}),
+          Em.Object.create({isVisible: true, isValid: true}),
+          Em.Object.create({isVisible: true, isValid: false})
         ]
       }});
 
@@ -1971,4 +1987,4 @@ describe('App.InstallerStep7Controller', function () {
 
   });
 
-});
\ No newline at end of file
+});

Reply via email to