Skip to content

Commit

Permalink
Merge branch 'develop' into issues/8625/fix-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Sep 27, 2024
2 parents 9c32c24 + bbeab06 commit 9ebaf2d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("Patient Consultation in multiple combination", () => {
const patientWeight = "70";
const patientHeight = "170";
const medicineOne = "DOLOLUP";
const patientIpNumber = Math.random().toString(36).substring(7);
const patientIpNumber = `${Math.floor(Math.random() * 90 + 10)}/${Math.floor(Math.random() * 9000 + 1000)}`;

before(() => {
loginPage.loginAsDisctrictAdmin();
Expand Down Expand Up @@ -94,7 +94,7 @@ describe("Patient Consultation in multiple combination", () => {
cy.submitButton("Create Consultation");
// the above submit should fail as IP number is missing
patientConsultationPage.typePatientNumber(patientIpNumber);
patientConsultationPage.selectBed("Dummy Bed 1");
patientConsultationPage.selectBed("Dummy Bed 6");
cy.submitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// Below code for the prescription module only present while creating a new consultation
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientPrescription.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PatientPage } from "../../pageobject/Patient/PatientCreation";
const patientPrescription = new PatientPrescription();
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const medicineNameOne = "DOLO";
const medicineNameOne = "AGCON";
const medicineNameTwo = "FDEP PLUS";
const medicineBaseDosage = "4";
const medicineTargetDosage = "9";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useTranslation } from "react-i18next";
import Chip from "../../../CAREUI/display/Chip";
import Timeline, {
TimelineEvent,
Expand Down Expand Up @@ -204,6 +205,7 @@ const BedTitleSuffix = ({
isLastNode?: boolean;
prevBed?: CurrentBed;
}) => {
const { t } = useTranslation();
return (
<div className="flex flex-col">
<div className="flex gap-x-2">
Expand All @@ -215,7 +217,7 @@ const BedTitleSuffix = ({
{bed.bed_object.id === prevBed?.bed_object.id
? "Asset changed in" + " "
: "Transferred to" + " "}
<span className="font-semibold">{`${bed.bed_object.name} (${bed.bed_object.bed_type}) in ${bed.bed_object.location_object?.name}`}</span>
<span className="font-semibold">{`${bed.bed_object.name} (${t(bed.bed_object.bed_type!)}) in ${bed.bed_object.location_object?.name}`}</span>
{bed.end_date === null && (
<Chip
text="In Use"
Expand Down
7 changes: 6 additions & 1 deletion src/Components/Users/UserAdd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,12 @@ export const UserAdd = (props: UserProps) => {
}, [state.form.phone_number_is_whatsapp, state.form.phone_number]);

const setFacility = (selected: FacilityModel | FacilityModel[] | null) => {
setSelectedFacility(selected as FacilityModel[]);
const newSelectedFacilities = selected
? Array.isArray(selected)
? selected
: [selected]
: [];
setSelectedFacility(newSelectedFacilities as FacilityModel[]);
const form = { ...state.form };
form.facilities = selected
? (selected as FacilityModel[]).map((i) => i.id!)
Expand Down

0 comments on commit 9ebaf2d

Please sign in to comment.