Repository: ambari Updated Branches: refs/heads/trunk 751cb1439 -> 67e0b5094
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/67e0b509 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/67e0b509 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/67e0b509 Branch: refs/heads/trunk Commit: 67e0b50940fdb64f25501b4393275396e4b4568a Parents: 751cb14 Author: Andrii Tkach <[email protected]> Authored: Tue Dec 8 13:46:10 2015 +0200 Committer: Andrii Tkach <[email protected]> Committed: Tue Dec 8 13:46:42 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/67e0b509/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 c64a039..e9d53e4 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -634,8 +634,6 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E var configs = (storedConfigs && storedConfigs.length) ? storedConfigs : App.configsCollection.getAll(); - this.resolveConfigThemeConditions(configs); - this.set('groupsToDelete', this.get('wizardController').getDBProperty('groupsToDelete') || []); if (this.get('wizardController.name') === 'addServiceController' && !this.get('content.serviceConfigProperties.length')) { App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function (loadedConfigs) { @@ -666,15 +664,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 (_configId) { - configs.find(function (item) { + configs.forEach(function (item) { if (App.config.configId(item.name, item.filename) === _configId) { + // 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); } @@ -691,6 +700,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); var stepConfigs = this.createStepConfigs(); var serviceConfigs = this.renderConfigs(stepConfigs, configs); // if HA is enabled -> Make some reconfigurations
