Skip to content

Commit b8e49d7

Browse files
authored
feat(prélèvement): affiche la date du prélèvement et celle de l'envoi du PV (#629)
1 parent 423d24b commit b8e49d7

File tree

2 files changed

+26
-43
lines changed

2 files changed

+26
-43
lines changed

frontend/src/views/SampleView/SampleOverview/SampleAgreementOverview.tsx

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import Alert from '@codegouvfr/react-dsfr/Alert';
12
import { cx } from '@codegouvfr/react-dsfr/fr/cx';
23
import Input from '@codegouvfr/react-dsfr/Input';
34
import RadioButtons from '@codegouvfr/react-dsfr/RadioButtons';
45
import { SampleChecked } from 'maestro-shared/schema/Sample/Sample';
6+
import { formatDateTime } from 'maestro-shared/utils/date';
57
import './SampleOverview.scss';
68

79
interface Props {
@@ -53,49 +55,20 @@ const SampleAgreementOverview = ({ sample }: Props) => {
5355
/>
5456
</div>
5557
</div>
56-
<div>
57-
<div className={cx('fr-grid-row', 'fr-grid-row--gutters')}>
58-
<div className={cx('fr-col-12', 'fr-mb-1w')}>
59-
<h6 className={cx('fr-mb-0')}>
60-
Envoi du procès-verbal au détenteur de la marchandise
61-
</h6>
62-
</div>
63-
</div>
64-
<div className={cx('fr-grid-row', 'fr-grid-row--gutters')}>
65-
<div className={cx('fr-col-6', 'fr-col-sm-3')}>
66-
<Input
67-
label="Identité du détenteur"
68-
hintText="Nom"
69-
disabled
70-
nativeInputProps={{
71-
value: sample.ownerLastName ?? ''
72-
}}
73-
/>
74-
</div>
75-
<div className={cx('fr-col-6', 'fr-col-sm-3')}>
76-
<Input
77-
label={' '}
78-
hintText="Prénom"
79-
disabled
80-
nativeInputProps={{
81-
disabled: true,
82-
value: sample.ownerFirstName ?? ''
83-
}}
84-
/>
85-
</div>
86-
<div className={cx('fr-col-12', 'fr-col-sm-6')}>
87-
<Input
88-
label="E-mail du détenteur"
89-
hintText="Le détenteur a reçu une copie du procès-verbal"
90-
disabled
91-
nativeInputProps={{
92-
disabled: true,
93-
value: sample.ownerEmail ?? ''
94-
}}
95-
/>
96-
</div>
97-
</div>
98-
</div>
58+
<Alert
59+
severity={'info'}
60+
small={true}
61+
description={
62+
<>
63+
Le procès-verbal a été envoyé au détenteur{' '}
64+
<b>
65+
{sample.ownerLastName} {sample.ownerFirstName}
66+
</b>{' '}
67+
à l'email <b>{sample.ownerEmail}</b> le{' '}
68+
<b>{sample.sentAt ? formatDateTime(sample.sentAt) : ''}</b>.
69+
</>
70+
}
71+
></Alert>
9972
</>
10073
);
10174
};

frontend/src/views/SampleView/StepSummary/ContextStepSummary.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
SampleOwnerData,
1111
SampleToCreate
1212
} from 'maestro-shared/schema/Sample/Sample';
13+
import { formatDate } from 'maestro-shared/utils/date';
1314
import { useAuthentication } from 'src/hooks/useAuthentication';
1415
import { quote } from 'src/utils/stringUtils';
1516
import StepSummary, {
@@ -53,6 +54,15 @@ const ContextStepSummary = ({
5354
)}
5455
</div>
5556
</div>
57+
{isCreatedPartialSample(sample) && (
58+
<div className="summary-item icon-text">
59+
<div className={cx('fr-icon-calendar-event-line')}></div>
60+
<div>
61+
Date du prélèvement :{' '}
62+
<b>{formatDate(sample.sampledAt)}</b>
63+
</div>
64+
</div>
65+
)}
5666
<div className="summary-item icon-text">
5767
<div className={cx('fr-icon-road-map-line')}></div>
5868
<div>

0 commit comments

Comments
 (0)