Skip to content

Commit

Permalink
Merge branch 'develop' into show_validations_upfront
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 committed Jan 22, 2025
2 parents 80b89ec + 9f2d856 commit 1bc5855
Show file tree
Hide file tree
Showing 36 changed files with 1,740 additions and 1,348 deletions.
7 changes: 3 additions & 4 deletions cypress/e2e/users_spec/user_creation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { UserCreation } from "../../pageObject/Users/UserCreation";
import { FacilityCreation } from "../../pageObject/facility/FacilityCreation";
import { UserCreation } from "pageObject/Users/UserCreation";
import { FacilityCreation } from "pageObject/facility/FacilityCreation";
import {
generateName,
generatePhoneNumber,
generateUsername,
} from "../../utils/commonUtils";
} from "utils/commonUtils";

describe("User Creation", () => {
const facilityCreation = new FacilityCreation();
Expand All @@ -30,7 +30,6 @@ describe("User Creation", () => {
confirmPassword: defaultPassword,
email: `${generateUsername(firstName)}@test.com`,
phoneNumber: generatePhoneNumber(),
dateOfBirth: "1990-01-01",
userType: "Doctor",
state: "Kerala",
district: "Ernakulam",
Expand Down
8 changes: 0 additions & 8 deletions cypress/pageObject/Users/UserCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface UserData {
password?: string;
email?: string;
phoneNumber?: string;
dateOfBirth?: string;
userType?: string;
state?: string;
district?: string;
Expand Down Expand Up @@ -78,17 +77,11 @@ export class UserCreation {
label: "Alternate Phone Number",
message: "Phone number must start with +91 followed by 10 digits",
},
{ label: "Date of Birth", message: "Required" },
{ label: "State", message: "Required" },
]);
return this;
}

fillDateOfBirth(dateOfBirth: string) {
cy.typeIntoField('[data-cy="dob-input"]', dateOfBirth);
return this;
}

selectUserType(userType: string) {
cy.clickAndSelectOption('[data-cy="user-type-select"]', userType);
return this;
Expand Down Expand Up @@ -125,7 +118,6 @@ export class UserCreation {
}
if (userData.email) this.fillEmail(userData.email);
if (userData.phoneNumber) this.fillPhoneNumber(userData.phoneNumber);
if (userData.dateOfBirth) this.fillDateOfBirth(userData.dateOfBirth);
if (userData.state) this.selectState(userData.state);
if (userData.district) this.selectDistrict(userData.district);
if (userData.localBody) this.selectLocalBody(userData.localBody);
Expand Down
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@radix-ui/react-tooltip": "^1.1.6",
"@sentry/browser": "^8.50.0",
"@tanstack/react-query": "^5.64.1",
"@tanstack/react-query-devtools": "^5.64.0",
"@tanstack/react-query-devtools": "^5.64.2",
"@vitejs/plugin-react": "^4.3.4",
"@yudiel/react-qr-scanner": "^2.1.0",
"bowser": "^2.11.0",
Expand All @@ -102,7 +102,7 @@
"i18next-http-backend": "^3.0.1",
"input-otp": "^1.4.2",
"lodash-es": "^4.17.21",
"lucide-react": "^0.471.1",
"lucide-react": "^0.473.0",
"markdown-it": "^14.1.0",
"next-themes": "^0.4.3",
"postcss-loader": "^8.1.1",
Expand Down
19 changes: 17 additions & 2 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
"add_skill": "Add Skill",
"add_spoke": "Add Spoke Facility",
"add_tags": "Add Tags",
"add_user": "Add User",
"additional_information": "Additional Information",
"additional_instructions": "Additional Instructions",
"address": "Address",
Expand Down Expand Up @@ -675,8 +676,8 @@
"copying_is_not_allowed": "Copying is not allowed",
"could_not_load_page": "We are facing some difficulties showing the Page you were looking for. Our Engineers have been notified and we'll make sure that this is resolved on the fly!",
"countries_travelled": "Countries travelled",
"cover_image_deleted.": "Cover image deleted.",
"cover_image_updated.": "Cover image updated.",
"cover_image_deleted": "Cover Image Deleted",
"cover_image_updated": "Cover Image Updated",
"covid_19_cat_gov": "Covid_19 Clinical Category as per Govt. of Kerala guideline (A/B/C)",
"covid_19_death_reporting_form_1": "Covid-19 Death Reporting : Form 1",
"covid_details": "Covid Details",
Expand All @@ -702,6 +703,7 @@
"create_tag": "Create Tag",
"create_template": "Create Template",
"create_user": "Create User",
"create_user_and_add_to_org": "Create a new user and add them to the organization.",
"created": "Created",
"created_by": "Created By",
"created_date": "Created Date",
Expand Down Expand Up @@ -831,6 +833,7 @@
"edit_profile": "Edit Profile",
"edit_role": "Edit Role",
"edit_schedule_template": "Edit Schedule Template",
"edit_user": "Edit User",
"edit_user_profile": "Edit Profile",
"edit_user_role": "Edit User Role",
"edited_by": "Edited by",
Expand Down Expand Up @@ -961,6 +964,7 @@
"enter_aadhaar_otp": "Enter OTP sent to the registered mobile with Aadhaar",
"enter_abha_address": "Enter ABHA Address",
"enter_any_id": "Enter any ID linked with your ABHA number",
"enter_dosage_instructions": "Enter Dosage Instructions",
"enter_file_name": "Enter File Name",
"enter_message": "Start typing...",
"enter_mobile_number": "Enter Mobile Number",
Expand Down Expand Up @@ -1161,6 +1165,7 @@
"insurance__policy_name": "Policy ID / Policy Name",
"insurance_details_detail": "Include details of all the Insurance Policies held by the Patient for smooth insurance processing",
"insurer_name_required": "Insurer Name is required",
"intended": "Intended",
"intent": "Intent",
"international_mobile": "International Mobile",
"invalid_asset_id_msg": "Oops! The asset ID you entered does not appear to be valid.",
Expand Down Expand Up @@ -1312,6 +1317,7 @@
"medical_council_registration_required": "Medical Council Registration is required",
"medical_records": "Medical Records",
"medical_worker": "Medical Worker",
"medication": "Medication",
"medication_taken_between": "Medication Taken Between",
"medicine": "Medicine",
"medicine_administration_history": "Medicine Administration History",
Expand Down Expand Up @@ -1444,6 +1450,8 @@
"noshow": "No-show",
"not_eligible": "Not Eligible",
"not_specified": "Not Specified",
"not_taken": "Not Taken",
"note": "Note",
"notes": "Notes",
"notes_placeholder": "Type your Notes",
"notice_board": "Notice Board",
Expand All @@ -1467,6 +1475,7 @@
"old_password": "Current Password",
"on": "on",
"on_emergency_basis": " on emergency basis",
"on_hold": "On Hold",
"ongoing_medications": "Ongoing Medications",
"only_indian_mobile_numbers_supported": "Currently only Indian numbers are supported",
"op_encounter": "OP Encounter",
Expand Down Expand Up @@ -1661,6 +1670,7 @@
"priority": "Priority",
"prn_prescription": "PRN Prescription",
"prn_prescriptions": "PRN Prescriptions",
"prn_reason": "PRN Reason",
"procedure_suggestions": "Procedure Suggestions",
"procedures_select_placeholder": "Select procedures to add details",
"professional_info": "Professional Information",
Expand Down Expand Up @@ -1716,6 +1726,7 @@
"register_patient": "Register Patient",
"reject": "Reject",
"rejected": "Rejected",
"related_person": "Related Person",
"reload": "Reload",
"remarks": "Remarks",
"remarks_placeholder": "Enter remarks",
Expand Down Expand Up @@ -1869,6 +1880,7 @@
"select_eligible_policy": "Select an Eligible Insurance Policy",
"select_facility": "Select Facility",
"select_facility_description": "Select the healthcare facility that will provide the requested resource.",
"select_facility_feature": "Select Facility Features",
"select_facility_for_discharged_patients_warning": "Facility needs to be selected to view discharged patients.",
"select_facility_type": "Select Facility Type",
"select_for_administration": "Select for Administration",
Expand Down Expand Up @@ -1986,6 +1998,7 @@
"status": "Status",
"stop": "Stop",
"stop_recording": "Stop Recording",
"stopped": "Stopped",
"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",
Expand Down Expand Up @@ -2126,6 +2139,7 @@
"update_shift_request": "Update Shift Request",
"update_status": "Update Status",
"update_status_details": "Update Status/Details",
"update_user": "Update User",
"update_user_role_organization": "Update the role for this user in the organization",
"update_volunteer": "Reassign Volunteer",
"updated": "Updated",
Expand Down Expand Up @@ -2163,6 +2177,7 @@
"user_removed_success": "User removed from organization successfully",
"user_role_update_success": "User role updated successfully",
"user_type": "User Type",
"user_updated_successfully": "User updated successfully",
"username": "Username",
"username_already_exists": "This username already exists",
"username_available": "Username is available",
Expand Down
4 changes: 4 additions & 0 deletions src/common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export const GENDER_TYPES = [
{ id: "non_binary", text: "Non Binary", icon: "TRANS" },
] as const;

export const GENDERS = GENDER_TYPES.map((gender) => gender.id) as [
(typeof GENDER_TYPES)[number]["id"],
];

export const CONSULTATION_SUGGESTION = [
{ id: "HI", text: "Home Isolation", deprecated: true }, // # Deprecated. Preserving option for backward compatibility (use only for readonly operations)
{ id: "A", text: "Admission" },
Expand Down
8 changes: 8 additions & 0 deletions src/components/Common/ComboboxQuantityInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ export function ComboboxQuantityInput({
}
};

React.useEffect(() => {
setInputValue(quantity?.value.toString() || "");
}, [quantity?.value]);

React.useEffect(() => {
setSelectedUnit(quantity?.unit);
}, [quantity?.unit]);

return (
<div className="relative flex w-full lg:max-w-[200px] flex-col gap-1">
<Popover open={open && showDropdown} onOpenChange={setOpen}>
Expand Down
Loading

0 comments on commit 1bc5855

Please sign in to comment.