Skip to content

Commit

Permalink
suppress fields
Browse files Browse the repository at this point in the history
  • Loading branch information
aetchego committed Dec 11, 2024
1 parent f3ac179 commit 4da7327
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DurationRangeType } from 'types/searchCriterias'
import { CriteriaLabel } from 'components/ui/CriteriaLabel'
import { getOccurenceDateLabel } from 'utils/requestCriterias'
import ExecutiveUnitsInput from 'components/ui/Inputs/ExecutiveUnits'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'

type AdvancedInputsProps = {
sourceType: SourceType
Expand Down
19 changes: 16 additions & 3 deletions src/components/Dashboard/FormsList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import DisplayDigits from 'components/ui/Display/DisplayDigits'
import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter'
import Modal from 'components/ui/Modal'
import { DTTB_ResultsType as ResultsType, LoadingStatus } from 'types'
import { FilterKeys, LabelObject } from 'types/searchCriterias'
import { FilterKeys, FormNames, LabelObject } from 'types/searchCriterias'
import { CanceledError } from 'axios'
import services from 'services/aphp'
import useSearchCriterias, { initFormsCriterias } from 'reducers/searchCriteriasReducer'
import { cancelPendingRequest } from 'utils/abortController'
import { selectFiltersAsArray } from 'utils/filters'
import { SourceType } from 'types/scope'
import { Questionnaire } from 'fhir/r4'
import MaternityFormFilter from 'components/Filters/MaternityFormFilter'
import DataTableForms from 'components/DataTable/DataTableForms'
import { useSearchParams } from 'react-router-dom'
import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils'
Expand All @@ -25,6 +24,19 @@ import { getCodeList } from 'services/aphp/serviceValueSets'
import { getConfig } from 'config'
import TextInput from 'components/Filters/TextInput'
import MultiSelectInput from 'components/Filters/MultiSelectInput'
import labels from 'labels.json'
import CheckboxsFilter from 'components/Filters/CheckboxsFilter'

const formOptions = [
{
id: FormNames.PREGNANCY,
label: labels.formNames.pregnancy
},
{
id: FormNames.HOSPIT,
label: labels.formNames.hospit
}
]

const FormsList = () => {
const theme = useTheme()
Expand Down Expand Up @@ -212,7 +224,8 @@ const FormsList = () => {
label="IPP :"
placeholder="'Exemple: 8000000000001,8000000000002'"
/>
<MaternityFormFilter name={FilterKeys.FORM_NAME} value={formName} />
<CheckboxsFilter name={FilterKeys.FORM_NAME} value={formName} label="Formulaire :" options={formOptions} />
{/*<MaternityFormFilter name={FilterKeys.FORM_NAME} value={formName} />*/}
<ExecutiveUnitsFilter
sourceType={SourceType.FORM_RESPONSE}
value={executiveUnits}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filters/BirthdatesRangesFilters/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import DurationRange from 'components/ui/Inputs/DurationRange'
import { FormContext } from 'components/ui/Modal'
import React, { useContext, useEffect, useState } from 'react'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filters/CheckboxsFilter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Checkbox, FormControlLabel, FormGroup, Typography } from '@mui/material'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import { FormContext } from 'components/ui/Modal'
import React, { useContext, useEffect, useState } from 'react'
import { LabelObject } from 'types/searchCriterias'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filters/CodeFilter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Typography } from '@mui/material'
import ValueSetField from 'components/SearchValueSet/ValueSetField'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import { FormContext } from 'components/ui/Modal'
import React, { useContext, useEffect, useState } from 'react'
import { Hierarchy } from 'types/hierarchy'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filters/DocTypesFilter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Autocomplete, AutocompleteRenderGroupParams, Checkbox, Grid, TextField, Typography } from '@mui/material'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import { FormContext } from 'components/ui/Modal'
import React, { useContext, useEffect, useState } from 'react'
import { SimpleCodeType } from 'types'
Expand Down
49 changes: 0 additions & 49 deletions src/components/Filters/MaternityFormFilter/index.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions src/components/Filters/MultiSelectInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Autocomplete, TextField, Typography } from '@mui/material'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import { FormContext } from 'components/ui/Modal'
import React, { useContext, useEffect, useState } from 'react'
import { LabelObject } from 'types/searchCriterias'
Expand All @@ -13,7 +13,7 @@ type PrescriptionTypesFilterProps = {
disabled?: boolean
}

const SelectInput = ({ name, value, label, options, disabled = false }: PrescriptionTypesFilterProps) => {
const MultiSelectInput = ({ name, value, label, options, disabled = false }: PrescriptionTypesFilterProps) => {
const context = useContext(FormContext)
const [input, setInput] = useState(value)

Expand Down Expand Up @@ -41,4 +41,4 @@ const SelectInput = ({ name, value, label, options, disabled = false }: Prescrip
)
}

export default SelectInput
export default MultiSelectInput
2 changes: 1 addition & 1 deletion src/components/Filters/PatientsNbFilter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormLabel, Grid, TextField, Typography } from '@mui/material'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import { ErrorMessage } from 'components/ui/Inputs/Errors'
import { BlockWrapper } from 'components/ui/Layout'
import { FormContext } from 'components/ui/Modal'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filters/RadioGroupFilter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Typography } from '@mui/material'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import { FormContext } from 'components/ui/Modal'
import RadioGroup from 'components/ui/RadioGroup'
import React, { useContext, useEffect, useState } from 'react'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filters/TextInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Grid, TextField, Typography } from '@mui/material'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import { ErrorMessage } from 'components/ui/Inputs/Errors'
import { FormContext } from 'components/ui/Modal'
import React, { useContext, useEffect, useState } from 'react'
Expand Down
48 changes: 0 additions & 48 deletions src/components/Filters/VitalStatusesFilter.tsx/index.tsx

This file was deleted.

24 changes: 21 additions & 3 deletions src/components/Patient/PatientForms/MaternityForms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Grid } from '@mui/material'
import { FilterList } from '@mui/icons-material'
import DatesRangeFilter from 'components/Filters/DatesRangeFilter'
import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter'
import MaternityFormFilter from 'components/Filters/MaternityFormFilter'
import Button from 'components/ui/Button'
import Chip from 'components/ui/Chip'
import { BlockWrapper } from 'components/ui/Layout'
Expand All @@ -17,7 +16,7 @@ import { cancelPendingRequest } from 'utils/abortController'
import { selectFiltersAsArray } from 'utils/filters'
import { Questionnaire } from 'fhir/r4'
import { LoadingStatus } from 'types'
import { FilterKeys, LabelObject } from 'types/searchCriterias'
import { FilterKeys, FormNames, LabelObject } from 'types/searchCriterias'
import Timeline from './Timeline'
import services from 'services/aphp'
import { SourceType } from 'types/scope'
Expand All @@ -26,6 +25,20 @@ import { getCleanGroupId } from 'utils/paginationUtils'
import { getCodeList } from 'services/aphp/serviceValueSets'
import { getConfig } from 'config'
import MultiSelectInput from 'components/Filters/MultiSelectInput'
import CheckboxsFilter from 'components/Filters/CheckboxsFilter'
import labels from 'labels.json'

const formOptions = [
{
id: FormNames.PREGNANCY,
label: labels.formNames.pregnancy
},
{
id: FormNames.HOSPIT,
label: labels.formNames.hospit
}
]


Check failure on line 42 in src/components/Patient/PatientForms/MaternityForms/index.tsx

View workflow job for this annotation

GitHub Actions / test

Delete `⏎`
const MaternityForm = () => {
const [toggleModal, setToggleModal] = useState(false)
Expand Down Expand Up @@ -126,7 +139,12 @@ const MaternityForm = () => {
onClose={() => setToggleModal(false)}
onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })}
>
<MaternityFormFilter name={FilterKeys.FORM_NAME} value={formName} />
<CheckboxsFilter
name={FilterKeys.FORM_NAME}
value={formName}
label="Formulaire :"
options={formOptions}
/>
<DatesRangeFilter values={[startDate, endDate]} names={[FilterKeys.START_DATE, FilterKeys.END_DATE]} />
<ExecutiveUnitsFilter
sourceType={SourceType.FORM_RESPONSE}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/Inputs/ExecutiveUnits/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CircularProgress, FormLabel, Grid, IconButton, Tooltip } from '@mui/mat
import React, { ReactNode, useEffect, useState } from 'react'
import { LoadingStatus, ScopeElement } from 'types'
import InfoIcon from '@mui/icons-material/Info'
import { InputWrapper } from 'components/ui/Inputs'
import { InputWrapper } from 'components/ui/Inputs/styles'
import { SourceType } from 'types/scope'
import { Hierarchy } from 'types/hierarchy'
import servicesPerimeters from 'services/aphp/servicePerimeters'
Expand Down
File renamed without changes.

0 comments on commit 4da7327

Please sign in to comment.