Repository: ambari
Updated Branches:
  refs/heads/trunk 28ad60ea5 -> 8595774b5


AMBARI-17852 TDE encryption didnt happen as key wasnt created. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 8595774b59ba514213f2ccab20c6cb334ab3cdd6
Parents: 28ad60e
Author: ababiichuk <[email protected]>
Authored: Fri Jul 22 15:06:48 2016 +0300
Committer: ababiichuk <[email protected]>
Committed: Fri Jul 22 18:36:14 2016 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step7_controller.js  | 10 +++++---
 .../mixins/common/configs/enhanced_configs.js   | 25 +++++++++++++++++++-
 .../test/controllers/wizard/step7_test.js       |  2 +-
 3 files changed, 32 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8595774b/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index 62a48d7..fcb5c0b 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -297,7 +297,8 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
       configValidationGlobalMessage: [],
       submitButtonClicked: false,
       isSubmitDisabled: true,
-      isRecommendedLoaded: false
+      isRecommendedLoaded: false,
+      initialRecommendations: []
     });
     this.get('stepConfigs').clear();
     this.set('filter', '');
@@ -568,10 +569,13 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
   },
 
   completeConfigLoading: function() {
-    
this.clearRecommendationsByServiceName(App.StackService.find().filterProperty('isSelected').mapProperty('serviceName'));
+    
this.clearRecommendationsByServiceName(App.StackService.find().filter(function 
(s) {
+      return s.get('isSelected') && !s.get('isInstalled');
+    }).mapProperty('serviceName'));
+    this.saveInitialRecommendations();
+    this.set('isRecommendedLoaded', true);
     console.timeEnd('loadConfigRecommendations execution time: ');
     console.timeEnd('wizard loadStep: ');
-    this.set('isRecommendedLoaded', true);
     if (this.get('content.skipConfigStep')) {
       App.router.send('next');
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/8595774b/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 4436cbb..923734d 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -43,6 +43,13 @@ App.EnhancedConfigsMixin = 
Em.Mixin.create(App.ConfigWithOverrideRecommendationP
   recommendationsConfigs: null,
 
   /**
+   * list of recommendations that should be applied without any config changes
+   *
+   * @type {Object[]}
+   */
+  initialRecommendations: [],
+
+  /**
    * flag is true when Ambari changes some of the dependent properties
    * @type {boolean}
    */
@@ -273,8 +280,18 @@ App.EnhancedConfigsMixin = 
Em.Mixin.create(App.ConfigWithOverrideRecommendationP
   loadRecommendationsSuccess: function (data, opt, params) {
     this._saveRecommendedValues(data, 
params.dataToSend.changed_configurations);
     if (this.isConfigHasInitialState()) {
+      /** clearing all recommendations info **/
       this.undoRedoRecommended(this.get('recommendations'), false);
       this.clearAllRecommendations();
+
+      /**
+       * resetting recommendations to initial state
+       * this case can be present when installed services depends on new added 
service on ADW
+       **/
+      this.undoRedoRecommended(this.get('initialRecommendations'), true);
+      this.get('initialRecommendations').forEach(function (r) {
+        this.get('recommendations').pushObject(r);
+      }, this);
     }
     this.set("recommendationsConfigs", Em.get(data, 
"resources.0.recommendations.blueprint.configurations"));
   },
@@ -393,7 +410,13 @@ App.EnhancedConfigsMixin = 
Em.Mixin.create(App.ConfigWithOverrideRecommendationP
       }
     }, this);
   },
-
+  
+  saveInitialRecommendations: function() {
+    this.get('recommendations').forEach(function (r) {
+      this.get('initialRecommendations').pushObject(r);
+    }, this);
+  },
+  
   /**
    * disable saving recommended value for current config
    * @param config

http://git-wip-us.apache.org/repos/asf/ambari/blob/8595774b/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js 
b/ambari-web/test/controllers/wizard/step7_test.js
index f54802e..271d340 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -997,7 +997,7 @@ describe('App.InstallerStep7Controller', function () {
               isSelected: false
             });
           },
-          filterProperty: function () {
+          filter: function () {
             return [];
           }
         }

Reply via email to