You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2013/11/18 13:40:16 UTC
git commit: AMBARI-3794. Clicking +Exception in Default config-group
doesnt add new row. (akovalenko)
Updated Branches:
refs/heads/trunk b8f64b4ca -> d9043f014
AMBARI-3794. Clicking +Exception in Default config-group doesnt add new row. (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/d9043f01
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/d9043f01
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/d9043f01
Branch: refs/heads/trunk
Commit: d9043f014bb34bf81f0c1465162e059d7b80967f
Parents: b8f64b4
Author: Aleksandr Kovalenko <ol...@ukr.net>
Authored: Mon Nov 18 14:37:24 2013 +0200
Committer: Aleksandr Kovalenko <ol...@ukr.net>
Committed: Mon Nov 18 14:37:24 2013 +0200
----------------------------------------------------------------------
.../controllers/main/service/info/configs.js | 26 ++++++++++++++++++++
.../app/views/common/configs/services_config.js | 21 ++--------------
2 files changed, 28 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d9043f01/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 5e3e444..105f21d 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -33,6 +33,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
customConfig: [],
serviceConfigsData: require('data/service_configs'),
isApplyingChanges: false,
+ // contain Service Config Property, when user proceed from Select Config Group dialog
+ overrideToAdd: null,
serviceConfigs: function () {
return App.config.get('preDefinedServiceConfigs');
}.property('App.config.preDefinedServiceConfigs'),
@@ -628,6 +630,14 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
componentConfig.configs.pushObject(serviceConfigProperty);
serviceConfigProperty.validate();
}, this);
+ var overrideToAdd = this.get('overrideToAdd');
+ if (overrideToAdd) {
+ overrideToAdd = componentConfig.configs.findProperty('name', overrideToAdd.name);
+ if (overrideToAdd) {
+ this.addOverrideProperty(overrideToAdd);
+ this.set('overrideToAdd', null);
+ }
+ }
},
/**
@@ -1725,6 +1735,22 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
});
},
+ addOverrideProperty: function(serviceConfigProperty) {
+ var overrides = serviceConfigProperty.get('overrides');
+ if (!overrides) {
+ overrides = [];
+ serviceConfigProperty.set('overrides', overrides);
+ }
+ // create new override with new value
+ var newSCP = App.ServiceConfigProperty.create(serviceConfigProperty);
+ newSCP.set('value', '');
+ newSCP.set('isOriginalSCP', false); // indicated this is overridden value,
+ newSCP.set('parentSCP', serviceConfigProperty);
+ newSCP.set('isEditable', true);
+ console.debug("createOverrideProperty(): Added:", newSCP, " to main-property:", serviceConfigProperty);
+ overrides.pushObject(newSCP);
+ },
+
selectConfigGroup: function (event) {
this.set('selectedConfigGroup', event.context);
}
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/d9043f01/ambari-web/app/views/common/configs/services_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/services_config.js b/ambari-web/app/views/common/configs/services_config.js
index 0ffd5bf..3a501cb 100644
--- a/ambari-web/app/views/common/configs/services_config.js
+++ b/ambari-web/app/views/common/configs/services_config.js
@@ -488,7 +488,6 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
createOverrideProperty: function (event) {
var serviceConfigProperty = event.contexts[0];
- var self = this;
var serviceConfigController = this.get('controller');
var selectedConfigGroup = serviceConfigController.get('selectedConfigGroup');
if (selectedConfigGroup.get('isDefault')) {
@@ -497,29 +496,13 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
serviceConfigController.get('configGroups'), function (selectedGroupInPopup) {
console.log("launchConfigGroupSelectionCreationDialog(): Selected/Created:", selectedGroupInPopup);
if (selectedGroupInPopup) {
+ serviceConfigController.set('overrideToAdd', serviceConfigProperty);
serviceConfigController.set('selectedConfigGroup', selectedGroupInPopup);
- self.addOverrideProperty(serviceConfigProperty);
}
});
} else {
- this.addOverrideProperty(serviceConfigProperty);
- }
- },
-
- addOverrideProperty: function(serviceConfigProperty) {
- var overrides = serviceConfigProperty.get('overrides');
- if (!overrides) {
- overrides = [];
- serviceConfigProperty.set('overrides', overrides);
+ serviceConfigController.addOverrideProperty(serviceConfigProperty);
}
- // create new override with new value
- var newSCP = App.ServiceConfigProperty.create(serviceConfigProperty);
- newSCP.set('value', '');
- newSCP.set('isOriginalSCP', false); // indicated this is overridden value,
- newSCP.set('parentSCP', serviceConfigProperty);
- newSCP.set('isEditable', true);
- console.debug("createOverrideProperty(): Added:", newSCP, " to main-property:", serviceConfigProperty);
- overrides.pushObject(newSCP);
},
showOverrideWindow: function (event) {