Skip to content

Commit

Permalink
Merge branch 'develop' into issues/10725/Remove-Unnecessary-Arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinpraveengo authored Mar 2, 2025
2 parents 95c2901 + 957f5e5 commit df59624
Show file tree
Hide file tree
Showing 87 changed files with 2,136 additions and 1,546 deletions.
3 changes: 3 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"

# ISO 3166-1 Alpha-2 code for the default country code (default: "IN")
REACT_DEFAULT_COUNTRY=

# Maps fallback URL template (default:"https://www.openstreetmap.org/?mlat={lat}&mlon={long}&zoom=15")
REACT_MAPS_FALLBACK_URL_TEMPLATE=
48 changes: 0 additions & 48 deletions .github/workflows/issue-automation.yml

This file was deleted.

4 changes: 4 additions & 0 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const careConfig = {
defaultEncounterType: (env.REACT_DEFAULT_ENCOUNTER_TYPE ||
"hh") as EncounterClass,

mapFallbackUrlTemplate:
env.REACT_MAPS_FALLBACK_URL_TEMPLATE ||
"https://www.openstreetmap.org/?mlat={lat}&mlon={long}&zoom=15",

gmapsApiKey:
env.REACT_GMAPS_API_KEY || "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk",

Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/patient_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ describe("Patient Management", () => {
];

beforeEach(() => {
cy.viewport(1920, 1080);
cy.loginByApi("doctor");
cy.visit("/");
});
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/patient_details.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const patientDetails = new PatientDetails();

describe("Patient Management", () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.loginByApi("devdoctor");
cy.visit("/");
});
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/patient_encounter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const patientEncounter = new PatientEncounter();

describe("Patient Encounter Questionnaire", () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.loginByApi("devnurse");
cy.visit("/");
});
Expand Down
22 changes: 22 additions & 0 deletions cypress/e2e/users_spec/user_avatar.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { UserAvatar } from "@/pageObject/Users/UserAvatar";

describe("User Profile Avatar Modification", () => {
const userAvatar = new UserAvatar("teststaff4");
beforeEach(() => {
cy.loginByApi("teststaff4");
cy.visit("/");
});
it("should modify an avatar", () => {
userAvatar
.navigateToProfile()
.interceptUploadAvatarRequest()
.clickChangeAvatarButton()
.uploadAvatar()
.clickSaveAvatarButton()
.verifyUploadAvatarApiCall()
.interceptDeleteAvatarRequest()
.clickChangeAvatarButton()
.clickDeleteAvatarButton()
.verifyDeleteAvatarApiCall();
});
});
Binary file added cypress/fixtures/avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions cypress/fixtures/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
"devdoctor": {
"username": "developdoctor",
"password": "Test@123"
},
"teststaff4": {
"username": "teststaff4",
"password": "Test@123"
}
}
59 changes: 59 additions & 0 deletions cypress/pageObject/Users/UserAvatar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export class UserAvatar {
username: string;
constructor(username: string) {
this.username = username;
}

navigateToProfile() {
cy.visit(`/users/${this.username}`);
return this;
}

interceptUploadAvatarRequest() {
cy.intercept("POST", `/api/v1/users/${this.username}/profile_picture/`).as(
"uploadAvatar",
);
return this;
}

clickChangeAvatarButton() {
cy.verifyAndClickElement('[data-cy="change-avatar"]', "Change Avatar");
return this;
}

uploadAvatar() {
cy.get('input[title="changeFile"]').selectFile(
"cypress/fixtures/avatar.jpg",
{ force: true },
);
return this;
}

clickSaveAvatarButton() {
cy.verifyAndClickElement('[data-cy="save-cover-image"]', "Save");
return this;
}

verifyUploadAvatarApiCall() {
cy.wait("@uploadAvatar").its("response.statusCode").should("eq", 200);
return this;
}

interceptDeleteAvatarRequest() {
cy.intercept(
"DELETE",
`/api/v1/users/${this.username}/profile_picture/`,
).as("deleteAvatar");
return this;
}

clickDeleteAvatarButton() {
cy.verifyAndClickElement('[data-cy="delete-avatar"]', "Delete");
return this;
}

verifyDeleteAvatarApiCall() {
cy.wait("@deleteAvatar").its("response.statusCode").should("eq", 204);
return this;
}
}
25 changes: 24 additions & 1 deletion public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@
"active": "Active",
"active_encounters": "Active Encounters",
"active_files": "Active Files",
"active_location_cannot_be_in_future": "Active location cannot be in the future",
"active_prescriptions": "Active Prescriptions",
"add": "Add",
"add_another_session": "Add another session",
Expand All @@ -305,6 +306,7 @@
"add_location_description": "Create a Location such as Rooms/Beds",
"add_new_beds": "Add New Bed(s)",
"add_new_facility": "Add New Facility",
"add_new_location": "Add New Location",
"add_new_patient": "Add New Patient",
"add_new_user": "Add New User",
"add_notes": "Add notes",
Expand Down Expand Up @@ -700,6 +702,7 @@
"create_department_team_description": "Create a new department/team in this facility.",
"create_encounter": "Create Encounter",
"create_facility": "Create Facility",
"create_location_association": "Create Location Association",
"create_new": "Create New",
"create_new_asset": "Create New Asset",
"create_new_encounter": "Create a new encounter to get started",
Expand Down Expand Up @@ -741,6 +744,7 @@
"dashboard": "Dashboard",
"date": "Date",
"date_and_time": "Date and Time",
"date_and_time_of_death": "Date and Time of Death",
"date_declared_positive": "Date of declaring positive",
"date_of_admission": "Date of Admission",
"date_of_birth": "Date of Birth",
Expand All @@ -755,7 +759,8 @@
"date_range": "Date Range",
"dates_and_identifiers": "Dates & Identifiers",
"day": "Day",
"death_report": "Death Report",
"deceased_disclaimer": "Please provide the date and time of death for record-keeping purposes. This information is handled with utmost sensitivity and respect.",
"deceased_status": "Deceased Status",
"delete": "Delete",
"delete_account": "Delete account",
"delete_account_btn": "Yes, delete this account",
Expand Down Expand Up @@ -962,6 +967,7 @@
"encounter_manage_organization_description": "Add or remove organizations from this encouter",
"encounter_marked_as_complete": "Encounter Completed",
"encounter_notes__all_discussions": "All Discussions",
"encounter_notes__all_discussions_description": "View and manage encounternotes discussion threads",
"encounter_notes__be_first_to_send": "Be the first to send a message",
"encounter_notes__choose_template": "Choose a template or enter a custom title",
"encounter_notes__create_discussion": "Create a new discussion thread to organize your conversation topics.",
Expand Down Expand Up @@ -1021,6 +1027,7 @@
"end_time": "End Time",
"end_time_before_start_error": "End time cannot be before start time",
"end_time_future_error": "End time cannot be in the future",
"end_time_required": "End time is required",
"ended": "Ended",
"enter_contact_value": "Enter contact value",
"enter_department_team_description": "Enter department/team description (optional)",
Expand Down Expand Up @@ -1305,6 +1312,7 @@
"is_it_upshift": "is it upshift",
"is_phone_a_whatsapp_number": "Is the phone number a WhatsApp number?",
"is_pregnant": "Is pregnant",
"is_the_patient_deceased": "Is the patient deceased",
"is_this_administration_for_a_past_time": "Is this administration for a past time",
"is_this_an_emergency": "Is this an Emergency?",
"is_this_an_emergency_request": "Is this an emergency request?",
Expand Down Expand Up @@ -1367,6 +1375,8 @@
"local_ip_address_example": "e.g. 192.168.0.123",
"location": "Location",
"location_associated_successfully": "Location associated successfully",
"location_association_created_successfully": "Location association created successfully",
"location_association_updated_successfully": "Location association updated successfully",
"location_beds_empty": "No beds available in this location",
"location_created": "Location Created",
"location_description": "Location Description",
Expand Down Expand Up @@ -1419,6 +1429,7 @@
"manage_my_schedule": "Manage my schedule",
"manage_organizations": "Manage Organizations",
"manage_organizations_description": "Add or remove organizations from this questionnaire",
"manage_patient_location_and_transfers": "Manage patient location and transfers",
"manage_prescriptions": "Manage Prescriptions",
"manage_preset": "Manage preset {{ name }}",
"manage_tags": "Manage Tags",
Expand Down Expand Up @@ -1525,6 +1536,7 @@
"next_sessions": "Next Sessions",
"next_week_short": "Next wk",
"no": "No",
"no_active_medication_recorded": "No Active Medication Recorded",
"no_address_provided": "No address provided",
"no_allergies_recorded": "No allergies recorded",
"no_appointments": "No appointments found",
Expand Down Expand Up @@ -1566,6 +1578,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_medication_recorded": "No Medication Recorded",
"no_medications": "No Medications",
"no_medications_found_for_this_encounter": "No medications found for this encounter.",
"no_medications_to_administer": "No medications to administer",
Expand Down Expand Up @@ -1657,6 +1670,7 @@
"ongoing_medications": "Ongoing Medications",
"online": "Online",
"only_indian_mobile_numbers_supported": "Currently only Indian numbers are supported",
"only_mark_if_applicable": "Only mark if applicable",
"onset": "Onset",
"op_encounter": "OP Encounter",
"op_file_closed": "OP file closed",
Expand Down Expand Up @@ -1735,6 +1749,7 @@
"patient_face": "Patient Face",
"patient_files": "Patient Files",
"patient_information": "Patient Information",
"patient_is_deceased": "Patient is deceased",
"patient_name": "Patient Name",
"patient_name_uhid": "Patient Name/UHID",
"patient_no": "OP/IP No",
Expand Down Expand Up @@ -1786,6 +1801,8 @@
"pincode_district_auto_fill_error": "Failed to auto-fill district information",
"pincode_must_be_6_digits": "Pincode must be a 6-digit number",
"pincode_state_auto_fill_error": "Failed to auto-fill state and district information",
"planned": "Planned",
"planned_reserved_cannot_be_in_past": "Planned/Reserved cannot be in the past",
"play": "Play",
"play_audio": "Play Audio",
"please_assign_bed_to_patient": "Please assign a bed to this patient",
Expand Down Expand Up @@ -1982,6 +1999,7 @@
"rescheduled": "Rescheduled",
"rescheduling": "Rescheduling...",
"resend_otp": "Resend OTP",
"reserved": "Reserved",
"reset": "Reset",
"reset_password": "Reset Password",
"reset_password_note_self": "Enter your current password, then create and confirm your new password",
Expand Down Expand Up @@ -2111,6 +2129,7 @@
"see_details": "See Details",
"see_note": "See Note",
"select": "Select",
"select_a_status": "Select a status",
"select_a_value_set": "Select a Value Set",
"select_additional_instructions": "Select additional instructions",
"select_admit_source": "Select Admit Source",
Expand Down Expand Up @@ -2217,10 +2236,13 @@
"show_all_notifications": "Show All",
"show_all_slots": "Show all slots",
"show_default_presets": "Show Default Presets",
"show_on_map": "Show on Map",
"show_patient_presets": "Show Patient Presets",
"show_unread_notifications": "Show Unread",
"showing_all_appointments": "Showing all appointments",
"showing_x_of_y": "Showing <strong>{{x}}</strong> of <strong>{{y}}</strong>",
"sidebar": "sidebar",
"sidebar_description": "sidebar provides navigation to different sections",
"sign_in": "Sign in",
"sign_out": "Sign out",
"site": "Site",
Expand Down Expand Up @@ -2258,6 +2280,7 @@
"start_time_before_authored_error": "Start time cannot be before the medication was prescribed",
"start_time_future_error": "Start time cannot be in the future",
"start_time_must_be_before_end_time": "Start time must be before end time",
"start_time_required": "Start time is required",
"start_typing_to_search": "Start typing to search...",
"state": "State",
"state_reason_for_archiving": "State reason for archiving <strong>{{name}}</strong> file?",
Expand Down
1 change: 0 additions & 1 deletion public/locale/ml.json
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,6 @@
"date_of_return": "മടങ്ങിവരുന്ന തീയതി",
"date_of_test": "ടെസ്റ്റ് തീയതി",
"day": "ദിവസം",
"death_report": "മരണ റിപ്പോർട്ട്",
"delete": "ഇല്ലാതാക്കുക",
"delete_account": "അക്കൗണ്ട് ഇല്ലാതാക്കുക",
"delete_account_btn": "അതെ, ഈ അക്കൗണ്ട് ഇല്ലാതാക്കുക",
Expand Down
12 changes: 11 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,23 @@ import AuthUserProvider from "@/Providers/AuthUserProvider";
import HistoryAPIProvider from "@/Providers/HistoryAPIProvider";
import Routers from "@/Routers";
import { handleHttpError } from "@/Utils/request/errorHandler";
import { HTTPError } from "@/Utils/request/types";

import { PubSubProvider } from "./Utils/pubsubContext";

const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: 2,
retry: (failureCount, error) => {
// Only retry network errors or server errors (502, 503, 504) up to 3 times
if (
error.message === "Network Error" ||
(error instanceof HTTPError && [502, 503, 504].includes(error.status))
) {
return failureCount < 3;
}
return false;
},
refetchOnWindowFocus: false,
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/CAREUI/interactive/Zoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const ZoomControls = (props: { disabled?: boolean }) => {
}

return (
<div className="absolute bottom-8 right-8 flex flex-col items-center justify-center gap-1 rounded-full border border-secondary-400 bg-white p-0.5 shadow-lg md:flex-row-reverse md:gap-2">
<div className="fixed bottom-8 right-8 flex flex-col items-center justify-center gap-1 rounded-full border border-secondary-400 bg-white p-0.5 shadow-lg md:flex-row-reverse md:gap-2">
<Button
disabled={props.disabled}
variant="ghost"
Expand Down
Loading

0 comments on commit df59624

Please sign in to comment.