Skip to content

Commit

Permalink
Merge branch 'develop' into user-list-ohcnetwork#9862
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishith25 committed Jan 9, 2025
2 parents c3e57b7 + f0589e6 commit 96acf9c
Show file tree
Hide file tree
Showing 13 changed files with 277 additions and 236 deletions.
36 changes: 32 additions & 4 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"CONSCIOUSNESS_LEVEL__RESPONDS_TO_PAIN": "Responds to Pain",
"CONSCIOUSNESS_LEVEL__RESPONDS_TO_VOICE": "Responds to Voice",
"CONSCIOUSNESS_LEVEL__UNRESPONSIVE": "Unresponsive",
"Cancel": "Cancel",
"DAYS_OF_WEEK_SHORT__0": "Mon",
"DAYS_OF_WEEK_SHORT__1": "Tue",
"DAYS_OF_WEEK_SHORT__2": "Wed",
Expand Down Expand Up @@ -355,6 +354,7 @@
"age_input_warning_bold": "Recommended only when the patient's date of birth is unknown",
"age_less_than_0": "Age cannot be less than 0",
"age_notice": "Only year of birth will be stored for age.",
"ago": "ago",
"all": "All",
"all_changes_have_been_saved": "All changes have been saved",
"all_details": "All Details",
Expand All @@ -364,6 +364,7 @@
"allow_transfer": "Allow Transfer",
"allowed_formats_are": "Allowed formats are",
"already_a_member": "Already a member?",
"alternate_phone_number": "Alternate Phone Number",
"ambulance_driver_name": "Name of ambulance driver",
"ambulance_number": "Ambulance No",
"ambulance_phone_number": "Phone number of Ambulance",
Expand Down Expand Up @@ -504,6 +505,7 @@
"check_policy_eligibility": "Check Policy Eligibility",
"check_status": "Check Status",
"checked_in": "Checked-In",
"checking_availability": "Checking Availability",
"checking_consent_status": "Consent request status is being checked!",
"checking_eligibility": "Checking Eligibility",
"checking_for_update": "Checking for update",
Expand Down Expand Up @@ -648,6 +650,7 @@
"create_position_preset_description": "Creates a new position preset in Care from the current position of the camera for the given name",
"create_preset_prerequisite": "To create presets for this bed, you'll need to link the camera to the bed first.",
"create_resource_request": "Create Request",
"create_user": "Create User",
"created": "Created",
"created_by": "Created By",
"created_date": "Created Date",
Expand All @@ -656,6 +659,7 @@
"csv_file_in_the_specified_format": "Select a CSV file in the specified format",
"current_address": "Current Address",
"current_password": "Current Password",
"current_role": "Current Role",
"current_status": "Current Status",
"customer_support_email": "Customer Support Email",
"customer_support_name": "Customer Support Name",
Expand All @@ -676,7 +680,6 @@
"date_of_return": "Date of Return",
"date_of_test": "Date of sample collection for Covid testing",
"day": "Day",
"days": "Days",
"death_report": "Death Report",
"delete": "Delete",
"delete_account": "Delete account",
Expand Down Expand Up @@ -729,6 +732,7 @@
"dob": "DOB",
"dob_format": "Please enter date in DD/MM/YYYY format",
"doc_will_visit_patient": "will visit the patient at the scheduled time.",
"doctor": "Doctor",
"doctor_experience_error": "Please enter a valid number between 0 and 100.",
"doctor_experience_required": "Years of experience is required",
"doctor_not_found": "Doctor not found",
Expand Down Expand Up @@ -764,7 +768,9 @@
"edit_policy_description": "Add or edit patient's insurance details",
"edit_prescriptions": "Edit Prescriptions",
"edit_profile": "Edit Profile",
"edit_role": "Edit Role",
"edit_user_profile": "Edit Profile",
"edit_user_role": "Edit User Role",
"edited_by": "Edited by",
"edited_on": "Edited on",
"education": "Education",
Expand All @@ -773,7 +779,7 @@
"eg_mail_example_com": "Eg. mail@example.com",
"eg_xyz": "Eg. XYZ",
"eligible": "Eligible",
"email": "Email Address",
"email": "Email",
"email_address": "Email Address",
"email_discharge_summary_description": "Enter your valid email address to receive the discharge summary",
"email_success": "We will be sending an email shortly. Please check your inbox.",
Expand Down Expand Up @@ -1030,7 +1036,6 @@
"home_facility_cleared_success": "Home Facility cleared successfully",
"home_facility_updated_error": "Error while updating Home Facility",
"home_facility_updated_success": "Home Facility updated successfully",
"hours": "hours",
"hubs": "Hub Facilities",
"i_declare": "I hereby declare that:",
"icd11_as_recommended": "As per ICD-11 recommended by WHO",
Expand Down Expand Up @@ -1114,6 +1119,7 @@
"last_administered": "Last administered",
"last_discharge_reason": "Last Discharge Reason",
"last_edited": "Last Edited",
"last_login": "Last Login",
"last_modified": "Last Modified",
"last_modified_by": "Last Modified By",
"last_name": "Last Name",
Expand Down Expand Up @@ -1227,6 +1233,7 @@
"nationality": "Nationality",
"nearby_facilities": "Nearby Facilities",
"never": "never",
"never_logged_in": "Never Logged In",
"new_password": "New Password",
"new_password_confirmation": "Confirm New Password",
"new_password_same_as_old": "New password is same as old password, please enter a different new password.",
Expand Down Expand Up @@ -1262,6 +1269,8 @@
"no_notices_for_you": "No notices for you.",
"no_observations": "No Observations",
"no_ongoing_medications": "No Ongoing Medications",
"no_patient_record_found": "No Patient Records Found",
"no_patient_record_text": "No existing records found with this phone number. Would you like to register a new patient?",
"no_patients": "No patients found",
"no_patients_found": "No Patients Found",
"no_patients_found_phone_number": "No patients found with this phone number. Please create a new patient to proceed with booking appointment.",
Expand Down Expand Up @@ -1306,6 +1315,7 @@
"number_of_beds_out_of_range_error": "Number of beds cannot be greater than 100",
"number_of_chronic_diseased_dependents": "Number Of Chronic Diseased Dependents",
"number_of_covid_vaccine_doses": "Number of Covid vaccine doses",
"nurse": "Nurse",
"nursing_care": "Nursing Care",
"nursing_information": "Nursing Information",
"nutrition": "Nutrition",
Expand Down Expand Up @@ -1360,6 +1370,7 @@
"patient__social-profile": "Social Profile",
"patient__volunteer-contact": "Volunteer Contact",
"patient_address": "Patient Address",
"patient_birth_year_for_identity": "Please enter the patient's year of birth to verify their identity",
"patient_body": "Patient Body",
"patient_category": "Patient Category",
"patient_consultation__admission": "Date of admission",
Expand Down Expand Up @@ -1539,6 +1550,8 @@
"reload": "Reload",
"remove": "Remove",
"remove_user": "Remove User",
"remove_user_organization": "Remove User from Organization",
"remove_user_warn": "Are you sure you want to remove {{firstName}} {{lastName}} from this organization? This action cannot be undone.",
"rename": "Rename",
"replace_home_facility": "Replace Home Facility",
"replace_home_facility_confirm": "Are you sure you want to replace",
Expand Down Expand Up @@ -1625,6 +1638,7 @@
"search_icd11_placeholder": "Search for ICD-11 Diagnoses",
"search_investigation_placeholder": "Search Investigation & Groups",
"search_medication": "Search Medication",
"search_patient_page_text": "Search for existing patients using their phone number or create a new patient record",
"search_patients": "Search Patients",
"search_resource": "Search Resource",
"search_user": "Search User",
Expand All @@ -1635,14 +1649,17 @@
"select_all": "Select All",
"select_date": "Select date",
"select_department": "Select Department",
"select_diff_role": "Please select a different role",
"select_eligible_policy": "Select an Eligible Insurance Policy",
"select_facility": "Select Facility",
"select_facility_for_discharged_patients_warning": "Facility needs to be selected to view discharged patients.",
"select_for_administration": "Select for Administration",
"select_groups": "Select Groups",
"select_investigation": "Select Investigations (all investigations will be selected by default)",
"select_investigation_groups": "Select Investigation Groups",
"select_investigations": "Select Investigations",
"select_local_body": "Select Local Body",
"select_new_role": "Select New Role",
"select_patient": "Select Patient",
"select_policy": "Select an Insurance Policy",
"select_policy_to_add_items": "Select a Policy to Add Items",
Expand Down Expand Up @@ -1708,6 +1725,7 @@
"source": "Source",
"spokes": "Spoke Facilities",
"srf_id": "SRF ID",
"staff": "Staff",
"staff_list": "Staff List",
"start_consultation": "Start Consultation",
"start_datetime": "Start Date/Time",
Expand Down Expand Up @@ -1828,9 +1846,11 @@
"update_preset_position_to_current": "Update preset's position to camera's current position",
"update_record": "Update Record",
"update_record_for_asset": "Update record for asset",
"update_role": "Update Role",
"update_shift_request": "Update Shift Request",
"update_status": "Update Status",
"update_status_details": "Update Status/Details",
"update_user_role_organization": "Update the role for this user in the organization",
"update_volunteer": "Reassign Volunteer",
"updated": "Updated",
"updated_on": "Updated On",
Expand Down Expand Up @@ -1860,6 +1880,8 @@
"user_not_available_for_appointments": "This user is not available for appointments",
"user_qualifications": "Qualifications",
"user_qualifications_note": "Enter appropriate qualifications for this user",
"user_removed_success": "User removed from organization successfully",
"user_role_update_success": "User role updated successfully",
"user_type": "User Type",
"username": "Username",
"username_already_exists": "This username already exists",
Expand All @@ -1871,6 +1893,7 @@
"vaccinated": "Vaccinated",
"vaccine_name": "Vaccine name",
"valid_otp_found": "Valid OTP found, Navigating to Appointments",
"valid_year_of_birth": "Please enter a valid year of birth (YYYY)",
"vehicle_preference": "Vehicle preference",
"vendor_name": "Vendor Name",
"ventilator_interface": "Respiratory Support Type",
Expand All @@ -1880,13 +1903,15 @@
"ventilator_oxygen_modality": "Oxygen Modality",
"ventilator_oxygen_modality_oxygen_rate": "Oxygen Flow Rate",
"ventilator_spo2": "SpO₂",
"verify": "Verify",
"verify_and_link": "Verify and Link",
"verify_otp": "Verify OTP",
"verify_otp_error": "Failed to verify OTP. Please try again later.",
"verify_otp_success": "OTP has been verified successfully.",
"verify_otp_success_login": "OTP has been verified successfully. Logging in.",
"verify_patient": "Verify Patient",
"verify_patient_identifier": "Please verify the patient identifier",
"verify_patient_identity": "Verify Patient Identity",
"verify_using": "Verify Using",
"video_call": "Video Call",
"video_conference_link": "Video Conference Link",
Expand All @@ -1897,6 +1922,7 @@
"view_cns": "View CNS",
"view_consultation": "View Latest Encounter",
"view_consultation_and_log_updates": "View Consultation / Log Updates",
"view_dashboard": "View Dashboard",
"view_details": "View Details",
"view_facility": "View Facility",
"view_files": "View Files",
Expand All @@ -1913,6 +1939,7 @@
"vitals_monitor": "Vitals Monitor",
"vitals_present": "Vitals Monitor present",
"voice_autofill": "Voice Autofill",
"volunteer": "Volunteer",
"volunteer_assigned": "Volunteer assigned successfully",
"volunteer_contact": "Volunteer Contact",
"volunteer_contact_detail": "Provide the name and contact details of a volunteer who can assist the patient in emergencies. This should be someone outside the family.",
Expand All @@ -1925,6 +1952,7 @@
"weekly_working_hours_error": "Average weekly working hours must be a number between 0 and 168",
"what_facility_assign_the_patient_to": "What facility would you like to assign the patient to",
"whatsapp_number": "Whatsapp Number",
"whatsapp_number_same_as_phone_number": "WhatsApp number is same as phone number",
"why_the_asset_is_not_working": "Why the asset is not working?",
"width": "Width ({{unit}})",
"with": "with",
Expand Down
28 changes: 7 additions & 21 deletions src/components/Common/FilePreviewDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
useState,
} from "react";
import { useTranslation } from "react-i18next";
import useKeyboardShortcut from "use-keyboard-shortcut";

import CareIcon, { IconName } from "@/CAREUI/icons/CareIcon";

Expand Down Expand Up @@ -152,20 +153,11 @@ const FilePreviewDialog = (props: FilePreviewProps) => {
: `rotate-${normalizedRotation}`;
}

useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (!show) return;
if (e.key === "ArrowLeft" && index > 0) {
handleNext(index - 1);
}
if (e.key === "ArrowRight" && index < (uploadedFiles?.length || 0) - 1) {
handleNext(index + 1);
}
};

window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown);
}, [show, index, uploadedFiles]);
useKeyboardShortcut(["ArrowLeft"], () => index > 0 && handleNext(index - 1));
useKeyboardShortcut(
["ArrowRight"],
() => index < (uploadedFiles?.length || 0) - 1 && handleNext(index + 1),
);

return (
<DialogModal
Expand Down Expand Up @@ -199,7 +191,7 @@ const FilePreviewDialog = (props: FilePreviewProps) => {
uploadedFiles[index] &&
uploadedFiles[index].created_date && (
<p className="mt-1 text-sm text-gray-600">
Created on{" "}
{t("created_on")}{" "}
{new Date(
uploadedFiles[index].created_date!,
).toLocaleString("en-US", {
Expand Down Expand Up @@ -235,9 +227,6 @@ const FilePreviewDialog = (props: FilePreviewProps) => {
onClick={() => handleNext(index - 1)}
disabled={index <= 0}
aria-label="Previous file"
onKeyDown={(e) =>
e.key === "ArrowLeft" && handleNext(index - 1)
}
>
<CareIcon icon="l-arrow-left" className="h-4 w-4" />
</Button>
Expand Down Expand Up @@ -288,9 +277,6 @@ const FilePreviewDialog = (props: FilePreviewProps) => {
onClick={() => handleNext(index + 1)}
disabled={index >= uploadedFiles.length - 1}
aria-label="Next file"
onKeyDown={(e) =>
e.key === "ArrowRight" && handleNext(index + 1)
}
>
<CareIcon icon="l-arrow-right" className="h-4 w-4" />
</Button>
Expand Down
Loading

0 comments on commit 96acf9c

Please sign in to comment.