Skip to content

Commit

Permalink
🐛 Allow process if not contract modification in D1
Browse files Browse the repository at this point in the history
Co-authored-by: Marta <[email protected]>
  • Loading branch information
2 people authored and javikalsan committed Dec 14, 2023
1 parent 756e526 commit 10c6c16
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/containers/CaseDetail/AcceptD1.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +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 showD1PowerModificationChooser =
process.env.REACT_APP_SHOW_D1_POWER_MODIFICATION_CHOOSER === 'true'

const useStyles = makeStyles((theme) => ({
root: {
Expand Down Expand Up @@ -60,18 +61,19 @@ 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 (
<Paper className={classes.paperContainer} elevation={0}>
<Formik
initialValues={{
...{
d1Attachments: [],
m1: ''
m1: showD1PowerModificationChooser ? '' : false
},
...params
}}
Expand Down Expand Up @@ -122,7 +124,7 @@ function AcceptD1({
maxFiles={5}
fieldError={
errors?.d1Attachments &&
(touched?.d1Attachments || values?.m1 !== "") &&
(touched?.d1Attachments || values?.m1 !== '') &&
errors?.d1Attachments
}
callbackFn={(d1Attachments) =>
Expand Down Expand Up @@ -172,7 +174,7 @@ function AcceptD1({
className={classes.button}
color="primary"
variant="contained"
disabled={!isValid || sending}
disabled={(showD1PowerModificationChooser && !isValid) || sending}
endIcon={
(sending && <CircularProgress size={24} />) ||
(values?.m1 === false && <SendIcon />) || (
Expand Down

0 comments on commit 10c6c16

Please sign in to comment.