Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
Browse files Browse the repository at this point in the history
…encounter-info-card
  • Loading branch information
amjithtitus09 committed Feb 26, 2025
2 parents cffe719 + c097957 commit fee6116
Show file tree
Hide file tree
Showing 19 changed files with 1,243 additions and 437 deletions.
18 changes: 17 additions & 1 deletion public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,17 @@
"clear_search": "Clear search",
"clear_selection": "Clear selection",
"clear_skill": "Clear Skill",
"click": "Click",
"click_add_department_team": "Click <strong>Add Department/Team</strong> to create a new department/team.",
"click_add_main_location": "Click <strong>Add Location</strong> to add a main location.",
"click_manage_create_users": "Click <strong>See Details</strong><CareIcon /> to create or manage users and departments/teams within the corresponding dept/team.",
"click_manage_create_users_mobile": "Click <CareIcon /> to create or manage users and departments/teams within the corresponding dept/team.",
"click_manage_sub_locations": "Click <strong>See Details</strong><ArrowIcon/> to manage sub-locations.",
"click_manage_sub_locations_mobile": "Click <PenLine/>to edit and <ArrowIcon/> to manage sub-locations.",
"click_on": "Click on",
"close": "Close",
"close_scanner": "Close Scanner",
"collapse_all": "Collapse All",
"collapse_sidebar": "Collapse Sidebar",
"combine_files_pdf": "Combine Files To PDF",
"comment_added_successfully": "Comment added successfully",
Expand Down Expand Up @@ -1057,6 +1066,7 @@
"exception_created": "Exception created successfully",
"exception_deleted": "Exception deleted",
"exceptions": "Exceptions",
"expand_all": "Expand All",
"expand_sidebar": "Expand Sidebar",
"expected_burn_rate": "Expected Burn Rate",
"expiration_date": "Expiration Date",
Expand Down Expand Up @@ -1143,6 +1153,8 @@
"filter_by": "Filter By",
"filter_by_category": "Filter by category",
"filter_by_date": "Filter by Date",
"filter_by_department_or_team_name": "Filter by department or team name",
"filter_by_locations": "Filter by Locations",
"filters": "Filters",
"first_name": "First Name",
"food": "Food",
Expand Down Expand Up @@ -1204,6 +1216,7 @@
"hospital_identifier": "Hospital Identifier",
"hospitalisation_details": "Hospitalization Details",
"hospitalization_details": "Hospitalization Details",
"hover_focus_reveal": "Hover or focus to reveal",
"hubs": "Hub Facilities",
"i_declare": "I hereby declare that:",
"icd11_as_recommended": "As per ICD-11 recommended by WHO",
Expand Down Expand Up @@ -1402,6 +1415,7 @@
"manufacture_date_cannot_be_in_future": "Manufacture date cannot be in future",
"manufactured": "Manufactured",
"manufacturer": "Manufacturer",
"map": "Map",
"map_acronym": "M.A.P.",
"mark_active": "Mark Active",
"mark_all_as_read": "Mark all as Read",
Expand Down Expand Up @@ -1496,7 +1510,6 @@
"next_sessions": "Next Sessions",
"next_week_short": "Next wk",
"no": "No",
"no_active_medications": "No active medications",
"no_address_provided": "No address provided",
"no_allergies_recorded": "No allergies recorded",
"no_appointments": "No appointments found",
Expand Down Expand Up @@ -1538,6 +1551,7 @@
"no_log_update_delta": "No changes since previous log update",
"no_log_updates": "No log updates found",
"no_medical_history_available": "No Medical History Available",
"no_medications": "No Medications",
"no_medications_found_for_this_encounter": "No medications found for this encounter.",
"no_medications_to_administer": "No medications to administer",
"no_notices_for_you": "No notices for you.",
Expand Down Expand Up @@ -2007,6 +2021,7 @@
"save": "Save",
"save_and_continue": "Save and Continue",
"save_investigation": "Save Investigation",
"save_valueset": "Save ValueSet",
"saving": "Saving...",
"scan_asset_qr": "Scan Asset QR!",
"schedule": "Schedule",
Expand Down Expand Up @@ -2284,6 +2299,7 @@
"titrate_dosage": "Titrate Dosage",
"to": "to",
"to_be_conducted": "To be conducted",
"to_edit": "to edit",
"to_proceed_with_registration": "To proceed with registration, please create a new patient.",
"to_view_available_slots_select_resource_and_date": "To view available slots, select a preferred resource and date.",
"today": "Today",
Expand Down
6 changes: 6 additions & 0 deletions src/CAREUI/misc/PrintPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Button } from "@/components/ui/button";

import Page from "@/components/Common/Page";

import useAppHistory from "@/hooks/useAppHistory";
import useBreakpoints from "@/hooks/useBreakpoints";

type Props = {
Expand All @@ -26,11 +27,16 @@ type Props = {
export default function PrintPreview(props: Props) {
const normalScale = useBreakpoints({ default: 1 });
const { t } = useTranslation();
const { goBack } = useAppHistory();

return (
<Page title={props.title}>
<div className="mx-auto my-8 xl:w-[50rem] border rounded-xl border-gray-200 shadow-2xl overflow-hidden">
<div className="top-0 z-20 flex gap-2 bg-secondary-100 px-2 py-4 xl:absolute xl:right-6 xl:top-8 xl:justify-end">
<Button variant="outline" onClick={() => goBack()}>
<CareIcon icon="l-arrow-left" className="text-lg" />
{t("back")}
</Button>
<Button variant="primary" disabled={props.disabled} onClick={print}>
<CareIcon icon="l-print" className="text-lg" />
{t("print")}
Expand Down
12 changes: 9 additions & 3 deletions src/components/Common/AvatarEditModal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import DOMPurify from "dompurify";
import React, {
ChangeEventHandler,
useCallback,
Expand Down Expand Up @@ -135,11 +136,12 @@ const AvatarEditModal = ({
setSelectedFile(undefined);
return;
}
if (!isImageFile(e.target.files[0])) {
const file = e.target.files[0];
if (!isImageFile(file)) {
toast.warning(t("please_upload_an_image_file"));
return;
}
setSelectedFile(e.target.files[0]);
setSelectedFile(file);
};

const uploadAvatar = async () => {
Expand Down Expand Up @@ -231,7 +233,11 @@ const AvatarEditModal = ({
<>
<div className="flex flex-1 items-center justify-center rounded-lg">
<img
src={preview || imageUrl}
src={
preview && preview.startsWith("blob:")
? DOMPurify.sanitize(preview)
: imageUrl
}
alt="cover-photo"
className="h-full w-full object-cover"
/>
Expand Down
Loading

0 comments on commit fee6116

Please sign in to comment.