ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-3872. Properties with checkboxes are always checked. (akovalenko)
Date Mon, 25 Nov 2013 15:35:28 GMT
Updated Branches:
  refs/heads/trunk c4f264ac5 -> d1804acc8


AMBARI-3872. Properties with checkboxes are always checked. (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d1804acc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d1804acc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d1804acc

Branch: refs/heads/trunk
Commit: d1804acc846b32bee1739e6ae0e0da76714083f7
Parents: c4f264a
Author: Aleksandr Kovalenko <oleksandr.kovalenko@ukr.net>
Authored: Mon Nov 25 17:34:19 2013 +0200
Committer: Aleksandr Kovalenko <oleksandr.kovalenko@ukr.net>
Committed: Mon Nov 25 17:34:19 2013 +0200

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    | 20 ++++++++++++++++----
 ambari-web/app/utils/config.js                  |  4 ++--
 ambari-web/app/views/wizard/controls_view.js    |  6 +++++-
 3 files changed, 23 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1804acc/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 0a18dd0..ef85afd 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -558,6 +558,18 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
       if (_serviceConfigProperty.isOverridable === undefined) {
         _serviceConfigProperty.isOverridable = true;
       }
+      if (_serviceConfigProperty.displayType === 'checkbox') {
+        switch (_serviceConfigProperty.value) {
+          case 'true':
+            _serviceConfigProperty.value = true;
+            _serviceConfigProperty.defaultValue = true;
+            break;
+          case 'false':
+            _serviceConfigProperty.value = false;
+            _serviceConfigProperty.defaultValue = false;
+            break;
+        }
+      }
       var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
       var propertyName = serviceConfigProperty.get('name');
       if (restartData != null && propertyName in restartData.propertyToHostAndComponent)
{
@@ -603,13 +615,13 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         serviceConfigProperty.set('isVisible', false);
       }
       if (overrides != null) {
-        for (var overridenValue in overrides) {
+        overrides.forEach(function (override) {
           var newSCP = App.ServiceConfigProperty.create(_serviceConfigProperty);
-          newSCP.set('value', overridenValue);
+          newSCP.set('value', override.value);
           newSCP.set('isOriginalSCP', false); // indicated this is overridden value,
           newSCP.set('parentSCP', serviceConfigProperty);
           if (App.supports.hostOverrides && defaultGroupSelected) {
-            newSCP.set('group', overrides[overridenValue]);
+            newSCP.set('group', override.group);
             newSCP.set('isEditable', false);
           }
           var parentOverridesArray = serviceConfigProperty.get('overrides');
@@ -619,7 +631,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
           }
           parentOverridesArray.pushObject(newSCP);
           console.debug("createOverrideProperty(): Added:", newSCP, " to main-property:",
serviceConfigProperty)
-        }
+        }, this)
       }
       if (App.get('isAdmin')) {
         if(defaultGroupSelected && !this.get('isHostsConfigsPage')){

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1804acc/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 01eaba5..80d00af 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -779,10 +779,10 @@ App.config = Em.Object.create({
           // Value of this property is different for this host.
           var overrides = 'overrides';
           if (!(overrides in serviceConfig)) {
-            serviceConfig.overrides = {};
+            serviceConfig.overrides = [];
           }
           console.log("loadServiceConfigHostsOverrides(): [" + group + "] OVERRODE(" + serviceConfig.name
+ "): " + serviceConfig.value + " -> " + hostOverrideValue);
-          serviceConfig.overrides[hostOverrideValue] = group;
+          serviceConfig.overrides.push({value: hostOverrideValue, group: group});
         }
       }
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1804acc/ambari-web/app/views/wizard/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/controls_view.js b/ambari-web/app/views/wizard/controls_view.js
index 9f179ec..7f36c15 100644
--- a/ambari-web/app/views/wizard/controls_view.js
+++ b/ambari-web/app/views/wizard/controls_view.js
@@ -170,7 +170,11 @@ App.ServiceConfigBigTextArea = App.ServiceConfigTextArea.extend({
  */
 App.ServiceConfigCheckbox = Ember.Checkbox.extend(App.ServiceConfigPopoverSupport, {
 
-  checkedBinding: 'serviceConfig.value'
+  checkedBinding: 'serviceConfig.value',
+
+  disabled: function () {
+    return !this.get('serviceConfig.isEditable');
+  }.property('serviceConfig.isEditable')
 });
 
 App.ServiceConfigRadioButtons = Ember.View.extend({


Mime
View raw message