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-10202. Support config-groups functionality for enhanced-configs (onechiporenko)
Date Wed, 25 Mar 2015 16:08:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 008cc6bad -> 087c555f8


AMBARI-10202. Support config-groups functionality for enhanced-configs (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 087c555f8c9f5e40e8db773c6e795668430b1cce
Parents: 008cc6b
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Wed Mar 25 18:07:11 2015 +0200
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Wed Mar 25 18:07:11 2015 +0200

----------------------------------------------------------------------
 .../app/mappers/configs/config_versions_mapper.js    |  2 ++
 .../common/configs/service_config_layout_tab_view.js | 15 +++++++++++----
 .../configs/widgets/slider_config_widget_view.js     |  6 +++---
 .../widgets/slider_config_widget_view_test.js        |  8 ++++----
 4 files changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/087c555f/ambari-web/app/mappers/configs/config_versions_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/config_versions_mapper.js b/ambari-web/app/mappers/configs/config_versions_mapper.js
index b470320..aad5a3b 100644
--- a/ambari-web/app/mappers/configs/config_versions_mapper.js
+++ b/ambari-web/app/mappers/configs/config_versions_mapper.js
@@ -37,6 +37,7 @@ App.configVersionsMapper = App.QuickDataMapper.create({
   },
 
   map: function (json, isForCompare) {
+    console.time("App.configVersionsMapper execution time");
     var configVersions = [];
     var itemIds = {};
     var serviceToHostMap = {};
@@ -124,6 +125,7 @@ App.configVersionsMapper = App.QuickDataMapper.create({
 
       this.deleteUnusedProperties(requestedProperties);
     }
+    console.timeEnd("App.configVersionsMapper execution time");
   },
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/087c555f/ambari-web/app/views/common/configs/service_config_layout_tab_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_config_layout_tab_view.js b/ambari-web/app/views/common/configs/service_config_layout_tab_view.js
index e1db1ad..72e4139 100644
--- a/ambari-web/app/views/common/configs/service_config_layout_tab_view.js
+++ b/ambari-web/app/views/common/configs/service_config_layout_tab_view.js
@@ -44,18 +44,25 @@ App.ServiceConfigLayoutTabView = Em.View.extend({
   prepareConfigProperties: function () {
     var widgetTypeMap = this.get('widgetTypeMap');
     var self = this;
+    var serviceName = self.get('controller.content.serviceName');
     this.get('content.sectionRows').forEach(function (row) {
       row.forEach(function (section) {
         section.get('subsectionRows').forEach(function (subRow) {
           subRow.forEach(function (subsection) {
             subsection.set('configs', []);
             subsection.get('configProperties').forEach(function (config) {
-              var c = App.ConfigProperty.find(config.get('id') + '_' + self.get('controller.selectedVersion'));
-              subsection.get('configs').pushObject(c);
+
+              var service = self.get('controller.stepConfigs').findProperty('serviceName',
serviceName);
+              if (!service) return;
+              var configProperty = service.get('configs').findProperty('name', config.get('name'));
+              if (!configProperty) return;
+
+              subsection.get('configs').pushObject(configProperty);
               var configWidgetType = config.get('widget.type');
               var widget = widgetTypeMap[configWidgetType];
-              Em.assert('Unknown config widget view for config ' + c.get('id') + ' with type
' + configWidgetType, widget);
-              c.set('widget', widget);
+              Em.assert('Unknown config widget view for config ' + configProperty.get('id')
+ ' with type ' + configWidgetType, widget);
+              configProperty.set('widget', widget);
+              configProperty.set('stackConfigProperty', config);
             });
           });
         });

http://git-wip-us.apache.org/repos/asf/ambari/blob/087c555f/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
index f6c44c5..bfcc965 100644
--- a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
@@ -92,9 +92,9 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
       parseFunction = this.get('parseFunction');
     if (validationFunction(mirrorValue)) {
       var parsed = parseFunction(mirrorValue);
-      if (parsed >= min && parsed <=max) {
+      if (parsed >= min && parsed <= max) {
         this.set('isMirrorValueValid', true);
-        this.set('config.value', parsed);
+        this.set('config.value', '' + parsed);
         if (slider) {
           slider.setValue(parsed);
         }
@@ -156,7 +156,7 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
 
     slider.on('change', function (obj) {
       var val = parseFunction(obj.newValue);
-      self.set('config.value', val);
+      self.set('config.value', '' + val);
       self.set('mirrorValue', val);
     });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/087c555f/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
b/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
index b6d9ba6..a7d7cc7 100644
--- a/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
+++ b/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
@@ -75,21 +75,21 @@ describe('App.SliderConfigWidgetView', function () {
     it('check int', function () {
       viewInt.set('mirrorValue', 1000);
       expect(viewInt.get('isMirrorValueValid')).to.be.true;
-      expect(viewInt.get('config.value')).to.equal(1000);
+      expect(viewInt.get('config.value')).to.equal('1000');
 
       viewInt.set('mirrorValue', 100500);
       expect(viewInt.get('isMirrorValueValid')).to.be.false;
-      expect(viewInt.get('config.value')).to.equal(1000);
+      expect(viewInt.get('config.value')).to.equal('1000');
     });
 
     it('check float', function () {
       viewFloat.set('mirrorValue', 55.5);
       expect(viewFloat.get('isMirrorValueValid')).to.be.true;
-      expect(viewFloat.get('config.value')).to.equal(55.5);
+      expect(viewFloat.get('config.value')).to.equal('55.5');
 
       viewFloat.set('mirrorValue', 100500.5);
       expect(viewFloat.get('isMirrorValueValid')).to.be.false;
-      expect(viewFloat.get('config.value')).to.equal(55.5);
+      expect(viewFloat.get('config.value')).to.equal('55.5');
     });
 
   });


Mime
View raw message