Repository: ambari Updated Branches: refs/heads/trunk b640b909d -> ada7f1eb6
AMBARI-6463. Installer wizard not showing service configs for selected services. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ada7f1eb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ada7f1eb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ada7f1eb Branch: refs/heads/trunk Commit: ada7f1eb63002750ca64fd67a832c570408cfbb4 Parents: b640b90 Author: Jaimin Jetly <jai...@hortonworks.com> Authored: Thu Jul 10 17:14:55 2014 -0700 Committer: Jaimin Jetly <jai...@hortonworks.com> Committed: Thu Jul 10 17:15:21 2014 -0700 ---------------------------------------------------------------------- .../app/controllers/main/admin/misc_controller.js | 2 +- .../app/controllers/main/service/info/configs.js | 3 ++- .../app/controllers/wizard/step7_controller.js | 5 +++-- ambari-web/app/data/service_configs.js | 2 +- ambari-web/app/models/stack_service.js | 16 +++++++++++----- ambari-web/app/utils/config.js | 6 +++--- 6 files changed, 21 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ada7f1eb/ambari-web/app/controllers/main/admin/misc_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/misc_controller.js b/ambari-web/app/controllers/main/admin/misc_controller.js index 628d813..a732c83 100644 --- a/ambari-web/app/controllers/main/admin/misc_controller.js +++ b/ambari-web/app/controllers/main/admin/misc_controller.js @@ -49,7 +49,7 @@ App.MainAdminMiscController = App.MainServiceInfoConfigsController.extend({ var loadedClusterSiteToTagMap = {}; for (var site in data.Clusters.desired_configs) { - if (serviceConfigsDef.configTypes.contains(site)) { + if (!!serviceConfigsDef.configTypes[site]) { loadedClusterSiteToTagMap[site] = data.Clusters.desired_configs[site]['tag']; } } http://git-wip-us.apache.org/repos/asf/ambari/blob/ada7f1eb/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 c98a611..5b0dbcd 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -228,7 +228,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({ var selectedConfigGroup; var siteToTagMap = {}; var hostsLength = App.router.get('mainHostController.hostsCountMap.TOTAL'); - serviceConfigsDef.get('configTypesRendered').forEach(function (siteName) { + var configTypesRendered = Object.keys(serviceConfigsDef.get('configTypesRendered')); + configTypesRendered.forEach(function (siteName) { if (data.Clusters.desired_configs[siteName]) { siteToTagMap[siteName] = data.Clusters.desired_configs[siteName].tag; } else { http://git-wip-us.apache.org/repos/asf/ambari/blob/ada7f1eb/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 616f771..3aa1190 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -248,7 +248,7 @@ App.WizardStep7Controller = Em.Controller.extend({ var siteToTagMap = {}; for (var site in desired_configs) { if (desired_configs.hasOwnProperty(site)) { - if (sites.indexOf(site) > -1) { + if (!!sites[site]) { siteToTagMap[site] = desired_configs[site].tag; } } @@ -776,7 +776,8 @@ App.WizardStep7Controller = Em.Controller.extend({ getConfigTagsSuccess: function (data) { var installedServiceSites = []; App.StackService.find().filterProperty('isInstalled').forEach(function (service) { - installedServiceSites = installedServiceSites.concat(service.get('configTypes')); + var configTypes = Object.keys(service.get('configTypes')); + installedServiceSites = installedServiceSites.concat(configTypes); }, this); installedServiceSites = installedServiceSites.uniq(); var serviceConfigTags = []; http://git-wip-us.apache.org/repos/asf/ambari/blob/ada7f1eb/ambari-web/app/data/service_configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/service_configs.js b/ambari-web/app/data/service_configs.js index 26986d1..9164c95 100644 --- a/ambari-web/app/data/service_configs.js +++ b/ambari-web/app/data/service_configs.js @@ -35,7 +35,7 @@ module.exports = [ App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'}), App.ServiceConfigCategory.create({ name: 'Users and Groups', displayName : 'Users and Groups'}) ], - configTypes: ['global'], + configTypes: {global: {supports: {final: false}}}, configs: [] }) ]; http://git-wip-us.apache.org/repos/asf/ambari/blob/ada7f1eb/ambari-web/app/models/stack_service.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js index 83efb8a..f0611c7 100644 --- a/ambari-web/app/models/stack_service.js +++ b/ambari-web/app/models/stack_service.js @@ -38,7 +38,7 @@ require('utils/configs/validators/storm_configs_validator'); */ App.StackService = DS.Model.extend(App.ServiceModelMixin, { comments: DS.attr('string'), - configTypes: DS.attr('array'), + configTypes: DS.attr('object'), serviceVersion: DS.attr('string'), stackName: DS.attr('string'), stackVersion: DS.attr('string'), @@ -60,8 +60,13 @@ App.StackService = DS.Model.extend(App.ServiceModelMixin, { }.property('serviceName'), configTypesRendered: function () { - if (this.get('serviceName') == 'HDFS') return this.get('configTypes'); - else return this.get('configTypes').without('core-site') + var configTypes = this.get('configTypes'); + if (this.get('serviceName') == 'HDFS') return configTypes; + else { + var renderedConfigTypes = $.extend(true,{}, configTypes); + delete renderedConfigTypes['core-site']; + return renderedConfigTypes + } }.property('serviceName','configTypes'), displayNameOnSelectServicePage: function () { @@ -146,7 +151,8 @@ App.StackService = DS.Model.extend(App.ServiceModelMixin, { }.property('serviceName'), isNoConfigTypes: function () { - return !(this.get('configTypes') && this.get('configTypes').length); + var configTypes = this.get('configTypes'); + return !(configTypes && !!Object.keys(configTypes).length); }.property('configTypes'), customReviewHandler: function () { @@ -172,7 +178,7 @@ App.StackService = DS.Model.extend(App.ServiceModelMixin, { var serviceName = this.get('serviceName'); var configTypes = this.get('configTypes'); var serviceComponents = this.get('serviceComponents'); - if (configTypes.length) { + if (configTypes && Object.keys(configTypes).length) { var pattern = ["General", "CapacityScheduler", "^Advanced", "^Custom", "Falcon - Oozie integration", "FalconStartupSite", "FalconRuntimeSite"]; configCategories = App.StackService.configCategories(serviceName).filter(function (_configCategory) { var serviceComponentName = _configCategory.get('name'); http://git-wip-us.apache.org/repos/asf/ambari/blob/ada7f1eb/ambari-web/app/utils/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index 8ed1262..abdc19c 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -96,7 +96,7 @@ App.config = Em.Object.create({ // HCatalog should be eventually made a part of Hive Service. See AMBARI-6302 description for further details var servicesWithConfigTypes = services.filter(function (service) { var configtypes = service.get('configTypes'); - return configtypes && !!configtypes.length && service.get('serviceName') != 'HCATALOG'; + return configtypes && !!Object.keys(configtypes).length && service.get('serviceName') != 'HCATALOG'; }, this); var serviceTabs = servicesWithConfigTypes.concat(nonServicePages); serviceTabs.forEach(function (stackService) { @@ -124,7 +124,7 @@ App.config = Em.Object.create({ // HCatalog should be eventually made a part of Hive Service. See AMBARI-6302 description for further details var servicesWithConfigTypes = stackServices.filter(function (service) { var configtypes = service.get('configTypes'); - return configtypes && !!configtypes.length && service.get('serviceName') != 'HCATALOG'; + return configtypes && !!Object.keys(configtypes).length && service.get('serviceName') != 'HCATALOG'; }, this); var allTabs = servicesWithConfigTypes.concat(nonServiceTab); @@ -1012,7 +1012,7 @@ App.config = Em.Object.create({ getServiceNameByConfigType: function (type) { var preDefinedServiceConfigs = this.get('preDefinedServiceConfigs'); var service = preDefinedServiceConfigs.find(function (serviceConfig) { - return (serviceConfig.get('configTypes').contains(type)); + return !!serviceConfig.get('configTypes')[type]; }, this); return service && service.get('serviceName'); },