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

Fix: Breadcrumbs redirection to patient edit consultation form #8985

Merged
Show file tree
Hide file tree
Changes from 8 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
35 changes: 19 additions & 16 deletions src/components/Facility/ConsultationDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@
const SelectedTab = tabs[tab];

const tabButtonClasses = (selected: boolean) =>
`capitalize min-w-max-content cursor-pointer font-bold whitespace-nowrap ${
selected === true
? "border-primary-500 hover:border-secondary-300 text-primary-600 border-b-2"
: "text-secondary-700 hover:text-secondary-700"
`capitalize min-w-max-content cursor-pointer font-bold whitespace-nowrap ${selected === true

Check failure on line 195 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎······`
? "border-primary-500 hover:border-secondary-300 text-primary-600 border-b-2"

Check failure on line 196 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
: "text-secondary-700 hover:text-secondary-700"

Check failure on line 197 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
}`;

return (
Expand All @@ -214,12 +213,16 @@
crumbsReplacements={{
[facilityId]: { name: patientData?.facility_object?.name },
[patientId]: { name: patientData?.name },
consultation: {
name: "Consultation",
uri: `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/update`,
},
[consultationId]: {
name:
consultationData.suggestion === "A"
? `Admitted on ${formatDateTime(
consultationData.encounter_date!,
)}`
consultationData.encounter_date!,

Check failure on line 224 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
)}`

Check failure on line 225 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
: consultationData.suggestion_text,
},
}}
Expand Down Expand Up @@ -273,8 +276,8 @@
onClick={() =>
showPatientNotesPopup
? navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/notes`,
)
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/notes`,

Check failure on line 279 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
)

Check failure on line 280 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `····················` with `······················`
: setShowPatientNotesPopup(true)
}
className="btn btn-primary m-1 w-full hover:text-white"
Expand Down Expand Up @@ -310,14 +313,14 @@
</div>
{(consultationData.discharge_date ??
consultationData.encounter_date) && (
<div className="text-3xl font-bold">
{relativeTime(
consultationData.discharge_date
? consultationData.discharge_date
: consultationData.encounter_date,
)}
</div>
)}
<div className="text-3xl font-bold">

Check failure on line 316 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `··`
{relativeTime(

Check failure on line 317 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `··`
consultationData.discharge_date

Check failure on line 318 in src/components/Facility/ConsultationDetails/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `··`
? consultationData.discharge_date
: consultationData.encounter_date,
)}
</div>
)}
<div className="-mt-2 text-xs">
{consultationData.encounter_date &&
formatDateTime(consultationData.encounter_date)}
Expand Down
6 changes: 5 additions & 1 deletion src/components/Patient/PatientConsentRecords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export default function PatientConsentRecords(props: {
crumbsReplacements={{
[facilityId]: { name: patient?.facility_object?.name },
[patientId]: { name: patient?.name },
consultation: {
name: "Consultation",
uri: `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/update`,
shauryag2002 marked this conversation as resolved.
Show resolved Hide resolved
},
[consultationId]: {
name:
patient?.last_consultation?.suggestion === "A"
Expand All @@ -121,7 +125,7 @@ export default function PatientConsentRecords(props: {
: patient?.last_consultation?.suggestion_text,
},
}}
backUrl={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/`}
backUrl={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/update`}
shauryag2002 marked this conversation as resolved.
Show resolved Hide resolved
>
{fileUpload.Dialogues}
{fileManager.Dialogues}
Expand Down
Loading