diff --git a/.env b/.env index e55ce2c5..6110702a 100644 --- a/.env +++ b/.env @@ -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 \ No newline at end of file diff --git a/src/containers/CaseDetail/AcceptD1.js b/src/containers/CaseDetail/AcceptD1.js index e04ec64e..171218e0 100644 --- a/src/containers/CaseDetail/AcceptD1.js +++ b/src/containers/CaseDetail/AcceptD1.js @@ -18,6 +18,9 @@ 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, @@ -58,10 +61,11 @@ function AcceptD1({ const [sending, setSending] = useState(false) const AcceptD1Schema = Yup.object().shape({ - m1: Yup.bool() - .required(t('UNACCEPTED_PRIVACY_POLICY')) - .oneOf([true, false], t('UNACCEPTED_PRIVACY_POLICY')), - }) + m1: Yup.bool() + .required(t('UNACCEPTED_PRIVACY_POLICY')) + .oneOf([true, false], t('UNACCEPTED_PRIVACY_POLICY')) + } + ) return ( @@ -69,7 +73,7 @@ function AcceptD1({ initialValues={{ ...{ d1Attachments: [], - m1: '' + m1: showD1PowerModificationChooser ? '' : false }, ...params }} @@ -120,7 +124,7 @@ function AcceptD1({ maxFiles={5} fieldError={ errors?.d1Attachments && - (touched?.d1Attachments || values?.m1 !== "") && + (touched?.d1Attachments || values?.m1 !== '') && errors?.d1Attachments } callbackFn={(d1Attachments) => @@ -131,25 +135,28 @@ function AcceptD1({ - - 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') - } - ]} - /> - + {showD1PowerModificationChooser && ( + + 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') + } + ]} + /> + + )} +
{