Skip to content

Commit

Permalink
feat: make transformation and filter fields readonly when in modal
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterlukasse committed Feb 13, 2025
1 parent 30ca61d commit 836337f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AttritionTableModal = ({ modalInfo, setModalInfo }) => {
selectedCovariates={rowIsOutcome ? [] : modalInfo.currentCovariateAndCovariatesFromPrecedingRows.slice(0, -1)}
outcome={rowIsOutcome ? null : modalInfo.outcome}
selectedContinuousItem={modalInfo.rowObject}
useAnimation={false}
readOnly={true}
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PhenotypeHistogram = ({
selectedCovariates,
outcome,
selectedContinuousItem,
useAnimation,
readOnly,
handleChangeTransformation,
handleChangeMinOutlierCutoff,
handleChangeMaxOutlierCutoff,
Expand Down Expand Up @@ -105,7 +105,7 @@ const PhenotypeHistogram = ({
barColor: 'darkblue',
xAxisLegend: selectedContinuousItem.concept_name,
yAxisLegend: 'Persons',
useAnimation,
useAnimation: !readOnly,
minCutoff: getMinCutoff(selectedContinuousItem),
maxCutoff: getMaxCutoff(selectedContinuousItem),
};
Expand All @@ -126,6 +126,7 @@ const PhenotypeHistogram = ({
<div className='GWASUI-column transformation-select'>
<Select
id='transformation-select'
disabled={readOnly}
showSearch={false}
labelInValue
value={selectedTransformation}
Expand Down Expand Up @@ -154,6 +155,7 @@ const PhenotypeHistogram = ({
<div className='GWASUI-column'>
<InputNumber
id='input-minOutlierCutoff'
disabled={readOnly}
value={minOutlierCutoff}
onChange={(value) => {
setMinOutlierCutoff(value);
Expand Down Expand Up @@ -188,6 +190,7 @@ const PhenotypeHistogram = ({
<div className='GWASUI-column'>
<InputNumber
id='input-maxOutlierCutoff'
disabled={readOnly}
value={maxOutlierCutoff}
onChange={(value) => {
setMaxOutlierCutoff(value);
Expand Down Expand Up @@ -224,7 +227,7 @@ PhenotypeHistogram.propTypes = {
selectedCovariates: PropTypes.array,
outcome: PropTypes.object,
selectedContinuousItem: PropTypes.object.isRequired,
useAnimation: PropTypes.bool,
readOnly: PropTypes.bool,
handleChangeTransformation: PropTypes.func,
handleChangeMinOutlierCutoff: PropTypes.func,
handleChangeMaxOutlierCutoff: PropTypes.func,
Expand All @@ -234,7 +237,7 @@ PhenotypeHistogram.defaultProps = {
dispatch: null,
selectedCovariates: [],
outcome: null,
useAnimation: true,
readOnly: false,
handleChangeTransformation: null,
handleChangeMinOutlierCutoff: null,
handleChangeMaxOutlierCutoff: null,
Expand Down

0 comments on commit 836337f

Please sign in to comment.