Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 4c9026b34 -> 4b73b29ad


AMBARI-13630 Incorrect error count for Ranger service while adding another 
service via add service wizard. (atkach)


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

Branch: refs/heads/branch-2.2
Commit: 4b73b29ad7a33de1589840b17f553f52a458ede0
Parents: 4c9026b
Author: Andrii Tkach <[email protected]>
Authored: Tue Dec 8 13:36:08 2015 +0200
Committer: Andrii Tkach <[email protected]>
Committed: Tue Dec 8 13:36:08 2015 +0200

----------------------------------------------------------------------
 .../app/controllers/wizard/step7_controller.js  | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4b73b29a/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 af97f54..bea3dd4 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -640,8 +640,6 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
       : 
App.config.mergePreDefinedWithStack(this.get('selectedServiceNames').concat(this.get('installedServiceNames')));
     App.config.setPreDefinedServiceConfigs(this.get('addMiscTabToPage'));
 
-    this.resolveConfigThemeConditions(configs);
-
     this.set('groupsToDelete', 
this.get('wizardController').getDBProperty('groupsToDelete') || []);
     if (this.get('wizardController.name') === 'addServiceController') {
       
App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function
 (loadedConfigs) {
@@ -672,15 +670,26 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
               themeResource = App.SubSection.find().findProperty('name', 
configCondition.get('name'));
             } else if (configCondition.get('type') === 'subsectionTab') {
               themeResource = App.SubSectionTab.find().findProperty('name', 
configCondition.get('name'));
+            } else if (configCondition.get('type') === 'config') {
+              //simulate section wrapper for condition type "config"
+              themeResource = Em.Object.create({
+                configProperties: [
+                  Em.Object.create({
+                    name: configCondition.get('configName'),
+                    fileName: configCondition.get('fileName')
+                  })
+                ]
+              });
             }
             if (themeResource) {
               themeResource.get('configProperties').forEach(function (_config) 
{
-                configs.find(function (item) {
+                configs.forEach(function (item) {
                   if (item.name === _config.get('name') && item.filename === 
_config.get('fileName')) {
+                    // if config has already been hidden by condition with 
"subsection" or "subsectionTab" type
+                    // then ignore condition of "config" type
+                    if (configCondition.get('type') === 'config' && 
item.hiddenBySection) return false;
                     item.hiddenBySection = !valueAttributes['visible'];
-                    return true;
                   }
-                  return false;
                 });
               }, this);
             }
@@ -704,6 +713,7 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
     if (App.get('isKerberosEnabled') && this.get('wizardController.name') == 
'addServiceController') {
       this.addKerberosDescriptorConfigs(configs, 
this.get('wizardController.kerberosDescriptorConfigs') || []);
     }
+    this.resolveConfigThemeConditions(configs);
     this.setStepConfigs(configs, storedConfigs);
     this.checkHostOverrideInstaller();
     this.activateSpecialConfigs();

Reply via email to