Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added info icon to imaging criteria - Ref gestion-de-projet#2772 #1077

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { Autocomplete, Grid, MenuItem, Select, TextField } from '@mui/material'
import { BlockWrapper } from 'components/ui/Layout'
import CalendarRange from 'components/ui/Inputs/CalendarRange'
import Collapse from 'components/ui/Collapse'
import { DurationUnitWrapper } from 'components/ui/Inputs/DurationRange/styles'
import { TextFieldWrapper } from 'components/ui/Inputs/DurationRange/styles'
import { DurationUnitWrapper, TextFieldWrapper } from 'components/ui/Inputs/DurationRange/styles'
import OccurenceInput from 'components/ui/Inputs/Occurences'
import CriteriaLayout from 'components/ui/CriteriaLayout'
import AdvancedInputs from '../AdvancedInputs/AdvancedInputs'
Expand All @@ -18,7 +17,6 @@ import {
DurationRangeType,
LabelObject
} from 'types/searchCriterias'
import useStyles from './styles'
import { mappingCriteria } from '../DemographicForm'
import SearchbarWithCheck from 'components/ui/Inputs/SearchbarWithCheck'
import UidTextfield from 'components/ui/Inputs/UidTextfield'
Expand Down Expand Up @@ -50,7 +48,6 @@ export const withDocumentOptions = [
]

const ImagingForm: React.FC<CriteriaDrawerComponentProps> = (props) => {
const { classes } = useStyles()
const appConfig = useContext(AppConfig)
const { criteriaData, onChangeSelectedCriteria, goBack } = props
const selectedCriteria = props.selectedCriteria as ImagingDataType
Expand Down Expand Up @@ -225,7 +222,13 @@ const ImagingForm: React.FC<CriteriaDrawerComponentProps> = (props) => {

{/* critères de study : */}
<BlockWrapper margin="1em">
<Collapse title="Critères liés à une étude" margin="0">
<Collapse
title="Critères liés à une étude"
info={
"Une étude est un examen. Il s'agit, au sens DICOM, de l'ensemble des acquisitions réalisées durant la visite d'un patient et, s'il existe, le compte-rendu (SR) DICOM associé."
}
margin="0"
>
<BlockWrapper style={{ margin: '0 2em 1em 0' }}>
<CriteriaLabel label="Date de l'étude" style={{ padding: 0 }} />
<CalendarRange
Expand Down Expand Up @@ -348,7 +351,12 @@ const ImagingForm: React.FC<CriteriaDrawerComponentProps> = (props) => {

{/*critères de série : */}
<BlockWrapper style={{ marginTop: 26 }}>
<Collapse title="Critères liés à une série" value={isSeriesUsed} margin="0">
<Collapse
title="Critères liés à une série"
value={isSeriesUsed}
margin="0"
info="Une série est une des acquisitions lors d'un examen."
>
<BlockWrapper style={{ margin: '0 2em 1em 0' }}>
<CriteriaLabel label="Date de la série" style={{ padding: 0 }} />
<CalendarRange
Expand Down

This file was deleted.

12 changes: 10 additions & 2 deletions src/components/ui/Collapse/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import React, { PropsWithChildren, ReactNode, useState } from 'react'

import { Grid, IconButton, Typography } from '@mui/material'
import { Grid, IconButton, Tooltip, Typography } from '@mui/material'
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'
import InfoIcon from '@mui/icons-material/Info'

import { CollapseWrapper } from './styles'

type CollapseProps = {
value?: boolean
title: string
children: ReactNode
margin?: string
info?: React.ReactNode
}

const Collapse = ({ value = true, title, children, margin = '0 0 5px 0' }: PropsWithChildren<CollapseProps>) => {
const Collapse = ({ value = true, title, children, margin = '0 0 5px 0', info }: PropsWithChildren<CollapseProps>) => {
const [checked, setChecked] = useState(value)

return (
Expand All @@ -28,6 +31,11 @@ const Collapse = ({ value = true, title, children, margin = '0 0 5px 0' }: Props
<Typography style={{ cursor: 'pointer' }} variant="h6">
{title}
</Typography>
{info && (
<Tooltip title={info}>
<InfoIcon fontSize="small" color="primary" style={{ marginLeft: 4 }} />
</Tooltip>
)}

<IconButton size="small">
{checked ? <KeyboardArrowUpIcon fontSize="small" /> : <KeyboardArrowDownIcon fontSize="small" />}
Expand Down
Loading