You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/11/12 13:59:02 UTC
[1/2] ambari git commit: AMBARI-13858 Clear configsCollection when it
needed. (ababiichuk)
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 <ab...@cybervisiontech.com>
Authored: Thu Nov 12 14:55:12 2015 +0200
Committer: aBabiichuk <ab...@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: '',
[2/2] ambari git commit: AMBARI-13857 Recommendation popup should
distinguish between empty value property and absent properties from current
configuration. (ababiichuk)
Posted by ab...@apache.org.
AMBARI-13857 Recommendation popup should distinguish between empty value property and absent properties from current configuration. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4da648d4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4da648d4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4da648d4
Branch: refs/heads/trunk
Commit: 4da648d4448a01361229f789457f3b970553474d
Parents: 696e58b
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Nov 12 14:53:52 2015 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Nov 12 14:58:57 2015 +0200
----------------------------------------------------------------------
ambari-web/app/messages.js | 2 ++
ambari-web/app/mixins/common/configs/enhanced_configs.js | 4 +++-
.../templates/common/modal_popups/dependent_configs_list.hbs | 8 +++++++-
3 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/4da648d4/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index d255877..b617863 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -390,6 +390,8 @@ Em.I18n.translations = {
'popup.dependent.configs.table.initValue': 'Initial value',
'popup.dependent.configs.table.currentValue': 'Current Value',
'popup.dependent.configs.table.recommendedValue': 'Recommended Value',
+ 'popup.dependent.configs.table.not.defined': 'Not Defined',
+
'popup.dependent.configs.select.config.group.header': 'Select Config Group',
'popup.dependent.configs.select.config.group': 'Please select to which config group would you like to save dependent properties',
http://git-wip-us.apache.org/repos/asf/ambari/blob/4da648d4/ambari-web/app/mixins/common/configs/enhanced_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/enhanced_configs.js b/ambari-web/app/mixins/common/configs/enhanced_configs.js
index fd50fa6..2e2a926 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -471,6 +471,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
if (!updateOnlyBoundaries && !parentPropertiesNames.contains(App.config.configId(propertyName, key)) && initialValue != recommendedValue) { //on first initial request we don't need to change values
if (dependentProperty) {
Em.set(dependentProperty, 'value', initialValue);
+ Em.set(dependentProperty, 'notDefined', Em.isNone(initialValue));
Em.set(dependentProperty, 'recommendedValue', recommendedValue);
Em.set(dependentProperty, 'toDelete', false); // handled in <code>saveRecommendedAttributes</code>
Em.set(dependentProperty, 'toAdd', isNewProperty);
@@ -486,6 +487,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
propertyName: propertyName,
configGroup: group ? group.get('name') : "",
value: initialValue,
+ notDefined: Em.isNone(initialValue),
parentConfigs: parentPropertiesNames,
serviceName: serviceName,
allowChangeGroup: !this.get('selectedService.isDefault') && service.get('serviceName') != stepConfig.get('serviceName') && stepConfig.get('configGroups.length') > 1,
@@ -591,7 +593,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
self.get('_dependentConfigValues').pushObject({
saveRecommended: true,
saveRecommendedDefault: true,
- propertyValue: cp && (self.useInitialValue(serviceName) ? cp.get('initialValue') : cp.get('savedValue')),
+ value: cp && (self.useInitialValue(serviceName) ? cp.get('initialValue') : cp.get('savedValue')),
toDelete: true,
toAdd: false,
isDeleted: true,
http://git-wip-us.apache.org/repos/asf/ambari/blob/4da648d4/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs b/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
index 7b7be9f..ca62592 100644
--- a/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
+++ b/ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
@@ -45,7 +45,13 @@
</a></span>
</td>
<td class="config-dependency-filename">{{config.fileName}}</td>
- <td class="config-dependency-value">{{config.value}}</td>
+ <td class="config-dependency-value">
+ {{#if config.notDefined}}
+ <i>{{t popup.dependent.configs.table.not.defined}}</i>
+ {{else}}
+ {{config.value}}
+ {{/if}}
+ </td>
<td class="config-dependency-recommended-value">
{{#if config.isDeleted}}
<i>{{t common.removed}}</i>