Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 6a6281937 -> 67b0d5e2f


AMBARI-17491 Hive Database URL config updated by Ambari stack advisor 
recommendation. (ababiichuk)


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

Branch: refs/heads/branch-2.4
Commit: 67b0d5e2f0525abccbdaa5e2015c01b3baa68a71
Parents: 6a62819
Author: ababiichuk <[email protected]>
Authored: Thu Jun 30 11:25:24 2016 +0300
Committer: ababiichuk <[email protected]>
Committed: Thu Jun 30 11:25:24 2016 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/item.js | 26 +++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/67b0d5e2/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js 
b/ambari-web/app/controllers/main/service/item.js
index 79188aa..f551168 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -1454,13 +1454,33 @@ App.MainServiceItemController = 
Em.Controller.extend(App.SupportClientConfigsDow
 
   /**
    * Describes condition when recommendation should be applied
-   * For removing services it's always true
-   * This property required for request for recommendations
+   * Unfortunately for removing services it's not always true
+   * Property should be updated only if it depends on service that will be 
removed
+   * (similar as on add service)
    *
    * @return {Boolean}
    * @override
    */
-  allowUpdateProperty: function() { return true; },
+  allowUpdateProperty: function (parentProperties, name, fileName) {
+    var stackProperty = App.configsCollection.getConfigByName(name, fileName);
+    if (!stackProperty || (stackProperty.serviceName === 
this.get('content.serviceName'))) {
+      /**
+       * update properties for current service (in case will be used not only 
for removing service)
+       * and properties that are not defined in stack
+       */
+      return true;
+    }
+    if (stackProperty.propertyDependsOn.length) {
+      /**
+       * update properties that depends on current service
+       */
+      return !!stackProperty.propertyDependsOn.filter(function (p) {
+        var service = App.config.get('serviceByConfigTypeMap')[p.type];
+        return service && (this.get('content.serviceName') === 
service.get('serviceName'));
+      }, this).length;
+    }
+    return false;
+  },
 
   /**
    * Just config version note

Reply via email to