Skip to content

Commit

Permalink
small ui change
Browse files Browse the repository at this point in the history
  • Loading branch information
wermarter committed Mar 20, 2024
1 parent bdb421d commit 4861591
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { Controller, useForm } from 'react-hook-form'
import { toast } from 'react-toastify'
import { useNavigate } from 'react-router-dom'
import { difference, omit } from 'lodash'
import { trimStringValues } from '@diut/common'

import {
FormContainer,
Expand Down Expand Up @@ -53,7 +54,6 @@ import { DoctorResponseDto } from 'src/infra/api/access-service/doctor'
import { SampleTypeResponseDto } from 'src/infra/api/access-service/sample-type'
import { BranchResponseDto } from 'src/infra/api/access-service/branch'
import { authSlice } from 'src/features/auth'
import { trimStringValues } from '@diut/common'

const currentYear = new Date().getFullYear()

Expand Down Expand Up @@ -456,6 +456,12 @@ export function InfoEditView(props: InfoEditViewProps) {
'testIds',
items.map((item) => item._id),
)
const sampleTypeIds = new Set(
items
.map((item) => item.sampleTypeId)
.filter((id): id is string => id !== null),
)
setValue('sampleTypeIds', Array.from(sampleTypeIds))
}}
showCombos
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '@mui/material'
import Grid from '@mui/material/Unstable_Grid2'
import { LoadingButton } from '@mui/lab'
import { trimStringValues } from '@diut/common'

import { authSlice } from 'src/features/auth'
import { BranchResponseDto } from 'src/infra/api/access-service/branch'
Expand Down Expand Up @@ -55,7 +56,6 @@ import {
import { TestSelector } from 'src/features/test'
import { DataTable } from 'src/components/table'
import { BarcodeModal } from '../BarcodeModal'
import { trimStringValues } from '@diut/common'

export type InputFormProps = {
patientTypes: PatientTypeResponseDto[]
Expand Down Expand Up @@ -492,6 +492,12 @@ export function InfoInputForm(props: InputFormProps) {
'testIds',
items.map((item) => item._id),
)
const sampleTypeIds = new Set(
items
.map((item) => item.sampleTypeId)
.filter((id): id is string => id !== null),
)
setValue('sampleTypeIds', Array.from(sampleTypeIds))
}}
showCombos
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,14 @@ export function ResultCard(props: ResultCardProps) {
}}
subheader={props.testResult.bioProductName}
action={
<Box sx={{ m: 1, display: 'flex', alignItems: 'center' }}>
{props.testResult.resultAt !== undefined && (
<Typography sx={{ opacity: 0.5, mr: 1 }} variant="overline">
{format(new Date(props.testResult.resultAt), DATETIME_FORMAT)}
</Typography>
)}
{props.testResult.resultBy != null && (
<Typography sx={{ fontStyle: 'italic', mr: 2 }}>
{props.testResult.resultBy.name}
</Typography>
)}
<Box
sx={{
m: 1,
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-end',
}}
>
<ButtonGroup>
{isLocked ? (
<Button
Expand Down Expand Up @@ -175,6 +172,13 @@ export function ResultCard(props: ResultCardProps) {
<SaveIcon />
</Button>
</ButtonGroup>
{props.testResult.resultBy != null && (
<Typography sx={{ opacity: 0.5 }} variant="overline">
{props.testResult.resultBy.name}
{' - '}
{format(new Date(props.testResult.resultAt!), DATETIME_FORMAT)}
</Typography>
)}
</Box>
}
/>
Expand Down

0 comments on commit 4861591

Please sign in to comment.