From ea95f1a8886f85dc871453b4b07981d43be6dac3 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Thu, 6 Mar 2025 09:16:16 +0000 Subject: [PATCH 01/18] Fix Organization View Pagination and Search (#11074) --- src/pages/Organization/OrganizationView.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/pages/Organization/OrganizationView.tsx b/src/pages/Organization/OrganizationView.tsx index 88cb629baf1..358ace39708 100644 --- a/src/pages/Organization/OrganizationView.tsx +++ b/src/pages/Organization/OrganizationView.tsx @@ -1,6 +1,6 @@ import { useQuery } from "@tanstack/react-query"; import { Link } from "raviger"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import CareIcon from "@/CAREUI/icons/CareIcon"; @@ -13,6 +13,8 @@ import { Input } from "@/components/ui/input"; import Pagination from "@/components/Common/Pagination"; import { CardGridSkeleton } from "@/components/Common/SkeletonLoading"; +import { RESULTS_PER_PAGE_LIMIT } from "@/common/constants"; + import query from "@/Utils/request/query"; import { Organization, getOrgLabel } from "@/types/organization/organization"; import organizationApi from "@/types/organization/organizationApi"; @@ -30,20 +32,23 @@ export default function OrganizationView({ id, navOrganizationId }: Props) { const [page, setPage] = useState(1); const [searchQuery, setSearchQuery] = useState(""); - const limit = 12; // 3x4 grid const { data: children, isFetching } = useQuery({ - queryKey: ["organization", id, "children", page, limit, searchQuery], + queryKey: ["organization", id, "children", page, searchQuery], queryFn: query.debounced(organizationApi.list, { queryParams: { parent: id, - offset: (page - 1) * limit, - limit, + offset: (page - 1) * RESULTS_PER_PAGE_LIMIT, + limit: RESULTS_PER_PAGE_LIMIT, name: searchQuery || undefined, }, }), }); + useEffect(() => { + setPage(1); + }, [id, searchQuery]); + // Hack for the sidebar to work const baseUrl = navOrganizationId ? `/organization/${navOrganizationId}` @@ -134,12 +139,12 @@ export default function OrganizationView({ id, navOrganizationId }: Props) { )} - {children && children.count > limit && ( + {children && children.count > RESULTS_PER_PAGE_LIMIT && (
setPage(page)} - defaultPerPage={limit} + defaultPerPage={RESULTS_PER_PAGE_LIMIT} cPage={page} />
From 1dad7e2f4cb4cc9be40eed6f364d23b1b12cd148 Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan <40040905+Jacobjeevan@users.noreply.github.com> Date: Thu, 6 Mar 2025 15:22:41 +0530 Subject: [PATCH 02/18] Minor layout fixes (#11073) --- src/Routers/AppRouter.tsx | 2 +- src/components/Patient/EncounterQuestionnaire.tsx | 2 +- src/components/Patient/PatientHome.tsx | 2 +- .../Questionnaire/QuestionTypes/DateTimeQuestion.tsx | 4 ++-- src/components/Questionnaire/QuestionnaireForm.tsx | 2 +- src/components/Resource/ResourceDetails.tsx | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Routers/AppRouter.tsx b/src/Routers/AppRouter.tsx index 2290d192f95..70261f45c54 100644 --- a/src/Routers/AppRouter.tsx +++ b/src/Routers/AppRouter.tsx @@ -105,7 +105,7 @@ export default function AppRouter() { )}
diff --git a/src/components/Patient/EncounterQuestionnaire.tsx b/src/components/Patient/EncounterQuestionnaire.tsx index 0a7eefe1804..d8d4afb297e 100644 --- a/src/components/Patient/EncounterQuestionnaire.tsx +++ b/src/components/Patient/EncounterQuestionnaire.tsx @@ -40,7 +40,7 @@ export default function EncounterQuestionnaire({ }); return ( -
+
{encounter && (
} > -
+
diff --git a/src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx b/src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx index 4432477b82b..df327ed4d43 100644 --- a/src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx @@ -92,7 +92,7 @@ export function DateTimeQuestion({ }; return ( -
+
diff --git a/src/components/Resource/ResourceDetails.tsx b/src/components/Resource/ResourceDetails.tsx index 866f8deb4ab..21b5154f5ca 100644 --- a/src/components/Resource/ResourceDetails.tsx +++ b/src/components/Resource/ResourceDetails.tsx @@ -124,7 +124,7 @@ export default function ResourceDetails({ return ( -
+
{/* Action Buttons */}
From 3574cb488a9461137d808d601dfe23137366dcce Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Thu, 6 Mar 2025 10:56:02 +0000 Subject: [PATCH 03/18] Add translation for District Panchayat government organization type (#11078) --- public/locale/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/public/locale/en.json b/public/locale/en.json index 7c297c0722c..15d0eacbdeb 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -232,6 +232,7 @@ "SYSTEM__govt_org_type__corporation": "Corporation", "SYSTEM__govt_org_type__default": "State", "SYSTEM__govt_org_type__district": "District", + "SYSTEM__govt_org_type__district_panchayat": "District Panchayat", "SYSTEM__govt_org_type__grama_panchayat": "Grama Panchayat", "SYSTEM__govt_org_type__local_body": "Local Body", "SYSTEM__govt_org_type__municipality": "Municipality", From eebd178b57fdb684e5b452fb06ab51bf61f3af9f Mon Sep 17 00:00:00 2001 From: Abhimanyu Rajeesh <63541653+abhimanyurajeesh@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:27:53 +0530 Subject: [PATCH 04/18] Fix: Brush up on the Facility General/Home page design (#11041) --- src/components/Facility/FacilityHome.tsx | 71 +++++++++++++----------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/src/components/Facility/FacilityHome.tsx b/src/components/Facility/FacilityHome.tsx index 2c3e121afd8..ad7a455b17c 100644 --- a/src/components/Facility/FacilityHome.tsx +++ b/src/components/Facility/FacilityHome.tsx @@ -4,6 +4,7 @@ import { useMutation } from "@tanstack/react-query"; import { Hospital } from "lucide-react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; +import { formatPhoneNumberIntl } from "react-phone-number-input"; import { toast } from "sonner"; import CareIcon from "@/CAREUI/icons/CareIcon"; @@ -185,10 +186,10 @@ export const FacilityHome = ({ facilityId }: Props) => { onOpenChange={(open) => setEditCoverImage(open)} hint={coverImageHint} /> -
+
-
+
{facilityData?.read_cover_image_url ? ( <> { alt={facilityData?.name} className="h-full w-full object-cover rounded-2xl" /> -
+
) : ( -
+
)}
-
+
-
+
-
+

{facilityData?.name}

-

+

{facilityData?.facility_type}

@@ -257,12 +258,13 @@ export const FacilityHome = ({ facilityId }: Props) => {
-
+
{hasPermissionToEditCoverImage && ( } />
-
+
- -
+ +
- - {t("address")} - - + {t("address")} + {facilityData.address}
-
- +
+ {t("mobile_number")} - +
-
- +
+ {t("location_details")} - + {facilityData.latitude && facilityData.longitude && ( {
- + -
+
{facilityData.geo_organization && renderGeoOrganizations( facilityData.geo_organization, ).map((item, index) => (
- + {item.label} - + {item.value}
@@ -358,7 +364,7 @@ export const FacilityHome = ({ facilityId }: Props) => { FACILITY_FEATURE_TYPES.some((f) => f.id === feature), ) && ( - + {t("features")} @@ -379,7 +385,10 @@ export const FacilityHome = ({ facilityId }: Props) => { {facilityData?.description && ( - + )} From b9e5f91d3c5017349e4fe7aad1f79727303cccae Mon Sep 17 00:00:00 2001 From: Prasanth <127669274+Prasanth-S7@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:29:32 +0530 Subject: [PATCH 05/18] card ui fix: inconsistent ui in the card (#10981) Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> --- src/pages/Organization/OrganizationView.tsx | 51 ++++++++++----------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/src/pages/Organization/OrganizationView.tsx b/src/pages/Organization/OrganizationView.tsx index 358ace39708..45031b98b24 100644 --- a/src/pages/Organization/OrganizationView.tsx +++ b/src/pages/Organization/OrganizationView.tsx @@ -88,37 +88,24 @@ export default function OrganizationView({ id, navOrganizationId }: Props) {
{children?.results?.length ? ( children.results.map((orgChild: Organization) => ( - - -
-
-
-

- {orgChild.name} -

-
+ + +
+
+

+ {orgChild.name} +

+
+ {orgChild.org_type} + {orgChild.metadata?.govt_org_type && ( - {orgChild.org_type} + {getOrgLabel( + orgChild.org_type, + orgChild.metadata, + )} - {orgChild.metadata?.govt_org_type && ( - - {getOrgLabel( - orgChild.org_type, - orgChild.metadata, - )} - - )} -
+ )}
-
{orgChild.description && (

@@ -127,6 +114,14 @@ export default function OrganizationView({ id, navOrganizationId }: Props) { )}

+
+ +
)) ) : ( From 6e983ad4b15cb1280ff612f7cfd49bc23f63bea8 Mon Sep 17 00:00:00 2001 From: Jeffrin Jojo <135723871+Jeffrin2005@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:31:45 +0530 Subject: [PATCH 06/18] Fix : Button Refreshes Entire Organizations (#10978) --- public/locale/en.json | 2 + .../Patient/LinkDepartmentsSheet.tsx | 100 +++++++++++------- 2 files changed, 65 insertions(+), 37 deletions(-) diff --git a/public/locale/en.json b/public/locale/en.json index 15d0eacbdeb..83ce105e0bf 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -1681,10 +1681,12 @@ "ordering": "Ordering", "organization": "Organization", "organization_access_help": "Organizations help you manage facilities, users, and resources efficiently. Contact your administrator to get access.", + "organization_added_successfully": "Organization added successfully", "organization_created_successfully": "Organization created successfully", "organization_for_care_support": "Organization for Care Support", "organization_forbidden": "You don't have access to any organizations yet.", "organization_not_found": "No Organizations Found", + "organization_removed_successfully": "Organization removed successfully", "organization_required": "Organization is required", "organizations": "Organizations", "organizations_fetch_error": "Error while fetching organizations", diff --git a/src/components/Patient/LinkDepartmentsSheet.tsx b/src/components/Patient/LinkDepartmentsSheet.tsx index d3f98027b06..e51f49c7658 100644 --- a/src/components/Patient/LinkDepartmentsSheet.tsx +++ b/src/components/Patient/LinkDepartmentsSheet.tsx @@ -84,25 +84,28 @@ function getInvalidateQueries( return ["location", entityId, "organizations"]; } -export default function LinkDepartmentsSheet({ +function DeleteOrganizationButton({ + organizationId, entityType, entityId, - currentOrganizations, facilityId, - trigger, - onUpdate, -}: Props) { - const [open, setOpen] = useState(false); - const [selectedOrg, setSelectedOrg] = useState(""); + onSuccess, +}: { + organizationId: string; + entityType: "encounter" | "location"; + entityId: string; + facilityId: string; + onSuccess?: () => void; +}) { const queryClient = useQueryClient(); - const { mutate: addOrganization, isPending: isAdding } = useMutation({ + const { mutate: removeOrganization, isPending } = useMutation({ mutationFn: (organizationId: string) => { const { route, pathParams } = getMutationParams( entityType, entityId, facilityId, - true, + false, ); return mutate(route, { pathParams, @@ -110,12 +113,15 @@ export default function LinkDepartmentsSheet({ })({ organization: organizationId }); }, onSuccess: () => { - const invalidateQueries = getInvalidateQueries(entityType, entityId); - queryClient.invalidateQueries({ queryKey: invalidateQueries }); - toast.success("Organization added successfully"); - setSelectedOrg(""); - setOpen(false); - onUpdate?.(); + const { queryKey } = getMutationParams( + entityType, + entityId, + facilityId, + false, + ); + queryClient.invalidateQueries({ queryKey }); + toast.success(t("organization_removed_successfully")); + onSuccess?.(); }, onError: (error) => { const errorData = error.cause as { errors: { msg: string }[] }; @@ -125,13 +131,41 @@ export default function LinkDepartmentsSheet({ }, }); - const { mutate: removeOrganization, isPending: isRemoving } = useMutation({ + return ( + + ); +} + +export default function LinkDepartmentsSheet({ + entityType, + entityId, + currentOrganizations, + facilityId, + trigger, + onUpdate, +}: Props) { + const [open, setOpen] = useState(false); + const [selectedOrg, setSelectedOrg] = useState(""); + const queryClient = useQueryClient(); + + const { mutate: addOrganization, isPending: isAdding } = useMutation({ mutationFn: (organizationId: string) => { const { route, pathParams } = getMutationParams( entityType, entityId, facilityId, - false, + true, ); return mutate(route, { pathParams, @@ -139,14 +173,11 @@ export default function LinkDepartmentsSheet({ })({ organization: organizationId }); }, onSuccess: () => { - const { queryKey } = getMutationParams( - entityType, - entityId, - facilityId, - false, - ); - queryClient.invalidateQueries({ queryKey }); - toast.success("Organization removed successfully"); + const invalidateQueries = getInvalidateQueries(entityType, entityId); + queryClient.invalidateQueries({ queryKey: invalidateQueries }); + toast.success(t("organization_added_successfully")); + setSelectedOrg(""); + setOpen(false); onUpdate?.(); }, onError: (error) => { @@ -215,18 +246,13 @@ export default function LinkDepartmentsSheet({ )}
- +
))} {currentOrganizations.length === 0 && ( From 7d709f2b02de909d0751de8cd3bae7dc691b4810 Mon Sep 17 00:00:00 2001 From: Vikas_pal8923 <145531494+Vikaspal8923@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:34:05 +0530 Subject: [PATCH 07/18] feat:Add Resend OTP button at the login page (#10940) --- .example.env | 5 +++- care.config.ts | 7 +++++ public/locale/en.json | 1 + src/components/Auth/Login.tsx | 48 +++++++++++++++++++++++++++++++++-- 4 files changed, 58 insertions(+), 3 deletions(-) diff --git a/.example.env b/.example.env index 79e826ad65f..25056224337 100644 --- a/.example.env +++ b/.example.env @@ -64,4 +64,7 @@ REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn" REACT_DEFAULT_COUNTRY= # Maps fallback URL template (default:"https://www.openstreetmap.org/?mlat={lat}&mlon={long}&zoom=15") -REACT_MAPS_FALLBACK_URL_TEMPLATE= \ No newline at end of file +REACT_MAPS_FALLBACK_URL_TEMPLATE= + +# OTP resend timeout in seconds (eg. 90 seconds) (default : 120 seconds) +REACT_APP_RESEND_OTP_TIMEOUT= \ No newline at end of file diff --git a/care.config.ts b/care.config.ts index 9f646dbab0a..a6d472b5a20 100644 --- a/care.config.ts +++ b/care.config.ts @@ -136,6 +136,13 @@ const careConfig = { env.REACT_OBSERVATION_PLOTS_CONFIG_URL || "/config/plots.json", defaultCountry: (env.REACT_DEFAULT_COUNTRY || "IN") as CountryCode, + + resendOtpTimeout: env.REACT_APP_RESEND_OTP_TIMEOUT + ? parseInt(env.REACT_APP_RESEND_OTP_TIMEOUT, 10) + : 30, + + + } as const; export default careConfig; diff --git a/public/locale/en.json b/public/locale/en.json index 83ce105e0bf..009ecf1274c 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -1996,6 +1996,7 @@ "rescheduled": "Rescheduled", "rescheduling": "Rescheduling...", "resend_otp": "Resend OTP", + "resend_otp_timer":"Resend OTP in {{time}} seconds", "reserved": "Reserved", "reset": "Reset", "reset_password": "Reset Password", diff --git a/src/components/Auth/Login.tsx b/src/components/Auth/Login.tsx index 87eb7c10004..e8b3d128639 100644 --- a/src/components/Auth/Login.tsx +++ b/src/components/Auth/Login.tsx @@ -69,8 +69,14 @@ interface LoginProps { const Login = (props: LoginProps) => { const { signIn, patientLogin, isAuthenticating } = useAuthContext(); - const { reCaptchaSiteKey, urls, stateLogo, customLogo, customLogoAlt } = - careConfig; + const { + reCaptchaSiteKey, + urls, + stateLogo, + customLogo, + customLogoAlt, + resendOtpTimeout, + } = careConfig; const customDescriptionHtml = __CUSTOM_DESCRIPTION_HTML__; const initForm: any = { username: "", @@ -93,6 +99,21 @@ const Login = (props: LoginProps) => { const [otp, setOtp] = useState(""); const [otpError, setOtpError] = useState(""); const [otpValidationError, setOtpValidationError] = useState(""); + const [resendOtpCountdown, setResendOtpCountdown] = + useState(resendOtpTimeout); + + // Timer Function for resend OTP + useEffect(() => { + if (resendOtpCountdown <= 0) { + return; + } + + const timer = setInterval(() => { + setResendOtpCountdown((prevTime) => prevTime - 1); + }, 1000); + + return () => clearInterval(timer); + }, []); // Remember the last login mode useEffect(() => { @@ -272,6 +293,7 @@ const Login = (props: LoginProps) => { if (!isOtpSent) { sendOtp({ phone_number: phone }); + setResendOtpCountdown(resendOtpTimeout); } else { verifyOtp({ phone_number: phone, otp }); } @@ -673,6 +695,28 @@ const Login = (props: LoginProps) => { t("send_otp") )} + {isOtpSent && + (resendOtpCountdown <= 0 ? ( +
+ +
+ ) : ( +

+ {t("resend_otp_timer", { + time: resendOtpCountdown, + })} +

+ ))} From c3731ba43b338538a5ba61ca7a33ee285683fbaa Mon Sep 17 00:00:00 2001 From: Mohamed amaan <121436543+modamaan@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:35:40 +0530 Subject: [PATCH 08/18] Refactor Tooltip Implementations to Use TooltipComponent for Consistent and Simplified Management also Add TooltipComponent to FacilityHomepage (#10681) --- src/components/Common/FilePreviewDialog.tsx | 23 ++--- src/components/Facility/FacilityHome.tsx | 20 +++-- src/components/Files/ArchivedFileDialog.tsx | 22 ++--- src/components/Files/FilesTab.tsx | 24 ++---- src/components/Patient/PatientHome.tsx | 41 +++------ .../MedicationRequestQuestion.tsx | 56 ++++++------ .../MedicationStatementQuestion.tsx | 56 ++++++------ src/components/ui/tooltip.tsx | 2 +- .../Encounters/tabs/EncounterNotesTab.tsx | 86 +++++++------------ 9 files changed, 121 insertions(+), 209 deletions(-) diff --git a/src/components/Common/FilePreviewDialog.tsx b/src/components/Common/FilePreviewDialog.tsx index 7aaabf84dd5..ea03c164153 100644 --- a/src/components/Common/FilePreviewDialog.tsx +++ b/src/components/Common/FilePreviewDialog.tsx @@ -1,6 +1,3 @@ -import { TooltipContent, TooltipTrigger } from "@radix-ui/react-tooltip"; -import { TooltipProvider } from "@radix-ui/react-tooltip"; -import { Tooltip } from "@radix-ui/react-tooltip"; import { Dispatch, ReactNode, @@ -24,6 +21,7 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog"; +import { TooltipComponent } from "@/components/ui/tooltip"; import CircularProgress from "@/components/Common/CircularProgress"; import { FileUploadModel } from "@/components/Patient/models"; @@ -191,20 +189,11 @@ const FilePreviewDialog = (props: FilePreviewProps) => { <>
- - - -

- {fileNameTooltip} -

-
- -

- {fileName} -

-
-
-
+ +

+ {fileNameTooltip} +

+
{uploadedFiles && uploadedFiles[index] && uploadedFiles[index].created_date && ( diff --git a/src/components/Facility/FacilityHome.tsx b/src/components/Facility/FacilityHome.tsx index ad7a455b17c..2820ec5aca9 100644 --- a/src/components/Facility/FacilityHome.tsx +++ b/src/components/Facility/FacilityHome.tsx @@ -12,6 +12,7 @@ import CareIcon from "@/CAREUI/icons/CareIcon"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Markdown } from "@/components/ui/markdown"; +import { TooltipComponent } from "@/components/ui/tooltip"; import { Avatar } from "@/components/Common/Avatar"; import AvatarEditModal from "@/components/Common/AvatarEditModal"; @@ -215,12 +216,19 @@ export const FacilityHome = ({ facilityId }: Props) => {
-

- {facilityData?.name} -

-

- {facilityData?.facility_type} -

+ +

+ {facilityData?.name} +

+
+ +

+ {facilityData?.facility_type} +

+
diff --git a/src/components/Files/ArchivedFileDialog.tsx b/src/components/Files/ArchivedFileDialog.tsx index ac3eec81e3e..a6b9e29caa4 100644 --- a/src/components/Files/ArchivedFileDialog.tsx +++ b/src/components/Files/ArchivedFileDialog.tsx @@ -7,12 +7,7 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; +import { TooltipComponent } from "@/components/ui/tooltip"; import { FileUploadModel } from "@/components/Patient/models"; @@ -42,16 +37,11 @@ export default function ArchivedFileDialog({ {t("archived_file")}:{" "} - - - - {fileName} - - -

{fileName}

-
-
-
+ + + {fileName} + +
diff --git a/src/components/Files/FilesTab.tsx b/src/components/Files/FilesTab.tsx index 3c1abcbfb45..96702737e08 100644 --- a/src/components/Files/FilesTab.tsx +++ b/src/components/Files/FilesTab.tsx @@ -28,12 +28,7 @@ import { TableRow, } from "@/components/ui/table"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; +import { TooltipComponent } from "@/components/ui/tooltip"; import Loading from "@/components/Common/Loading"; import ArchivedFileDialog from "@/components/Files/ArchivedFileDialog"; @@ -548,18 +543,11 @@ export const FilesTab = (props: FilesTabProps) => { {file.name && file.name.length > 20 ? ( - - - - - {fileName} - - - - {fileName} - - - + + + {fileName} + + ) : ( {fileName} diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx index 1d4cfb2b24c..0d91b9b121f 100644 --- a/src/components/Patient/PatientHome.tsx +++ b/src/components/Patient/PatientHome.tsx @@ -5,12 +5,7 @@ import { useTranslation } from "react-i18next"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; +import { TooltipComponent } from "@/components/ui/tooltip"; import { Avatar } from "@/components/Common/Avatar"; import Loading from "@/components/Common/Loading"; @@ -198,18 +193,11 @@ export const PatientHome = (props: {
{patientData.modified_date ? ( - - - - - {relativeTime(patientData.modified_date)} - - - - {formatDateTime(patientData.modified_date)} - - - + + {relativeTime(patientData.modified_date)} + ) : ( "--:--" )} @@ -226,18 +214,11 @@ export const PatientHome = (props: {
{patientData.created_date ? ( - - - - - {relativeTime(patientData.created_date)} - - - - {formatDateTime(patientData.created_date)} - - - + + {relativeTime(patientData.created_date)} + ) : ( "--:--" )} diff --git a/src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx b/src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx index d2782a44300..9e7dc18a175 100644 --- a/src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx @@ -37,12 +37,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; +import { TooltipComponent } from "@/components/ui/tooltip"; import { ComboboxQuantityInput } from "@/components/Common/ComboboxQuantityInput"; import { MultiValueSetSelect } from "@/components/Medicine/MultiValueSetSelect"; @@ -304,32 +299,29 @@ export function MedicationRequestQuestion({ )} - - - - - - - {medication.status === "entered_in_error" - ? t("medication_already_marked_as_error") - : t("remove_medication")} - - - + + +
diff --git a/src/components/Questionnaire/QuestionTypes/MedicationStatementQuestion.tsx b/src/components/Questionnaire/QuestionTypes/MedicationStatementQuestion.tsx index b48013beee5..44ba2fe232f 100644 --- a/src/components/Questionnaire/QuestionTypes/MedicationStatementQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/MedicationStatementQuestion.tsx @@ -34,12 +34,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; +import { TooltipComponent } from "@/components/ui/tooltip"; import { NotesInput } from "@/components/Questionnaire/QuestionTypes/NotesInput"; import ValueSetSelect from "@/components/Questionnaire/ValueSetSelect"; @@ -295,32 +290,29 @@ export function MedicationStatementQuestion({ )} - - - - - - - {medication.status === "entered_in_error" - ? t("medication_already_marked_as_error") - : t("remove_medication")} - - - + + +
diff --git a/src/components/ui/tooltip.tsx b/src/components/ui/tooltip.tsx index 3bf12b3407f..f0f78cf080d 100644 --- a/src/components/ui/tooltip.tsx +++ b/src/components/ui/tooltip.tsx @@ -42,7 +42,7 @@ const TooltipComponent = React.forwardRef< ref={ref} sideOffset={sideOffset} className={cn( - "z-50 overflow-hidden rounded-md bg-gray-900 px-3 py-1.5 text-xs text-gray-50 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:bg-gray-50 dark:text-gray-900", + "z-50 whitespace-pre-line overflow-hidden rounded-md bg-gray-900 px-3 py-1.5 text-xs text-gray-50 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:bg-gray-50 dark:text-gray-900", className, )} side={side} diff --git a/src/pages/Encounters/tabs/EncounterNotesTab.tsx b/src/pages/Encounters/tabs/EncounterNotesTab.tsx index 9667431cd60..5e02ec4c88c 100644 --- a/src/pages/Encounters/tabs/EncounterNotesTab.tsx +++ b/src/pages/Encounters/tabs/EncounterNotesTab.tsx @@ -44,12 +44,7 @@ import { SheetTitle, } from "@/components/ui/sheet"; import { Textarea } from "@/components/ui/textarea"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; +import { TooltipComponent } from "@/components/ui/tooltip"; import { Avatar } from "@/components/Common/Avatar"; import Loading from "@/components/Common/Loading"; @@ -82,16 +77,9 @@ const threadTemplates = [ // Info tooltip component for help text const InfoTooltip = ({ content }: { content: string }) => ( - - - - - - -

{content}

-
-
-
+ + + ); // Thread item component @@ -146,27 +134,19 @@ const MessageItem = forwardRef( isCurrentUser ? "flex-row-reverse" : "flex-row", )} > - - - - -
- -
-
- - -

{message.created_by.username}

-
-
-
- + + + + + + +
{ ?.title } - - -
- - - {new Set(messages.map((m) => m.created_by.id)).size} - - - {totalMessages} -
-
- -

- {t("participants")}:{" "} + m.created_by.id)).size} + ${t("messages")}: ${totalMessages}`} + > +

+ + {new Set(messages.map((m) => m.created_by.id)).size} -

-

- {t("messages")}: {totalMessages} -

- - +
+ + {totalMessages} +
+
) : (
From 087ae8990f90bce81cf3e1efa7b7599a363ce97a Mon Sep 17 00:00:00 2001 From: G O Ashwin Praveen <143274955+ashwinpraveengo@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:43:52 +0530 Subject: [PATCH 09/18] bugfix:Remove arrow icon from cancel button in Create Questionnaire (#10773) --- public/locale/en.json | 21 ++++++ .../Questionnaire/QuestionnaireEditor.tsx | 75 +++++++++---------- 2 files changed, 57 insertions(+), 39 deletions(-) diff --git a/public/locale/en.json b/public/locale/en.json index 009ecf1274c..a7ec53324ab 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -291,6 +291,7 @@ "add_attachments": "Add Attachments", "add_beds": "Add Bed(s)", "add_beds_to_configure_presets": "Add beds to this location to configure presets for them.", + "add_condition": "Add Condition", "add_consultation": "Add consultation", "add_consultation_update": "Add Consultation Update", "add_contact_point": "Add Contact Point", @@ -313,6 +314,7 @@ "add_notes_about_diagnosis": "Add notes about the diagnosis...", "add_notes_about_symptom": "Add notes about the symptom...", "add_notes_about_the_allergy": "Add notes about the allergy", + "add_option": "Add Option", "add_organizations": "Add Organizations", "add_patient_updates": "Add Patient Updates", "add_policy": "Add Insurance Policy", @@ -320,12 +322,14 @@ "add_prescription_to_consultation_note": "Add a new prescription to this consultation.", "add_preset": "Add preset", "add_prn_prescription": "Add PRN Prescription", + "add_question": "Add Question", "add_questionnaire": "Add Questionnaire", "add_remarks": "Add remarks", "add_schedule_exceptions": "Add Schedule Exceptions", "add_schedule_exceptions_description": "Configure absences or add availability beyond the regular schedule.", "add_skill": "Add Skill", "add_spoke": "Add Spoke Facility", + "add_sub_question": "Add Sub-Question", "add_tags": "Add Tags", "add_user": "Add User", "added_on": "Added on", @@ -552,6 +556,7 @@ "choose_date_time": "Choose Date and Time", "choose_district": "Choose District", "choose_file": "Upload From Device", + "choose_layout_style": "Choose the layout style that best fits your sub-questions from the available options.", "choose_localbody": "Choose Local Body", "choose_location": "Choose Location", "choose_other_search_type": "Choose other search types", @@ -605,10 +610,16 @@ "click_manage_sub_locations": "Click See Details to manage sub-locations.", "click_manage_sub_locations_mobile": "Click to edit and to manage sub-locations.", "click_on": "Click on", + "clone_questionnaire": "Clone Questionnaire", "close": "Close", "close_scanner": "Close Scanner", "collapse_all": "Collapse All", "collapse_sidebar": "Collapse Sidebar", + "collect": "Collect", + "collect_body_site": "Collect Body Site", + "collect_method": "Collect Method", + "collect_performer": "Collect Performer", + "collect_time": "Collect Time", "combine_files_pdf": "Combine Files To PDF", "comment_added_successfully": "Comment added successfully", "comment_min_length": "Comment Should Contain At Least 1 Character", @@ -876,6 +887,7 @@ "edit_device_description": "Edit the details of the device", "edit_facility": "Edit Facility", "edit_facility_details": "Edit Facility Details", + "edit_form": "Edit Form", "edit_history": "Edit History", "edit_location": "Edit Location", "edit_location_description": "Edit the Location to make any changes", @@ -1180,6 +1192,7 @@ "footer_body": "Open Healthcare Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. Open Healthcare Network CARE is a Digital Public Good recognised by the United Nations.", "forget_password": "Forgot password?", "forget_password_instruction": "Enter your username, and if it exists, we will send you a link to reset your password.", + "preview_form": "Preview form", "forms": "Forms", "frequency": "Frequency", "from": "from", @@ -1507,7 +1520,9 @@ "more_details": "More details", "more_info": "More Info", "morning_slots": "Morning Slots", + "move_down": "Move Down", "move_to_onvif_preset": "Move to an ONVIF Preset", + "move_up": "Move Up", "moving_camera": "Moving Camera", "my_doctors": "My Doctors", "my_organizations": "My Organizations", @@ -1604,6 +1619,7 @@ "no_reason_provided": "No reason provided", "no_records_found": "No Records Found", "no_remarks": "No remarks", + "no_requested_questionnaires_found": "The requested questionnaire could not be found.", "no_resource_requests_found": "No requests found", "no_resources_found": "No resources found", "no_results": "No results", @@ -1870,6 +1886,7 @@ "preset_name_placeholder": "Specify an identifiable name for the new preset", "preset_updated": "Preset updated", "prev_sessions": "Prev Sessions", + "preview": "Preview", "previous": "Previous", "primary_ph_no": "Primary Ph No.", "primary_phone_no": "Primary ph. no.", @@ -1899,6 +1916,7 @@ "quantity_approved": "Quantity Approved", "quantity_requested": "Quantity Requested", "quantity_required": "Quantity Required", + "question": "Question", "questionnaire_error_loading": "Error loading questionnaire", "questionnaire_not_exist": "The questionnaire you tried to access does not exist.", "questionnaire_one": "Questionnaire", @@ -1963,6 +1981,7 @@ "remove_user_warn": "Are you sure you want to remove {{firstName}} {{lastName}} from this organization? This action cannot be undone.", "rename": "Rename", "rename_file": "Rename File", + "repeatable": "Repeatable", "replace_home_facility": "Replace Home Facility", "replace_home_facility_confirm": "Are you sure you want to replace", "replace_home_facility_confirm_as": "as home facility for user", @@ -2291,7 +2310,9 @@ "stream_stop_due_to_inativity": "The live feed will stop streaming due to inactivity", "stream_stopped_due_to_inativity": "The live feed has stopped streaming due to inactivity", "stream_uuid": "Stream UUID", + "structured_type": "Structured Type", "sub_category": "Sub Category", + "sub_questions": "sub-questions", "subject": "Subject", "subject_type": "Subject Type", "submit": "Submit", diff --git a/src/components/Questionnaire/QuestionnaireEditor.tsx b/src/components/Questionnaire/QuestionnaireEditor.tsx index 0de9bd9316d..15fd7b561ca 100644 --- a/src/components/Questionnaire/QuestionnaireEditor.tsx +++ b/src/components/Questionnaire/QuestionnaireEditor.tsx @@ -518,7 +518,7 @@ function QuestionnaireProperties({ trigger={ } /> @@ -749,7 +749,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) { Not Found - The requested questionnaire could not be found. + {t("no_requested_questionnaires_found")} ); @@ -812,18 +812,17 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {

{id ? t("edit") + " " + questionnaire.title - : "Create Questionnaire"} + : t("create_questionnaire")}

{questionnaire.description}

@@ -835,14 +834,13 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) { - Edit form + {t("edit_form")} - Preview form + {t("form_preview")} -
@@ -948,11 +946,11 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
- Basic Information + {t("basic_info")}
- +
- +
- +