superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: [bugfix] when num_period_compare is not set (#4799)
Date Tue, 10 Apr 2018 21:49:25 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 14bf45d  [bugfix] when num_period_compare is not set (#4799)
14bf45d is described below

commit 14bf45da7cdb9dae6757fbea8c45cd3cc3149da7
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Tue Apr 10 14:49:22 2018 -0700

    [bugfix] when num_period_compare is not set (#4799)
    
    Fixing issues where y_axis_format is set and not num_period_compare
---
 superset/assets/javascripts/explore/stores/controls.jsx | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/superset/assets/javascripts/explore/stores/controls.jsx b/superset/assets/javascripts/explore/stores/controls.jsx
index d2efd53..a075a1a 100644
--- a/superset/assets/javascripts/explore/stores/controls.jsx
+++ b/superset/assets/javascripts/explore/stores/controls.jsx
@@ -1209,11 +1209,17 @@ export const controls = {
     default: '.3s',
     choices: D3_FORMAT_OPTIONS,
     description: D3_FORMAT_DOCS,
-    mapStateToProps: state => ({
-      warning: state.controls && state.controls.num_period_compare.value !== '' ?
-        t('When `Period Ratio` is set, the Y Axis Format is forced to `.1%`') : null,
-      disabled: state.controls && state.controls.num_period_compare.value !== '',
-    }),
+    mapStateToProps: (state) => {
+      const showWarning = (
+          state.controls &&
+          state.controls.num_period_compare &&
+          state.controls.num_period_compare.value !== '');
+      return {
+        warning: showWarning ?
+          t('When `Period Ratio` is set, the Y Axis Format is forced to `.1%`') : null,
+        disabled: showWarning,
+      };
+    },
   },
 
   y_axis_2_format: {

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

Mime
View raw message