Skip to content

Commit

Permalink
[bugfix] when num_period_compare is not set (apache#4799)
Browse files Browse the repository at this point in the history
Fixing issues where y_axis_format is set and not num_period_compare

(cherry picked from commit 14bf45d)
  • Loading branch information
mistercrunch committed Apr 12, 2018
1 parent 29af36f commit 02f4b4d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions superset/assets/javascripts/explore/stores/controls.jsx
Expand Up @@ -1152,11 +1152,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: {
Expand Down

0 comments on commit 02f4b4d

Please sign in to comment.