Repository: ambari Updated Branches: refs/heads/trunk 696e58bd8 -> 77e402ef7
AMBARI-13858 Clear configsCollection when it needed. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/77e402ef Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/77e402ef Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/77e402ef Branch: refs/heads/trunk Commit: 77e402ef71bad4522342688c2a9ab8ce55dca70a Parents: 4da648d Author: aBabiichuk <ababiic...@cybervisiontech.com> Authored: Thu Nov 12 14:55:12 2015 +0200 Committer: aBabiichuk <ababiic...@cybervisiontech.com> Committed: Thu Nov 12 14:58:57 2015 +0200 ---------------------------------------------------------------------- .../app/controllers/main/service/info/configs.js | 15 +++++++++------ .../app/controllers/wizard/step7_controller.js | 3 ++- ambari-web/app/routes/add_service_routes.js | 2 ++ ambari-web/app/routes/installer.js | 1 + ambari-web/app/utils/config.js | 1 + ambari-web/app/utils/configs_collection.js | 2 +- ambari-web/test/utils/config_test.js | 1 + 7 files changed, 17 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/77e402ef/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 a79c66e..5dbe15b 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -199,7 +199,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A var properties = []; App.Tab.find(this.get('content.serviceName') + '_settings').get('sections').forEach(function(s) { s.get('subSections').forEach(function(ss) { - properties = properties.concat(ss.get('configProperties').filterProperty('id')); + properties = properties.concat(ss.get('configProperties')); }); }); return properties; @@ -431,11 +431,14 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A * @method mergeWithStackProperties */ mergeWithStackProperties: function (configs) { - this.get('settingsTabProperties').forEach(function (advanced) { - if (!configs.someProperty('name', advanced.name)) { - advanced.savedValue = null; - advanced.isNotSaved = true; - configs.pushObject(App.ServiceConfigProperty.create(advanced)); + this.get('settingsTabProperties').forEach(function (advanced_id) { + if (!configs.someProperty('id', advanced_id)) { + var advanced = App.configsCollection.getConfig(advanced_id); + if (advanced) { + advanced.savedValue = null; + advanced.isNotSaved = true; + configs.pushObject(App.ServiceConfigProperty.create(advanced)); + } } }); return configs; http://git-wip-us.apache.org/repos/asf/ambari/blob/77e402ef/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 4aa99bf..5757126 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -995,7 +995,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E var type = _config.filename ? App.config.getConfigTagFromFileName(_config.filename) : null; var mappedConfigValue = type && configsMap[type] ? configsMap[type][_config.name] : null; if (Em.isNone(mappedConfigValue)) { - return _config.serviceName == 'MISC'; + //for now ranger plugin properties are not sending by recommendations if they are missed - it should be added + return _config.serviceName == 'MISC' || /^ranger-/.test(_config.filename); } else { if (_config.savedValue != mappedConfigValue) { _config.savedValue = App.config.formatPropertyValue(_config, mappedConfigValue); http://git-wip-us.apache.org/repos/asf/ambari/blob/77e402ef/ambari-web/app/routes/add_service_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js index 3a17c0e..32e9b70 100644 --- a/ambari-web/app/routes/add_service_routes.js +++ b/ambari-web/app/routes/add_service_routes.js @@ -130,6 +130,7 @@ module.exports = App.WizardRoute.extend({ wizardStep5Controller.clearRecommendations(); // Force reload recommendation between steps 1 and 2 addServiceController.setDBProperty('recommendations', undefined); addServiceController.set('stackConfigsLoaded', false); + App.configsCollection.clearAll(); router.transitionTo('step2'); } }), @@ -195,6 +196,7 @@ module.exports = App.WizardRoute.extend({ addServiceController.setDBProperty('groupsToDelete', []); addServiceController.setDBProperty('recommendationsConfigs', null); router.get('wizardStep7Controller').set('recommendationsConfigs', null); + router.get('wizardStep7Controller').clearDependentConfigs(); router.transitionTo('step4'); }); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/77e402ef/ambari-web/app/routes/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js index 5beb03a..4fb6c45 100644 --- a/ambari-web/app/routes/installer.js +++ b/ambari-web/app/routes/installer.js @@ -240,6 +240,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, { masterComponentHosts: undefined }); controller.set('stackConfigsLoaded', false); + App.configsCollection.clearAll(); router.transitionTo('step5'); console.timeEnd('step4 next'); } http://git-wip-us.apache.org/repos/asf/ambari/blob/77e402ef/ambari-web/app/utils/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index 7e53632..1fba4d0 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -267,6 +267,7 @@ App.config = Em.Object.create({ createDefaultConfig: function(name, serviceName, fileName, definedInStack, coreObject) { var tpl = { /** core properties **/ + id: this.configId(name, fileName), name: name, filename: fileName, value: '', http://git-wip-us.apache.org/repos/asf/ambari/blob/77e402ef/ambari-web/app/utils/configs_collection.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/configs_collection.js b/ambari-web/app/utils/configs_collection.js index 648bd98..fde7a17 100644 --- a/ambari-web/app/utils/configs_collection.js +++ b/ambari-web/app/utils/configs_collection.js @@ -33,7 +33,7 @@ var App = require('app'); var configsCollection = [], /** * this should be object with key - config id and value - config object - * @type {Object{}} + * @type {Object} */ configsCollectionMap = {}; http://git-wip-us.apache.org/repos/asf/ambari/blob/77e402ef/ambari-web/test/utils/config_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js index fb762a7..e3906af 100644 --- a/ambari-web/test/utils/config_test.js +++ b/ambari-web/test/utils/config_test.js @@ -778,6 +778,7 @@ describe('App.config', function () { var res = { /** core properties **/ + id: "pName__pFileName", name: 'pName', filename: 'pFileName', value: '',