Skip to content

Commit

Permalink
fix: fix some bug with cohort-rights and pass biology research value …
Browse files Browse the repository at this point in the history
…in float
  • Loading branch information
Mehdi-BOUYAHIA committed Jan 3, 2024
1 parent 3583a70 commit 597e078
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const BiologyForm: React.FC<BiologyFormProps> = (props) => {
id="criteria-value"
variant="outlined"
value={currentState.valueMin}
onChange={(e) => onChangeValue('valueMin', parseInt(e.target.value))}
onChange={(e) => onChangeValue('valueMin', parseFloat(e.target.value))}
placeholder={currentState.valueComparator === Comparators.BETWEEN ? 'Valeur minimale' : '0'}
disabled={!allowSearchByValue}
/>
Expand All @@ -262,7 +262,7 @@ const BiologyForm: React.FC<BiologyFormProps> = (props) => {
id="criteria-value"
variant="outlined"
value={currentState.valueMax}
onChange={(e) => onChangeValue('valueMax', parseInt(e.target.value))}
onChange={(e) => onChangeValue('valueMax', parseFloat(e.target.value))}
placeholder="Valeur maximale"
disabled={!allowSearchByValue}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ModalCreateNewRequest: React.FC<{
}> = ({ onClose }) => {
const navigate = useNavigate()
const dispatch = useAppDispatch()

const url = window.location.href && window.location.href.includes('/cohort/new') ? true : false
const requestState = useAppSelector((state) => state.request)
const _projectsList = useAppSelector((state) => state.project.projectsList)

Expand Down Expand Up @@ -214,10 +214,12 @@ const ModalCreateNewRequest: React.FC<{
<Button disabled={loading} onClick={() => setDeletionConfirmation(true)} style={{ color: '#dc3545' }}>
Supprimer
</Button>
) : (
) : url ? (
<Button variant="contained" disabled={loading} onClick={() => setTab(tab === 'form' ? 'open' : 'form')}>
{tab === 'form' ? 'Ouvrir' : 'Nouvelle requête'}
</Button>
) : (
<></>
)}

<Grid style={{ flex: 1 }} />
Expand Down
3 changes: 2 additions & 1 deletion src/services/aphp/serviceCohorts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ const servicesCohorts: IServiceCohorts = {
try {
const ids = cohorts
.map((cohort) => cohort.fhir_group_id)
.filter((id) => id !== '' || id !== undefined) as string[]
.filter((id) => id !== undefined || id !== '')
.filter((i) => i !== '') as string[]
if (ids.length === 0) return []
const rightsResponse = await fetchCohortAccesses(ids)
return cohorts.map((cohort) => {
Expand Down

0 comments on commit 597e078

Please sign in to comment.