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 13:17:34 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 f849d527e -> 2c16e73d8


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/2c16e73d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2c16e73d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2c16e73d

Branch: refs/heads/branch-2.5
Commit: 2c16e73d89676769705c8711c33cbfc65fca8d2d
Parents: f849d52
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 15:17:30 2017 +0200

----------------------------------------------------------------------
 .../configs/overriddenPropertyRow_view.js       | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2c16e73d/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