You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jg...@apache.org on 2018/06/15 17:21:10 UTC

[ambari] branch branch-feature-AMBARI-14714-mpack-advisor updated: [AMBARI-24111] Enable configs originating from mpack advisor to be added (#1548)

This is an automated email from the ASF dual-hosted git repository.

jgolieb pushed a commit to branch branch-feature-AMBARI-14714-mpack-advisor
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714-mpack-advisor by this push:
     new c0af6ea  [AMBARI-24111] Enable configs originating from mpack advisor to be added (#1548)
c0af6ea is described below

commit c0af6ea8cced40c4d79279326c440d10b1d4a229
Author: Jason Golieb <j...@golieb.net>
AuthorDate: Fri Jun 15 13:21:07 2018 -0400

    [AMBARI-24111] Enable configs originating from mpack advisor to be added (#1548)
    
    * [AMBARI-24111] Enable configs originating from mpack advisor to be added.
    
    * Fixed unit test.
---
 ambari-web/app/utils/config.js       |  3 ++-
 ambari-web/test/utils/config_test.js | 11 ++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index d86a0bf..ee3b6d3 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -763,7 +763,7 @@ App.config = Em.Object.create({
    */
   getStepConfigForProperty: function (stepConfigs, fileName) {
     return stepConfigs.find(function (s) {
-      return s.get('configTypes').contains(App.config.getConfigTagFromFileName(fileName));
+      return !!s.get('configTypes')[App.config.getConfigTagFromFileName(fileName)];
     });
   },
 
@@ -797,6 +797,7 @@ App.config = Em.Object.create({
       serviceName: preDefinedServiceConfig.get('serviceName'),
       displayName: preDefinedServiceConfig.get('displayName'),
       configCategories: preDefinedServiceConfig.get('configCategories'),
+      configTypes: preDefinedServiceConfig.get('configTypes'),
       configs: configs || [],
       configGroups: configGroups || [],
       initConfigsLength: initConfigsLength || 0
diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js
index 05fa565..8050c2c 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -1500,8 +1500,17 @@ describe('App.config', function() {
   });
 
   describe('#getStepConfigForProperty', function () {
-    var input = [Em.Object.create({ configTypes: ['f1'] }), Em.Object.create({ configTypes: ['f2'] })];
+    var input = [
+      Em.Object.create({
+        configTypes: { f1: 'f1' }
+      }),
+      Em.Object.create({
+        configTypes: { f2: 'f2' }
+      })
+    ];
+    
     var output = input[0];
+
     it('returns stepConfig for fileName', function () {
       expect(App.config.getStepConfigForProperty(input, 'f1')).to.eql(output);
     });

-- 
To stop receiving notification emails like this one, please contact
jgolieb@apache.org.