ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-20147. Not able to delete custom property (onechiporenko)
Date Mon, 27 Feb 2017 12:34:18 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 454e5a1ed -> d4c668c7b


AMBARI-20147. Not able to delete custom property (onechiporenko)


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

Branch: refs/heads/trunk
Commit: d4c668c7bb182b8e5e2e826b0864c80d092330c5
Parents: 454e5a1
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Mon Feb 27 12:46:52 2017 +0200
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Mon Feb 27 14:34:08 2017 +0200

----------------------------------------------------------------------
 .../mixins/common/configs/configs_comparator.js |  4 ++--
 .../configs/overriddenPropertyRow_view.js       | 21 ++++++++++++++------
 2 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d4c668c7/ambari-web/app/mixins/common/configs/configs_comparator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/configs_comparator.js b/ambari-web/app/mixins/common/configs/configs_comparator.js
index b619aca..4adc5ae 100644
--- a/ambari-web/app/mixins/common/configs/configs_comparator.js
+++ b/ambari-web/app/mixins/common/configs/configs_comparator.js
@@ -222,8 +222,8 @@ App.ConfigsComparator = Em.Mixin.create({
    * @method getMockComparisonConfig
    */
   getMockComparisonConfig: function (serviceConfig, compareServiceVersion) {
-    var compareObject = $.extend(true, {isComparison: false},  serviceConfig);
-    compareObject.setProperties({
+    var compareObject = $.extend(true, {isComparison: false}, serviceConfig);
+    Em.setProperties(compareObject, {
       isEditable: false,
       serviceVersion: App.ServiceConfigVersion.find(this.get('content.serviceName') + "_"
+ compareServiceVersion),
       isMock: true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/d4c668c7/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js b/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js
index 86e9c60..af65aee 100644
--- a/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js
+++ b/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js
@@ -67,14 +67,23 @@ App.ServiceConfigView.SCPOverriddenRowsView = Ember.View.extend({
   removeOverride: function (event) {
     // arg 1 SCP means ServiceConfigProperty
     var scpToBeRemoved = event.contexts[0];
-    var overrides = this.get('serviceConfigProperty.overrides');
+    var scp = this.get('serviceConfigProperty');
+    var overrides = scp.get('overrides');
+    var controller = this.get('controller');
+    var group = controller.get('selectedService.configGroups').findProperty('name', controller.get('selectedConfigGroup.name'));
     // remove override property from selectedService on installer 7-th step
-    if (this.get('controller.name') == 'wizardStep7Controller') {
-      var controller = this.get('controller');
-      var group = controller.get('selectedService.configGroups').findProperty('name', controller.get('selectedConfigGroup.name'));
+    if (this.get('controller.name') === 'wizardStep7Controller') {
       group.get('properties').removeObject(scpToBeRemoved);
     }
-    overrides = overrides.without(scpToBeRemoved);
-    this.set('serviceConfigProperty.overrides', overrides);
+    if (overrides) {
+      overrides = overrides.without(scpToBeRemoved);
+      this.set('serviceConfigProperty.overrides', overrides);
+    }
+    else {
+      if (scp.get('isUserProperty')) {
+        this.get('parentView.serviceConfigs').removeObject(scpToBeRemoved);
+        this.get('parentView.categoryConfigsAll').removeObject(scpToBeRemoved);
+      }
+    }
   }
 });
\ No newline at end of file


Mime
View raw message