ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-19821 Recommendations for non-editable properties should be listed as 'Required Changes'. (ababiichuk)
Date Wed, 01 Feb 2017 17:32:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 144449cba -> 0ec0597d3


AMBARI-19821 Recommendations for non-editable properties should be listed as 'Required Changes'.
(ababiichuk)


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

Branch: refs/heads/trunk
Commit: 0ec0597d37abb22f5a21408fe24af3c7b64b2c9d
Parents: 144449c
Author: ababiichuk <ababiichuk@hortonworks.com>
Authored: Wed Feb 1 18:37:42 2017 +0200
Committer: ababiichuk <ababiichuk@hortonworks.com>
Committed: Wed Feb 1 19:41:10 2017 +0200

----------------------------------------------------------------------
 .../configs/config_recommendation_parser.js     |   6 +-
 .../common/configs/config_recommendations.js    |  11 +-
 ...onfig_with_override_recommendation_parser.js |   3 +-
 .../mixins/common/configs/enhanced_configs.js   |   6 +-
 .../dependent_configs_list_popup.js             |  12 +-
 .../configs/config_recommendations_test.js      | 600 ++++++++++---------
 .../common/configs/enhanced_configs_test.js     |   2 +-
 .../dependent_configs_list_popup_test.js        |   2 +-
 8 files changed, 337 insertions(+), 305 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0ec0597d/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/config_recommendation_parser.js b/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
index b014ede..b8845a0 100644
--- a/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
+++ b/ambari-web/app/mixins/common/configs/config_recommendation_parser.js
@@ -173,7 +173,7 @@ App.ConfigRecommendationParser = Em.Mixin.create(App.ConfigRecommendations,
{
       if (!Em.isNone(recommendedValue) && !Em.get(config, 'hiddenBySection')) {
         Em.set(config, 'isVisible', true);
       }
-      this.applyRecommendation(Em.get(config, 'name'), Em.get(config, 'filename'), Em.get(config,
'group.name'), recommendedValue, this._getInitialValue(config), parentProperties);
+      this.applyRecommendation(Em.get(config, 'name'), Em.get(config, 'filename'), Em.get(config,
'group.name'), recommendedValue, this._getInitialValue(config), parentProperties, Em.get(config,
'isEditable'));
     }
     if (this.updateInitialOnRecommendations(Em.get(config, 'serviceName'))) {
       Em.set(config, 'initialValue', recommendedValue);
@@ -202,7 +202,7 @@ App.ConfigRecommendationParser = Em.Mixin.create(App.ConfigRecommendations,
{
       addedPropertyObject = App.ServiceConfigProperty.create(newConfig);
 
     this.applyRecommendation(name, fileName, "Default",
-      recommendedValue, null, parentProperties);
+      recommendedValue, null, parentProperties, true);
 
     return addedPropertyObject;
   },
@@ -245,7 +245,7 @@ App.ConfigRecommendationParser = Em.Mixin.create(App.ConfigRecommendations,
{
     configsCollection.removeObject(config);
 
     this.applyRecommendation(Em.get(config, 'name'), Em.get(config, 'filename'), Em.get(config,
'group.name'),
-      null, this._getInitialValue(config), parentProperties);
+      null, this._getInitialValue(config), parentProperties, Em.get(config, 'isEditable'));
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ec0597d/ambari-web/app/mixins/common/configs/config_recommendations.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/config_recommendations.js b/ambari-web/app/mixins/common/configs/config_recommendations.js
index 7427a54..bccf3b7 100644
--- a/ambari-web/app/mixins/common/configs/config_recommendations.js
+++ b/ambari-web/app/mixins/common/configs/config_recommendations.js
@@ -54,16 +54,17 @@ App.ConfigRecommendations = Em.Mixin.create({
    * @param {string} recommendedValue
    * @param {string} initialValue
    * @param {Object[]} parentProperties
+   * @param {boolean} isEditable
    * @returns {recommendation}
    */
-  applyRecommendation: function (name, fileName, configGroupName, recommendedValue, initialValue,
parentProperties) {
+  applyRecommendation: function (name, fileName, configGroupName, recommendedValue, initialValue,
parentProperties, isEditable) {
     try {
       var parentPropertyIds = this.formatParentProperties(parentProperties);
       var recommendation = this.getRecommendation(name, fileName, configGroupName);
       if (recommendation) {
         return this.updateRecommendation(recommendation, recommendedValue, parentPropertyIds);
       }
-      return this.addRecommendation(name, fileName, configGroupName, recommendedValue, initialValue,
parentPropertyIds);
+      return this.addRecommendation(name, fileName, configGroupName, recommendedValue, initialValue,
parentPropertyIds, isEditable);
     } catch(e) {
       console.error(e.message);
     }
@@ -90,9 +91,10 @@ App.ConfigRecommendations = Em.Mixin.create({
    * @param {string} recommendedValue
    * @param {string} initialValue
    * @param {string[]} parentPropertyIds
+   * @param {boolean} isEditable
    * @returns {recommendation}
    */
-  addRecommendation: function (name, fileName, configGroupName, recommendedValue, initialValue,
parentPropertyIds) {
+  addRecommendation: function (name, fileName, configGroupName, recommendedValue, initialValue,
parentPropertyIds, isEditable) {
     Em.assert('name and fileName should be defined', name && fileName);
     var site = App.config.getConfigTagFromFileName(fileName);
     var service = App.config.get('serviceByConfigTypeMap')[site];
@@ -113,7 +115,8 @@ App.ConfigRecommendations = Em.Mixin.create({
       allowChangeGroup: false,//TODO groupName!= "Default" && (service.get('serviceName')
!= this.get('selectedService.serviceName'))
       //TODO&& (App.ServiceConfigGroup.find().filterProperty('serviceName', service.get('serviceName')).length
> 1), //TODO
       serviceDisplayName: service.get('displayName'),
-      recommendedValue: recommendedValue
+      recommendedValue: recommendedValue,
+      isEditable: isEditable !== false
     };
     this.get('recommendations').pushObject(recommendation);
     return recommendation;

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ec0597d/ambari-web/app/mixins/common/configs/config_with_override_recommendation_parser.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/config_with_override_recommendation_parser.js
b/ambari-web/app/mixins/common/configs/config_with_override_recommendation_parser.js
index 86ccb65..732cf60 100644
--- a/ambari-web/app/mixins/common/configs/config_with_override_recommendation_parser.js
+++ b/ambari-web/app/mixins/common/configs/config_with_override_recommendation_parser.js
@@ -98,7 +98,8 @@ App.ConfigWithOverrideRecommendationParser = Em.Mixin.create(App.ConfigRecommend
                              configGroup.get('name'),
                              recommendedValue,
                              this._getInitialValue(override),
-                             parentProperties);
+                             parentProperties,
+                             Em.get(config, 'isEditable'));
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ec0597d/ambari-web/app/mixins/common/configs/enhanced_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/enhanced_configs.js b/ambari-web/app/mixins/common/configs/enhanced_configs.js
index c86f132..4561f77 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -462,9 +462,11 @@ App.EnhancedConfigsMixin = Em.Mixin.create(App.ConfigWithOverrideRecommendationP
    */
   showChangedDependentConfigs: function(event, callback, secondary) {
     var self = this;
-    var recommendations = event ? this.get('changedProperties') : this.get('recommendations');
+    var recommendations = event ? this.get('changedProperties') : this.get('recommendations'),
+      recommendedChanges = recommendations.filterProperty('isEditable'),
+      requiredChanges = recommendations.filterProperty('isEditable', false);
     if (recommendations.length > 0) {
-      App.showDependentConfigsPopup(recommendations, function() {
+      App.showDependentConfigsPopup(recommendedChanges, requiredChanges, function() {
         self.onSaveRecommendedPopup(recommendations);
         if (callback) callback();
       }, secondary);

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ec0597d/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js b/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
index ffb3add..24c7577 100644
--- a/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
+++ b/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
@@ -66,13 +66,14 @@ App.DependentConfigsListView = Em.View.extend({
 
 /**
  * Show confirmation popup
- * @param {[Object]} recommendations
+ * @param {[Object]} recommendedChanges
+ * @param {[Object]} requiredChanges
  * @param {function} [primary=null]
  * @param {function} [secondary=null]
  * we use this parameter to defer saving configs before we make some decisions.
  * @return {App.ModalPopup}
  */
-App.showDependentConfigsPopup = function (recommendations, primary, secondary) {
+App.showDependentConfigsPopup = function (recommendedChanges, requiredChanges, primary, secondary)
{
   return App.ModalPopup.show({
     encodeBody: false,
     header: Em.I18n.t('popup.dependent.configs.header'),
@@ -80,15 +81,16 @@ App.showDependentConfigsPopup = function (recommendations, primary, secondary)
{
     modalDialogClasses: ['modal-lg'],
     secondaryClass: 'cancel-button',
     bodyClass: App.DependentConfigsListView.extend({
-      recommendations: recommendations
+      recommendations: recommendedChanges,
+      requiredChanges: requiredChanges
     }),
     saveChanges: function() {
-      recommendations.forEach(function (c) {
+      recommendedChanges.forEach(function (c) {
         Em.set(c, 'saveRecommendedDefault', Em.get(c, 'saveRecommended'));
       })
     },
     discardChanges: function() {
-      recommendations.forEach(function(c) {
+      recommendedChanges.forEach(function(c) {
         Em.set(c, 'saveRecommended', Em.get(c, 'saveRecommendedDefault'));
       });
     },

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ec0597d/ambari-web/test/mixins/common/configs/config_recommendations_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/configs/config_recommendations_test.js b/ambari-web/test/mixins/common/configs/config_recommendations_test.js
index baa8ed6..a72f6d3 100644
--- a/ambari-web/test/mixins/common/configs/config_recommendations_test.js
+++ b/ambari-web/test/mixins/common/configs/config_recommendations_test.js
@@ -19,29 +19,29 @@
 var App = require('app');
 
 describe('App.ConfigRecommendations', function() {
-	var mixinObject = Em.Controller.extend(App.ConfigRecommendations, {});
-	var instanceObject = mixinObject.create({});
+  var mixinObject = Em.Controller.extend(App.ConfigRecommendations, {});
+  var instanceObject = mixinObject.create({});
 
-	beforeEach(function() {
-		instanceObject.set('recommendations', []);
-	});
+  beforeEach(function() {
+    instanceObject.set('recommendations', []);
+  });
 
-	describe('#applyRecommendation', function() {
+  describe('#applyRecommendation', function() {
     beforeEach(function() {
       sinon.stub(instanceObject, 'formatParentProperties', function(parentProperties) { return
parentProperties} );
       sinon.stub(App.config, 'get').withArgs('serviceByConfigTypeMap').returns({
         'pFile': Em.Object.create({serviceName: 'sName', displayName: 'sDisplayName'})
       });
-	  sinon.stub(Handlebars, 'SafeString');
+    sinon.stub(Handlebars, 'SafeString');
     });
     afterEach(function() {
       instanceObject.formatParentProperties.restore();
       App.config.get.restore();
-	  Handlebars.SafeString.restore();
+    Handlebars.SafeString.restore();
     });
 
     it('adds new recommendation', function() {
-      var res = instanceObject.applyRecommendation('pName', 'pFile', 'pGroup', 'pRecommended',
'pInitial', ['p_id']);
+      var res = instanceObject.applyRecommendation('pName', 'pFile', 'pGroup', 'pRecommended',
'pInitial', ['p_id'], true);
       expect(res).to.eql({
         saveRecommended: true,
         saveRecommendedDefault: true,
@@ -56,26 +56,27 @@ describe('App.ConfigRecommendations', function() {
         allowChangeGroup: false,
         serviceDisplayName: 'sDisplayName',
         recommendedValue: 'pRecommended',
+        isEditable: true
       });
       expect(instanceObject.getRecommendation('pName', 'pFile', 'pGroup')).to.eql(res);
     });
 
     it('updates recommendation', function() {
-			instanceObject.set('recommendations', [{
-				saveRecommended: true,
-				saveRecommendedDefault: true,
-				propertyFileName: 'pFile',
-				propertyName: 'pName',
-				isDeleted: false,
-				notDefined: false,
-				configGroup: 'pGroup',
-				initialValue: 'pInitial',
-				parentConfigs: ['p_id'],
-				serviceName: 'sName',
-				allowChangeGroup: false,
-				serviceDisplayName: 'sDisplayName',
-				recommendedValue: 'pRecommended'
-			}]);
+      instanceObject.set('recommendations', [{
+        saveRecommended: true,
+        saveRecommendedDefault: true,
+        propertyFileName: 'pFile',
+        propertyName: 'pName',
+        isDeleted: false,
+        notDefined: false,
+        configGroup: 'pGroup',
+        initialValue: 'pInitial',
+        parentConfigs: ['p_id'],
+        serviceName: 'sName',
+        allowChangeGroup: false,
+        serviceDisplayName: 'sDisplayName',
+        recommendedValue: 'pRecommended'
+      }]);
       expect(instanceObject.applyRecommendation('pName', 'pFile', 'pGroup', 'pRecommended1',
'pInitial', ['p_id1'])).to.eql({
         saveRecommended: true,
         saveRecommendedDefault: true,
@@ -92,7 +93,7 @@ describe('App.ConfigRecommendations', function() {
         recommendedValue: 'pRecommended1'
       });
     });
-	});
+  });
 
   describe('#formatParentProperties', function() {
     beforeEach(function() {
@@ -111,152 +112,175 @@ describe('App.ConfigRecommendations', function() {
     });
   });
 
-	describe('#addRecommendation', function() {
-		var cases = [
-			{
-				title: 'add recommendation with full info',
-				name: 'pName', file: 'pFile.xml', group: 'pGroup', recommended: 'pRecommended', initial:
'pInitial', parent: ['p_id'],
-				service: Em.Object.create({serviceName: 'sName', displayName: 'sDisplayName'}),
-				result: {
-					saveRecommended: true,
-					saveRecommendedDefault: true,
-					propertyFileName: 'pFile',
-					propertyName: 'pName',
-					isDeleted: false,
-					notDefined: false,
-					configGroup: 'pGroup',
-					initialValue: 'pInitial',
-					parentConfigs: ['p_id'],
-					serviceName: 'sName',
-					allowChangeGroup: false,
-					serviceDisplayName: 'sDisplayName',
-					recommendedValue: 'pRecommended'
-				}
-			},
-			{
-				title: 'add recommendation with min info',
-				name: 'pName', file: 'pFile.xml',
-				service: Em.Object.create({serviceName: 'sName', displayName: 'sDisplayName'}),
-				result: {
-					saveRecommended: true,
-					saveRecommendedDefault: true,
-					propertyFileName: 'pFile',
-					propertyName: 'pName',
-					isDeleted: true,
-					notDefined: true,
-					configGroup: 'Default',
-					initialValue: undefined,
-					parentConfigs: [],
-					serviceName: 'sName',
-					allowChangeGroup: false,
-					serviceDisplayName: 'sDisplayName',
-					recommendedValue: undefined
-				}
-			}
-		];
-		cases.forEach(function(c) {
-			describe('successful add recommendation', function() {
-				var recommendation;
-				beforeEach(function() {
-					instanceObject.set('recommendations', []);
-					sinon.stub(App.config, 'get').withArgs('serviceByConfigTypeMap').returns({
-						'pFile': c.service
-					});
-					sinon.stub(Handlebars, 'SafeString');
-					recommendation = instanceObject.addRecommendation(c.name, c.file, c.group, c.recommended,
c.initial, c.parent);
-				});
-
-				afterEach(function() {
-					App.config.get.restore();
-					Handlebars.SafeString.restore();
-				});
-
-				it(c.title, function() {
-					expect(recommendation).to.eql(c.result);
-				});
-
-				it(c.title + ' check recommendations collection', function() {
-					expect(instanceObject.get('recommendations.0')).to.eql(c.result);
-				});
-			})
-		});
-
-		it('throw exception when name, fileName', function() {
-			expect(instanceObject.addRecommendation.bind()).to.throw(Error, 'name and fileName should
be defined');
-			expect(instanceObject.addRecommendation.bind(null, 'fname')).to.throw(Error, 'name and
fileName should be defined');
-			expect(instanceObject.addRecommendation.bind('name', null)).to.throw(Error, 'name and
fileName should be defined');
-		});
-	});
-
-	describe('#removeRecommendationObject', function () {
-		var recommendations = [
-			{
-				propertyName: 'p1',
-				propertyFileName: 'f1'
-			},
-			{
-				propertyName: 'p2',
-				propertyFileName: 'f2'
-			}
-		];
-
-		beforeEach(function () {
-			instanceObject.set('recommendations', recommendations);
-		});
-
-		it('remove recommendation', function () {
-			instanceObject.removeRecommendationObject(recommendations[1]);
-
-			expect(instanceObject.get('recommendations.length')).to.equal(1);
-			expect(instanceObject.get('recommendations.0')).to.eql({
-				propertyName: 'p1',
-				propertyFileName: 'f1'
-			});
-		});
-
-		it('remove recommendation that is not exist (don\'t do anything)', function () {
-			instanceObject.removeRecommendationObject({propertyName: 'any', 'propertyFileName': 'aby'});
-			expect(instanceObject.get('recommendations')).to.eql(recommendations);
-		});
-
-		it('throw error if recommendation is undefined ', function () {
-			expect(instanceObject.removeRecommendationObject.bind()).to.throw(Error, 'recommendation
should be defined object');
-			expect(instanceObject.removeRecommendationObject.bind(null)).to.throw(Error, 'recommendation
should be defined object');
-		});
-
-		it('throw error if recommendation is not an object ', function () {
-			expect(instanceObject.removeRecommendationObject.bind('recommendation')).to.throw(Error,
'recommendation should be defined object');
-			expect(instanceObject.removeRecommendationObject.bind(['recommendation'])).to.throw(Error,
'recommendation should be defined object');
-		});
-	});
-
-	describe('#updateRecommendation', function () {
-		it('update recommended value and parent properties', function () {
-			expect(instanceObject.updateRecommendation({'recommendedValue': 'v2', parentConfigs: ['id1']},
'v1', ['id2']))
-				.to.eql({'recommendedValue': 'v1', parentConfigs: ['id2', 'id1']});
-		});
-
-		it('update recommended value and add parent properties', function () {
-			expect(instanceObject.updateRecommendation({}, 'v1', ['id1'])).to.eql({'recommendedValue':
'v1', parentConfigs: ['id1']});
-		});
-
-		it('update recommended value', function () {
-			expect(instanceObject.updateRecommendation({}, 'v1')).to.eql({'recommendedValue': 'v1'});
-			expect(instanceObject.updateRecommendation({'recommendedValue': 'v1'}, 'v2')).to.eql({'recommendedValue':
'v2'});
-		});
-
-		it('throw error if recommendation is undefined ', function () {
-			expect(instanceObject.updateRecommendation.bind()).to.throw(Error, 'recommendation should
be defined object');
-			expect(instanceObject.updateRecommendation.bind(null)).to.throw(Error, 'recommendation
should be defined object');
-		});
-
-		it('throw error if recommendation is not an object ', function () {
-			expect(instanceObject.updateRecommendation.bind('recommendation')).to.throw(Error, 'recommendation
should be defined object');
-			expect(instanceObject.updateRecommendation.bind(['recommendation'])).to.throw(Error, 'recommendation
should be defined object');
-		});
-	});
-
-	describe('#saveRecommendation', function() {
+  describe('#addRecommendation', function() {
+    var cases = [
+      {
+        title: 'add recommendation for editable property with full info',
+        name: 'pName', file: 'pFile.xml', group: 'pGroup', recommended: 'pRecommended', initial:
'pInitial', parent: ['p_id'], isEditable: true,
+        service: Em.Object.create({serviceName: 'sName', displayName: 'sDisplayName'}),
+        result: {
+          saveRecommended: true,
+          saveRecommendedDefault: true,
+          propertyFileName: 'pFile',
+          propertyName: 'pName',
+          isDeleted: false,
+          notDefined: false,
+          configGroup: 'pGroup',
+          initialValue: 'pInitial',
+          parentConfigs: ['p_id'],
+          serviceName: 'sName',
+          allowChangeGroup: false,
+          serviceDisplayName: 'sDisplayName',
+          recommendedValue: 'pRecommended',
+          isEditable: true
+        }
+      },
+      {
+        title: 'add recommendation for read-only property with full info',
+        name: 'pName', file: 'pFile.xml', group: 'pGroup', recommended: 'pRecommended', initial:
'pInitial', parent: ['p_id'], isEditable: false,
+        service: Em.Object.create({serviceName: 'sName', displayName: 'sDisplayName'}),
+        result: {
+          saveRecommended: true,
+          saveRecommendedDefault: true,
+          propertyFileName: 'pFile',
+          propertyName: 'pName',
+          isDeleted: false,
+          notDefined: false,
+          configGroup: 'pGroup',
+          initialValue: 'pInitial',
+          parentConfigs: ['p_id'],
+          serviceName: 'sName',
+          allowChangeGroup: false,
+          serviceDisplayName: 'sDisplayName',
+          recommendedValue: 'pRecommended',
+          isEditable: false
+        }
+      },
+      {
+        title: 'add recommendation with min info',
+        name: 'pName', file: 'pFile.xml',
+        service: Em.Object.create({serviceName: 'sName', displayName: 'sDisplayName'}),
+        result: {
+          saveRecommended: true,
+          saveRecommendedDefault: true,
+          propertyFileName: 'pFile',
+          propertyName: 'pName',
+          isDeleted: true,
+          notDefined: true,
+          configGroup: 'Default',
+          initialValue: undefined,
+          parentConfigs: [],
+          serviceName: 'sName',
+          allowChangeGroup: false,
+          serviceDisplayName: 'sDisplayName',
+          recommendedValue: undefined,
+          isEditable: true
+        }
+      }
+    ];
+    cases.forEach(function(c) {
+      describe('successful add recommendation', function() {
+        var recommendation;
+        beforeEach(function() {
+          instanceObject.set('recommendations', []);
+          sinon.stub(App.config, 'get').withArgs('serviceByConfigTypeMap').returns({
+            'pFile': c.service
+          });
+          sinon.stub(Handlebars, 'SafeString');
+          recommendation = instanceObject.addRecommendation(c.name, c.file, c.group, c.recommended,
c.initial, c.parent, c.isEditable);
+        });
+
+        afterEach(function() {
+          App.config.get.restore();
+          Handlebars.SafeString.restore();
+        });
+
+        it(c.title, function() {
+          expect(recommendation).to.eql(c.result);
+        });
+
+        it(c.title + ' check recommendations collection', function() {
+          expect(instanceObject.get('recommendations.0')).to.eql(c.result);
+        });
+      })
+    });
+
+    it('throw exception when name, fileName', function() {
+      expect(instanceObject.addRecommendation.bind()).to.throw(Error, 'name and fileName
should be defined');
+      expect(instanceObject.addRecommendation.bind(null, 'fname')).to.throw(Error, 'name
and fileName should be defined');
+      expect(instanceObject.addRecommendation.bind('name', null)).to.throw(Error, 'name and
fileName should be defined');
+    });
+  });
+
+  describe('#removeRecommendationObject', function () {
+    var recommendations = [
+      {
+        propertyName: 'p1',
+        propertyFileName: 'f1'
+      },
+      {
+        propertyName: 'p2',
+        propertyFileName: 'f2'
+      }
+    ];
+
+    beforeEach(function () {
+      instanceObject.set('recommendations', recommendations);
+    });
+
+    it('remove recommendation', function () {
+      instanceObject.removeRecommendationObject(recommendations[1]);
+
+      expect(instanceObject.get('recommendations.length')).to.equal(1);
+      expect(instanceObject.get('recommendations.0')).to.eql({
+        propertyName: 'p1',
+        propertyFileName: 'f1'
+      });
+    });
+
+    it('remove recommendation that is not exist (don\'t do anything)', function () {
+      instanceObject.removeRecommendationObject({propertyName: 'any', 'propertyFileName':
'aby'});
+      expect(instanceObject.get('recommendations')).to.eql(recommendations);
+    });
+
+    it('throw error if recommendation is undefined ', function () {
+      expect(instanceObject.removeRecommendationObject.bind()).to.throw(Error, 'recommendation
should be defined object');
+      expect(instanceObject.removeRecommendationObject.bind(null)).to.throw(Error, 'recommendation
should be defined object');
+    });
+
+    it('throw error if recommendation is not an object ', function () {
+      expect(instanceObject.removeRecommendationObject.bind('recommendation')).to.throw(Error,
'recommendation should be defined object');
+      expect(instanceObject.removeRecommendationObject.bind(['recommendation'])).to.throw(Error,
'recommendation should be defined object');
+    });
+  });
+
+  describe('#updateRecommendation', function () {
+    it('update recommended value and parent properties', function () {
+      expect(instanceObject.updateRecommendation({'recommendedValue': 'v2', parentConfigs:
['id1']}, 'v1', ['id2']))
+        .to.eql({'recommendedValue': 'v1', parentConfigs: ['id2', 'id1']});
+    });
+
+    it('update recommended value and add parent properties', function () {
+      expect(instanceObject.updateRecommendation({}, 'v1', ['id1'])).to.eql({'recommendedValue':
'v1', parentConfigs: ['id1']});
+    });
+
+    it('update recommended value', function () {
+      expect(instanceObject.updateRecommendation({}, 'v1')).to.eql({'recommendedValue': 'v1'});
+      expect(instanceObject.updateRecommendation({'recommendedValue': 'v1'}, 'v2')).to.eql({'recommendedValue':
'v2'});
+    });
+
+    it('throw error if recommendation is undefined ', function () {
+      expect(instanceObject.updateRecommendation.bind()).to.throw(Error, 'recommendation
should be defined object');
+      expect(instanceObject.updateRecommendation.bind(null)).to.throw(Error, 'recommendation
should be defined object');
+    });
+
+    it('throw error if recommendation is not an object ', function () {
+      expect(instanceObject.updateRecommendation.bind('recommendation')).to.throw(Error,
'recommendation should be defined object');
+      expect(instanceObject.updateRecommendation.bind(['recommendation'])).to.throw(Error,
'recommendation should be defined object');
+    });
+  });
+
+  describe('#saveRecommendation', function() {
 
     it('skip update since values are same', function() {
       expect(instanceObject.saveRecommendation({saveRecommended: false, saveRecommendedDefault:
false}, false)).to.be.false;
@@ -282,122 +306,122 @@ describe('App.ConfigRecommendations', function() {
       expect(instanceObject.updateRecommendation.bind('recommendation')).to.throw(Error,
'recommendation should be defined object');
       expect(instanceObject.updateRecommendation.bind(['recommendation'])).to.throw(Error,
'recommendation should be defined object');
     });
-	});
-
-	describe('#getRecommendation', function () {
-		var recommendations = [
-			{
-				propertyName: 'p1',
-				propertyFileName: 'f1',
-				configGroup: 'Default'
-			},
-			{
-				propertyName: 'p2',
-				propertyFileName: 'f2',
-				configGroup: 'group1'
-			},
-			{
-				propertyName: 'p1',
-				propertyFileName: 'f1',
-				configGroup: 'group1'
-			}
-		];
-
-		beforeEach(function () {
-			instanceObject.set('recommendations', recommendations);
-		});
-
-		it('get recommendation for default group', function () {
-			expect(instanceObject.getRecommendation('p1', 'f1')).to.eql(recommendations[0]);
-		});
-
-		it('get recommendation for default group (2)', function () {
-			expect(instanceObject.getRecommendation('p1', 'f1', 'group1')).to.eql(recommendations[2]);
-		});
-
-		it('get recommendation for wrong group', function () {
-			expect(instanceObject.getRecommendation('p2', 'f2', 'group2')).to.equal(null);
-		});
-
-		it('get undefined recommendation', function () {
-			expect(instanceObject.getRecommendation('some', 'amy')).to.equal(null);
-		});
-
-		it('get throw error if undefined name or fileName passed', function () {
-			expect(instanceObject.getRecommendation.bind()).to.throw(Error, 'name and fileName should
be defined');
-			expect(instanceObject.getRecommendation.bind('name')).to.throw(Error, 'name and fileName
should be defined');
-			expect(instanceObject.getRecommendation.bind(null, 'fileName')).to.throw(Error, 'name
and fileName should be defined');
-		});
-	});
-
-	describe('#cleanUpRecommendations', function() {
-		var cases = [
-			{
-				title: 'remove recommendations with same init and recommended values',
-				recommendations: [{
-					initialValue: 'v1', recommendedValue: 'v1'
-				}, {
-						initialValue: 'v1', recommendedValue: 'v2'
-				}],
-				cleanUpRecommendations: [{
-					initialValue: 'v1', recommendedValue: 'v2'
-				}]
-			},
-			{
-				title: 'remove recommendations with null init and recommended values',
-				recommendations: [{
-					initialValue: null, recommendedValue: null
-				}, {
-					recommendedValue: null
-				}, {
-					initialValue: null
-				},{
-					initialValue: null, recommendedValue: 'v1'
-				}, {
-					initialValue: 'v1', recommendedValue: null
-				}],
-				cleanUpRecommendations: [{
-					initialValue: null, recommendedValue: 'v1'
-				}, {
-					initialValue: 'v1', recommendedValue: null
-				}
-				]
-			}
-		];
-
-		cases.forEach(function(c) {
-			describe(c.title, function() {
-				beforeEach(function() {
-					instanceObject.set('recommendations', c.recommendations);
-					instanceObject.cleanUpRecommendations()
-				});
-				it('do clean up', function() {
-					expect(instanceObject.get('recommendations')).to.eql(c.cleanUpRecommendations);
-				});
-			});
-		});
-	});
-
-	describe('#clearRecommendationsByServiceName', function () {
-		beforeEach(function () {
-			instanceObject.set('recommendations', [{serviceName: 's1'}, {serviceName: 's2'}, {serviceName:
's3'}]);
-		});
-
-		it('remove with specific service names ', function () {
-			instanceObject.clearRecommendationsByServiceName(['s2','s3']);
-			expect(instanceObject.get('recommendations')).to.eql([{serviceName: 's1'}]);
-		});
-	});
-
-	describe('#clearAllRecommendations', function () {
-		beforeEach(function () {
-			instanceObject.set('recommendations', [{anyObject: 'o1'}, {anyObject: 'o2'}]);
-		});
-
-		it('remove all recommendations', function () {
-			instanceObject.clearAllRecommendations();
-			expect(instanceObject.get('recommendations.length')).to.equal(0);
-		});
-	});
+  });
+
+  describe('#getRecommendation', function () {
+    var recommendations = [
+      {
+        propertyName: 'p1',
+        propertyFileName: 'f1',
+        configGroup: 'Default'
+      },
+      {
+        propertyName: 'p2',
+        propertyFileName: 'f2',
+        configGroup: 'group1'
+      },
+      {
+        propertyName: 'p1',
+        propertyFileName: 'f1',
+        configGroup: 'group1'
+      }
+    ];
+
+    beforeEach(function () {
+      instanceObject.set('recommendations', recommendations);
+    });
+
+    it('get recommendation for default group', function () {
+      expect(instanceObject.getRecommendation('p1', 'f1')).to.eql(recommendations[0]);
+    });
+
+    it('get recommendation for default group (2)', function () {
+      expect(instanceObject.getRecommendation('p1', 'f1', 'group1')).to.eql(recommendations[2]);
+    });
+
+    it('get recommendation for wrong group', function () {
+      expect(instanceObject.getRecommendation('p2', 'f2', 'group2')).to.equal(null);
+    });
+
+    it('get undefined recommendation', function () {
+      expect(instanceObject.getRecommendation('some', 'amy')).to.equal(null);
+    });
+
+    it('get throw error if undefined name or fileName passed', function () {
+      expect(instanceObject.getRecommendation.bind()).to.throw(Error, 'name and fileName
should be defined');
+      expect(instanceObject.getRecommendation.bind('name')).to.throw(Error, 'name and fileName
should be defined');
+      expect(instanceObject.getRecommendation.bind(null, 'fileName')).to.throw(Error, 'name
and fileName should be defined');
+    });
+  });
+
+  describe('#cleanUpRecommendations', function() {
+    var cases = [
+      {
+        title: 'remove recommendations with same init and recommended values',
+        recommendations: [{
+          initialValue: 'v1', recommendedValue: 'v1'
+        }, {
+            initialValue: 'v1', recommendedValue: 'v2'
+        }],
+        cleanUpRecommendations: [{
+          initialValue: 'v1', recommendedValue: 'v2'
+        }]
+      },
+      {
+        title: 'remove recommendations with null init and recommended values',
+        recommendations: [{
+          initialValue: null, recommendedValue: null
+        }, {
+          recommendedValue: null
+        }, {
+          initialValue: null
+        },{
+          initialValue: null, recommendedValue: 'v1'
+        }, {
+          initialValue: 'v1', recommendedValue: null
+        }],
+        cleanUpRecommendations: [{
+          initialValue: null, recommendedValue: 'v1'
+        }, {
+          initialValue: 'v1', recommendedValue: null
+        }
+        ]
+      }
+    ];
+
+    cases.forEach(function(c) {
+      describe(c.title, function() {
+        beforeEach(function() {
+          instanceObject.set('recommendations', c.recommendations);
+          instanceObject.cleanUpRecommendations()
+        });
+        it('do clean up', function() {
+          expect(instanceObject.get('recommendations')).to.eql(c.cleanUpRecommendations);
+        });
+      });
+    });
+  });
+
+  describe('#clearRecommendationsByServiceName', function () {
+    beforeEach(function () {
+      instanceObject.set('recommendations', [{serviceName: 's1'}, {serviceName: 's2'}, {serviceName:
's3'}]);
+    });
+
+    it('remove with specific service names ', function () {
+      instanceObject.clearRecommendationsByServiceName(['s2','s3']);
+      expect(instanceObject.get('recommendations')).to.eql([{serviceName: 's1'}]);
+    });
+  });
+
+  describe('#clearAllRecommendations', function () {
+    beforeEach(function () {
+      instanceObject.set('recommendations', [{anyObject: 'o1'}, {anyObject: 'o2'}]);
+    });
+
+    it('remove all recommendations', function () {
+      instanceObject.clearAllRecommendations();
+      expect(instanceObject.get('recommendations.length')).to.equal(0);
+    });
+  });
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ec0597d/ambari-web/test/mixins/common/configs/enhanced_configs_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/configs/enhanced_configs_test.js b/ambari-web/test/mixins/common/configs/enhanced_configs_test.js
index 0955a8f..c0d332c 100644
--- a/ambari-web/test/mixins/common/configs/enhanced_configs_test.js
+++ b/ambari-web/test/mixins/common/configs/enhanced_configs_test.js
@@ -1090,7 +1090,7 @@ describe('App.EnhancedConfigsMixin', function () {
     };
 
     beforeEach(function() {
-      sinon.stub(App, 'showDependentConfigsPopup', function(r, callback) {
+      sinon.stub(App, 'showDependentConfigsPopup', function(rec, req, callback) {
         callback();
       });
       sinon.stub(mixin, 'onSaveRecommendedPopup');

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ec0597d/ambari-web/test/views/common/modal_popups/dependent_configs_list_popup_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/modal_popups/dependent_configs_list_popup_test.js
b/ambari-web/test/views/common/modal_popups/dependent_configs_list_popup_test.js
index 9dc4bf6..b38666d 100644
--- a/ambari-web/test/views/common/modal_popups/dependent_configs_list_popup_test.js
+++ b/ambari-web/test/views/common/modal_popups/dependent_configs_list_popup_test.js
@@ -40,7 +40,7 @@ describe('App.showDependentConfigsPopup', function () {
     beforeEach(function () {
       this.ff = function () {};
       sinon.spy(this, 'ff');
-      view = App.showDependentConfigsPopup([], Em.K, this.ff);
+      view = App.showDependentConfigsPopup([], [], Em.K, this.ff);
     });
 
     afterEach(function () {


Mime
View raw message