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-20941 UI Deploy: On enabling hive interactive query, value of 'Number of nodes used by Hive's LLAP' becomes invalid. (ababiichuk)
Date Fri, 05 May 2017 15:07:08 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 f8f8abbbb -> f740a9fdd


AMBARI-20941 UI Deploy: On enabling hive interactive query, value of 'Number of nodes used
by Hive's LLAP' becomes invalid. (ababiichuk)


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

Branch: refs/heads/branch-2.5
Commit: f740a9fddf032bbb8f5d9df160e2561d9ea43c44
Parents: f8f8abb
Author: ababiichuk <ababiichuk@hortonworks.com>
Authored: Fri May 5 17:35:03 2017 +0300
Committer: ababiichuk <ababiichuk@hortonworks.com>
Committed: Fri May 5 17:35:03 2017 +0300

----------------------------------------------------------------------
 .../configs/widgets/slider_config_widget_view.js       | 11 ++++++++++-
 .../configs/widgets/slider_config_widget_view_test.js  | 13 +++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f740a9fd/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 948af5d..5c8ea78 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
@@ -113,7 +113,8 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
     var configValue = this.get('config.value');
     var defaultGroupAttr = this.get('config.stackConfigProperty.valueAttributes');
     var groupAttr = this.get('configGroup') && defaultGroupAttr[this.get('configGroup.name')];
-    var boundary = (groupAttr && !Em.isNone(groupAttr[attribute])) ? groupAttr[attribute]
: defaultGroupAttr[attribute];
+    var usedGroupAttr = (groupAttr && !Em.isNone(groupAttr[attribute])) ? groupAttr
: defaultGroupAttr;
+    var boundary = usedGroupAttr[attribute];
 
     if (!this.get('referToSelectedGroup')) {
       if (attribute === 'minimum') {
@@ -126,6 +127,14 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
         }
       }
     }
+    if (isNaN(boundary) && !isNaN(configValue)) {
+      if (attribute === 'minimum') {
+        return isNaN(usedGroupAttr['maximum']) ? configValue : Math.min(usedGroupAttr['maximum'],
configValue).toString();
+      }
+      if (attribute === 'maximum') {
+        return isNaN(usedGroupAttr['minimum']) ? configValue : Math.max(usedGroupAttr['minimum'],
configValue).toString();
+      }
+    }
     return boundary;
   },
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/f740a9fd/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 9817479..3be5b24 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
@@ -315,6 +315,19 @@ describe('App.SliderConfigWidgetView', function () {
       viewInt.set('config.group', {name: 'group1'});
       expect(viewInt.getValueAttributeByGroup('maximum')).to.equal('3072');
     });
+
+    it('minimum is missing', function () {
+      viewInt.set('config.stackConfigProperty.valueAttributes.minimum', undefined);
+      expect(viewInt.getValueAttributeByGroup('minimum')).to.equal('486');
+    });
+
+    it('minimum is missing, value is invalid', function () {
+      viewInt.get('config').setProperties({
+        'value': 3072,
+        'stackConfigProperty.valueAttributes.minimum': undefined
+      });
+      expect(viewInt.getValueAttributeByGroup('minimum')).to.equal('2096');
+    });
   });
 
   describe('#initSlider', function() {


Mime
View raw message