Skip to content

Commit

Permalink
✨ add feature flag to disable contract d1 power modification
Browse files Browse the repository at this point in the history
Co-authored-by: Joana Figueira <[email protected]>
  • Loading branch information
2 people authored and javikalsan committed Dec 14, 2023
1 parent 4c039d4 commit 756e526
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ PUBLIC_URL=/static/webforms
REACT_APP_API_BASE_URL=
REACT_APP_PLAUSIBLE_TRACK_DOMAIN=
REACT_APP_PLAUSIBLE_APIHOST_URL=
REACT_APP_SHOW_D1_POWER_MODIFICATION_CHOOSER=false
43 changes: 24 additions & 19 deletions src/containers/CaseDetail/AcceptD1.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import SendIcon from '@material-ui/icons/Send'

import Uploader from '../../components/Uploader'

const showD1PowerModificationChooser = process.env.REACT_APP_SHOW_D1_POWER_MODIFICATION_CHOOSER === 'true'

const useStyles = makeStyles((theme) => ({
root: {
flexGrow: 1,
Expand Down Expand Up @@ -131,25 +133,28 @@ function AcceptD1({
</Box>
</Box>

<Box mx={1} mt={1} mb={2} className={classes.chooserLabelBox}>
<Chooser
question={t('APROFITAR_LA_MODIFICACIO')}
onChange={(option) => setFieldValue('m1', option.option)}
value={values.m1}
options={[
{
value: true,
label: t('SI'),
description: t('AVIS_APROFITAR_M1')
},
{
value: false,
label: t('NO'),
description: t('AVIS_NO_APROFITAR_M1')
}
]}
/>
</Box>
{showD1PowerModificationChooser && (
<Box mx={1} mt={1} mb={2} className={classes.chooserLabelBox}>
<Chooser
question={t('APROFITAR_LA_MODIFICACIO')}
onChange={(option) => setFieldValue('m1', option.option)}
value={values.m1}
options={[
{
value: true,
label: t('SI'),
description: t('AVIS_APROFITAR_M1')
},
{
value: false,
label: t('NO'),
description: t('AVIS_NO_APROFITAR_M1')
}
]}
/>
</Box>
)}

<div className={classes.actionsContainer}>
{
<Button
Expand Down

0 comments on commit 756e526

Please sign in to comment.