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 : Cancelled requests in appointments page and Remove files button from actions #10219

Merged
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0b732e6
add debounce for queries
Mahendar0701 Jan 25, 2025
f8207fc
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Jan 27, 2025
39744a6
removed files button
Mahendar0701 Jan 27, 2025
4f5a68e
Trigger Build
Mahendar0701 Jan 27, 2025
235b9ab
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Jan 29, 2025
a5b0b67
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Jan 29, 2025
d132375
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Jan 29, 2025
5ed3f52
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Jan 30, 2025
af4ae7d
adeed enabled
Mahendar0701 Jan 30, 2025
8a6808b
Merge branch 'debouned-for-appointments' of https://github.com/Mahend…
Mahendar0701 Jan 30, 2025
b0f9d31
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Feb 1, 2025
a8d34ad
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Feb 2, 2025
3eb29fb
changes
Mahendar0701 Feb 3, 2025
9e6d21a
Merge branch 'debouned-for-appointments' of https://github.com/Mahend…
Mahendar0701 Feb 3, 2025
084219f
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Feb 3, 2025
1c914c1
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Feb 3, 2025
54ce2ce
Merge branch 'develop' into debouned-for-appointments
Mahendar0701 Feb 4, 2025
8c62556
updated with realativetime
Mahendar0701 Feb 4, 2025
dd56e6c
Merge branch 'debouned-for-appointments' of https://github.com/Mahend…
Mahendar0701 Feb 4, 2025
ee5272d
adjsuted font size
Mahendar0701 Feb 4, 2025
9a976d4
Trigger Build
Mahendar0701 Feb 4, 2025
7e3d035
Trigger Build
Mahendar0701 Feb 4, 2025
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
90 changes: 47 additions & 43 deletions src/components/Patient/PatientHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { useTranslation } from "react-i18next";
import CareIcon from "@/CAREUI/icons/CareIcon";

import { Button } from "@/components/ui/button";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";

import { Avatar } from "@/components/Common/Avatar";
import Loading from "@/components/Common/Loading";
Expand All @@ -17,7 +23,7 @@ import {
import { PLUGIN_Component } from "@/PluginEngine";
import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import { formatDateTime, formatPatientAge, relativeDate } from "@/Utils/utils";
import { formatDateTime, formatPatientAge, relativeTime } from "@/Utils/utils";
import { Patient } from "@/types/emr/newPatient";

export const PatientHome = (props: {
Expand Down Expand Up @@ -148,21 +154,6 @@ export const PatientHome = (props: {
<div className="mt-2 h-full space-y-2">
<div className="space-y-3 text-left text-lg font-semibold text-secondary-900">
<div className="space-y-2">
<Button
className="w-full bg-white font-semibold text-green-800 hover:bg-secondary-200"
id="upload-patient-files"
onClick={() =>
navigate(
`/facility/${facilityId}/patient/${id}/files`,
)
}
>
<span className="flex w-full items-center justify-start gap-2">
<CareIcon icon="l-file-upload" className="text-xl" />
{t("view_update_patient_files")}
</span>
</Button>

<PLUGIN_Component
__name="PatientHomeActions"
patient={patientData}
Expand All @@ -180,46 +171,59 @@ export const PatientHome = (props: {
>
<div className="my-1 rounded-sm p-2">
<div>
<div className="text-xs font-normal text-gray-600">
{t("last_updated_by")}{" "}
<span className="font-semibold text-gray-900">
<div className="text-xs font-normal leading-5 text-gray-600">
{t("last_updated_by")}
<div className="font-semibold text-gray-900">
{patientData.updated_by?.first_name}{" "}
{patientData.updated_by?.last_name}
</span>
</div>
</div>

<div className="whitespace-normal text-sm font-semibold text-gray-900">
<div className="tooltip">
<span className={`tooltip-text tooltip`}>
{patientData.modified_date
? formatDateTime(patientData.modified_date)
: "--:--"}
</span>
{patientData.modified_date
? relativeDate(patientData.modified_date)
: "--:--"}
</div>
{patientData.modified_date ? (
Mahendar0701 marked this conversation as resolved.
Show resolved Hide resolved
<TooltipProvider delayDuration={1}>
<Tooltip>
<TooltipTrigger asChild>
<span>
{relativeTime(patientData.modified_date)}
</span>
</TooltipTrigger>
<TooltipContent>
{formatDateTime(patientData.modified_date)}
</TooltipContent>
</Tooltip>
</TooltipProvider>
) : (
"--:--"
)}
</div>
</div>

<div className="mt-4">
<div className="text-xs font-normal leading-5 text-gray-600">
{t("patient_profile_created_by")}{" "}
<span className="font-semibold text-gray-900">
{t("patient_profile_created_by")}
<div className="font-semibold text-gray-900">
{patientData.created_by?.first_name}{" "}
{patientData.created_by?.last_name}
</span>
</div>
</div>
<div className="whitespace-normal text-sm font-semibold text-gray-900">
<div className="tooltip">
<span className={`tooltip-text tooltip`}>
{patientData.created_date
? formatDateTime(patientData.created_date)
: "--:--"}
</span>
{patientData.created_date
? relativeDate(patientData.created_date)
: "--:--"}
</div>
{patientData.created_date ? (
<TooltipProvider delayDuration={1}>
<Tooltip>
<TooltipTrigger asChild>
<span>
{relativeTime(patientData.created_date)}
</span>
</TooltipTrigger>
<TooltipContent>
{formatDateTime(patientData.created_date)}
</TooltipContent>
</Tooltip>
</TooltipProvider>
) : (
"--:--"
)}
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Appointments/AppointmentsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ function AppointmentColumn(props: {
date_before: props.date_to,
},
}),
enabled: !!props.date_from && !!props.date_to,
});

let appointments = data?.results ?? [];
Expand Down Expand Up @@ -801,6 +802,7 @@ function AppointmentRow(props: {
date_before: props.date_to,
},
}),
enabled: !!props.date_from && !!props.date_to,
});

let appointments = data?.results ?? [];
Expand Down
Loading