Skip to content

Commit

Permalink
fix archive not disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Apr 21, 2024
1 parent 6fceb42 commit dfede2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ interface Props {
interval: { start: Date; end: Date };
prescription: Prescription;
refetch: () => void;
readonly?: boolean;
}

export default function AdministrationEventCell({
administrations,
interval: { start, end },
prescription,
refetch,
readonly,
}: Props) {
const [showTimeline, setShowTimeline] = useState(false);
// Check if cell belongs to an administered prescription (including start and excluding end)
Expand Down Expand Up @@ -56,6 +58,7 @@ export default function AdministrationEventCell({
prescription={prescription}
showPrescriptionDetails
onRefetch={refetch}
readonly={readonly}
/>
</DialogModal>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export default function MedicineAdministrationTableRow({
interval={{ start, end }}
prescription={prescription}
refetch={refetch}
readonly={props.readonly}
/>
)}
</td>
Expand Down
4 changes: 3 additions & 1 deletion src/Components/Medicine/PrescrpitionTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ interface Props {
prescription: Prescription;
showPrescriptionDetails?: boolean;
onRefetch?: () => void;
readonly?: boolean;
}

export default function PrescrpitionTimeline({
prescription,
interval,
onRefetch,
readonly,
}: Props) {
const consultation = useSlug("consultation");
const { data, refetch, loading } = useQuery(
Expand Down Expand Up @@ -89,7 +91,7 @@ export default function PrescrpitionTimeline({
refetch();
}}
isLastNode={index === events.length - 1}
hideArchive={prescription.discontinued}
hideArchive={prescription.discontinued || readonly}
/>
);
}
Expand Down

0 comments on commit dfede2c

Please sign in to comment.