-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disable lines and vertical axis options for multi axes (DHIS2-90…
…10, DHIS2-9013, DHIS2-9014) (#1171) Disables Lines (DHIS2-9010) and Vertical Axis options (title: DHIS2-9013, options: DHIS2-9014) by checking the new Analytics prop hasCustomAxes Lines and Vertical Axis config sections extracted to own modules for reduced duplication Adds a disabled prop to various options Wraps configs in functions and adds prop hasCustomAxes where applicable Refactors getLabel() to label, since config is now wrapped in a function (no need for individual fn wrapping) Additionally, adds the correct margin between some options that were missing it Changes incorrectly named selector getAxisIdByDimensionId to sGetAxisIdByDimensionId
- Loading branch information
1 parent
85b71f5
commit 7062fc5
Showing
35 changed files
with
361 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
packages/app/src/components/VisualizationOptions/Options/RangeAxisDecimals.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import React from 'react' | ||
|
||
import i18n from '@dhis2/d2-i18n' | ||
import PropTypes from 'prop-types' | ||
|
||
import TextBaseOption from './TextBaseOption' | ||
|
||
const RangeAxisDecimals = () => ( | ||
const RangeAxisDecimals = ({ disabled }) => ( | ||
<TextBaseOption | ||
type="number" | ||
width="96px" | ||
label={i18n.t('Decimals')} | ||
disabled={disabled} | ||
placeholder={i18n.t('Auto')} | ||
option={{ | ||
name: 'rangeAxisDecimals', | ||
}} | ||
/> | ||
) | ||
|
||
RangeAxisDecimals.propTypes = { | ||
disabled: PropTypes.bool, | ||
} | ||
|
||
export default RangeAxisDecimals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
packages/app/src/components/VisualizationOptions/Options/RangeAxisMaxValue.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import React from 'react' | ||
|
||
import i18n from '@dhis2/d2-i18n' | ||
import PropTypes from 'prop-types' | ||
|
||
import TextBaseOption from './TextBaseOption' | ||
|
||
const RangeAxisMaxValue = () => ( | ||
const RangeAxisMaxValue = ({ disabled }) => ( | ||
<TextBaseOption | ||
type="number" | ||
width="100px" | ||
placeholder={i18n.t('Max')} | ||
disabled={disabled} | ||
option={{ | ||
name: 'rangeAxisMaxValue', | ||
}} | ||
inline | ||
/> | ||
) | ||
|
||
RangeAxisMaxValue.propTypes = { | ||
disabled: PropTypes.bool, | ||
} | ||
|
||
export default RangeAxisMaxValue |
9 changes: 7 additions & 2 deletions
9
packages/app/src/components/VisualizationOptions/Options/RangeAxisMinValue.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import React from 'react' | ||
|
||
import i18n from '@dhis2/d2-i18n' | ||
import PropTypes from 'prop-types' | ||
|
||
import TextBaseOption from './TextBaseOption' | ||
|
||
const RangeAxisMinValue = () => ( | ||
const RangeAxisMinValue = ({ disabled }) => ( | ||
<TextBaseOption | ||
type="number" | ||
width="100px" | ||
placeholder={i18n.t('Min')} | ||
disabled={disabled} | ||
option={{ | ||
name: 'rangeAxisMinValue', | ||
}} | ||
inline | ||
/> | ||
) | ||
|
||
RangeAxisMinValue.propTypes = { | ||
disabled: PropTypes.bool, | ||
} | ||
|
||
export default RangeAxisMinValue |
9 changes: 7 additions & 2 deletions
9
packages/app/src/components/VisualizationOptions/Options/RangeAxisSteps.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
import React from 'react' | ||
|
||
import i18n from '@dhis2/d2-i18n' | ||
import PropTypes from 'prop-types' | ||
|
||
import TextBaseOption from './TextBaseOption' | ||
|
||
export const RangeAxisSteps = () => ( | ||
export const RangeAxisSteps = ({ disabled }) => ( | ||
<TextBaseOption | ||
type="number" | ||
width="96px" | ||
helpText={i18n.t( | ||
'The number of axis steps between the min and max values' | ||
)} | ||
label={i18n.t('Steps')} | ||
disabled={disabled} | ||
placeholder={i18n.t('Auto')} | ||
option={{ | ||
name: 'rangeAxisSteps', | ||
}} | ||
/> | ||
) | ||
|
||
RangeAxisSteps.propTypes = { | ||
disabled: PropTypes.bool, | ||
} | ||
|
||
export default RangeAxisSteps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.