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-10463. HBase configs missing some controls. (onechiporenko)
Date Tue, 14 Apr 2015 11:32:45 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 0d5883ff6 -> cc0384d1a


AMBARI-10463. HBase configs missing some controls. (onechiporenko)


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

Branch: refs/heads/trunk
Commit: cc0384d1ab2a7644de0e65cfa69bef45bc9436fb
Parents: 0d5883f
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Tue Apr 14 14:30:33 2015 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Tue Apr 14 14:30:33 2015 +0300

----------------------------------------------------------------------
 .../stacks/HDP/2.2/services/HBASE/themes/theme.json  |  2 +-
 .../configs/widgets/list_config_widget_view.js       |  9 ++++-----
 .../configs/widgets/list_config_widget_view_test.js  | 15 +++++++--------
 3 files changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cc0384d1/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/themes/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/themes/theme.json
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/themes/theme.json
index 38c298e..a716233 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/themes/theme.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/themes/theme.json
@@ -408,7 +408,7 @@
       {
         "config":"hbase-site/hbase.regionserver.wal.codec",
         "widget":{
-          "type":"list"
+          "type":"combo"
         }
       },
       {

http://git-wip-us.apache.org/repos/asf/ambari/blob/cc0384d1/ambari-web/app/views/common/configs/widgets/list_config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/list_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/list_config_widget_view.js
index bd79501..ab1db7a 100644
--- a/ambari-web/app/views/common/configs/widgets/list_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/list_config_widget_view.js
@@ -132,12 +132,11 @@ App.ListConfigWidgetView = App.ConfigWidgetView.extend({
   calculateOptions: function () {
     var valueAttributes = this.get('config.stackConfigProperty.valueAttributes'),
       options = [];
-    Em.assert('valueAttributes `entries`, `entry_label` and `entry_descriptions` should have
the same length', valueAttributes.entries.length == valueAttributes.entry_labels.length &&
valueAttributes.entries.length == valueAttributes.entry_descriptions.length);
-    valueAttributes.entries.forEach(function (entryValue, indx) {
+    valueAttributes.entries.forEach(function (entryValue) {
       options.pushObject(configOption.create({
-        value: entryValue,
-        label: valueAttributes.entry_labels[indx],
-        description: valueAttributes.entry_descriptions[indx]
+        value: entryValue.value,
+        label: entryValue.label || entryValue.value,
+        description: entryValue.description
       }));
     });
     this.set('options', options);

http://git-wip-us.apache.org/repos/asf/ambari/blob/cc0384d1/ambari-web/test/views/common/configs/widgets/list_config_widget_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/configs/widgets/list_config_widget_view_test.js
b/ambari-web/test/views/common/configs/widgets/list_config_widget_view_test.js
index 4497eb8..4d21b5d 100644
--- a/ambari-web/test/views/common/configs/widgets/list_config_widget_view_test.js
+++ b/ambari-web/test/views/common/configs/widgets/list_config_widget_view_test.js
@@ -32,9 +32,13 @@ describe('App.ListConfigWidgetView', function () {
         filename: 'f1',
         stackConfigProperty: Em.Object.create({
           valueAttributes: {
-            entries: ['1', '2', '3', '4', '5'],
-            entry_labels: ['first label', 'second label', 'third label', '4th label', '5th
label'],
-            entry_descriptions: ['1', '2', '3', '4', '5'],
+            entries: [
+              {value: '1', label: 'first label', description: '1'},
+              {value: '2', label: 'second label', description: '2'},
+              {value: '3', label: 'third label', description: '3'},
+              {value: '4', label: '4th label', description: '4'},
+              {value: '5', label: '5th label', description: '5'}
+            ],
             selection_cardinality: '3'
           }
         })
@@ -66,11 +70,6 @@ describe('App.ListConfigWidgetView', function () {
 
   describe('#calculateOptions', function () {
 
-    it('should trigger error', function () {
-      view.set('config.stackConfigProperty.valueAttributes.entry_descriptions', ['1', '2',
'3', '4']);
-      expect(view.calculateOptions.bind(view)).to.throw(Error, 'assertion failed');
-    });
-
     it('should create options for each entry', function () {
       view.set('options', []);
       view.calculateOptions();


Mime
View raw message