You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2020/02/24 09:34:44 UTC

[ambari] branch branch-2.7 updated: AMBARI-25481. Customize Widget Threshold validation issue

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

alexantonenko pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new b2c404d  AMBARI-25481. Customize Widget Threshold validation issue
     new d31e360  Merge pull request #3180 from hiveww/AMBARI-25481-branch-2.7
b2c404d is described below

commit b2c404dec0165d6693976a46dacde79e4cff5b2f
Author: Alex Antonenko <aa...@hortonworks.com>
AuthorDate: Thu Feb 20 11:03:38 2020 +0200

    AMBARI-25481. Customize Widget Threshold validation issue
---
 ambari-web/app/mixins/main/dashboard/widgets/editable.js       |  6 +++---
 .../app/mixins/main/dashboard/widgets/editable_with_limit.js   |  4 ++--
 .../mixins/main/dashboard/widgets/single_numeric_threshold.js  |  2 +-
 .../views/common/modal_popups/edit_dashboard_widget_popup.js   | 10 +++++-----
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/ambari-web/app/mixins/main/dashboard/widgets/editable.js b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
index 482ff6a..bd518fb 100644
--- a/ambari-web/app/mixins/main/dashboard/widgets/editable.js
+++ b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
@@ -27,8 +27,8 @@ App.EditableWidgetMixin = Em.Mixin.create({
 
       sliderHandlersManager: App.EditDashboardWidgetPopup.DoubleHandlers.create({
         maxValue: 'infinity',
-        thresholdMin: this.get('thresholdMin'),
-        thresholdMax: this.get('thresholdMax')
+        thresholdMin: Number(this.get('thresholdMin')),
+        thresholdMax: Number(this.get('thresholdMax'))
       }),
 
       sliderDisabled: true,
@@ -39,4 +39,4 @@ App.EditableWidgetMixin = Em.Mixin.create({
     });
   }
 
-});
\ No newline at end of file
+});
diff --git a/ambari-web/app/mixins/main/dashboard/widgets/editable_with_limit.js b/ambari-web/app/mixins/main/dashboard/widgets/editable_with_limit.js
index 1cb96df..abf49f7 100644
--- a/ambari-web/app/mixins/main/dashboard/widgets/editable_with_limit.js
+++ b/ambari-web/app/mixins/main/dashboard/widgets/editable_with_limit.js
@@ -31,8 +31,8 @@ App.EditableWithLimitWidgetMixin = Em.Mixin.create({
 
       sliderHandlersManager: App.EditDashboardWidgetPopup.DoubleHandlers.create({
         maxValue: parseFloat(this.get('maxValue')),
-        thresholdMin: this.get('thresholdMin'),
-        thresholdMax: this.get('thresholdMax')
+        thresholdMin: Number(this.get('thresholdMin')),
+        thresholdMax: Number(this.get('thresholdMax'))
       })
 
     });
diff --git a/ambari-web/app/mixins/main/dashboard/widgets/single_numeric_threshold.js b/ambari-web/app/mixins/main/dashboard/widgets/single_numeric_threshold.js
index 36172b7..643576a 100644
--- a/ambari-web/app/mixins/main/dashboard/widgets/single_numeric_threshold.js
+++ b/ambari-web/app/mixins/main/dashboard/widgets/single_numeric_threshold.js
@@ -29,7 +29,7 @@ App.SingleNumericThresholdMixin = Em.Mixin.create({
       widgetView: this,
 
       sliderHandlersManager: App.EditDashboardWidgetPopup.SingleHandler.create({
-        thresholdMin: this.get('thresholdMin'),
+        thresholdMin: Number(this.get('thresholdMin')),
         maxValue: parseFloat(this.get('maxValue'))
       }),
 
diff --git a/ambari-web/app/views/common/modal_popups/edit_dashboard_widget_popup.js b/ambari-web/app/views/common/modal_popups/edit_dashboard_widget_popup.js
index 7ea1b322..20ee51e 100644
--- a/ambari-web/app/views/common/modal_popups/edit_dashboard_widget_popup.js
+++ b/ambari-web/app/views/common/modal_popups/edit_dashboard_widget_popup.js
@@ -157,10 +157,10 @@ const DoubleHandlers = SingleHandler.extend({
    * @type {string}
    */
   thresholdMinErrorMessage: function () {
-    var thresholdMin = this.get('thresholdMin');
-    var thresholdMax = this.get('thresholdMax');
-    var maxValue = this.get('maxValue');
-    var minValue = this.get('minValue');
+    var thresholdMin = Number(this.get('thresholdMin'));
+    var thresholdMax = Number(this.get('thresholdMax'));
+    var maxValue = Number(this.get('maxValue'));
+    var minValue = Number(this.get('minValue'));
     if (!isValidFloat(thresholdMin) || thresholdMin > maxValue || thresholdMin < minValue) {
       return Em.I18n.t('dashboard.widgets.error.invalid').format(minValue, maxValue);
     }
@@ -433,4 +433,4 @@ App.EditDashboardWidgetPopup.reopenClass({
   SingleHandler,
   DoubleHandlers,
   EditDashboardWidgetPopupBody
-});
\ No newline at end of file
+});