From 203afd204a473c389c6b4d2d26b8e88600abc5e2 Mon Sep 17 00:00:00 2001 From: Harsh Renose <70405311+renoseHarsh@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:57:57 +0530 Subject: [PATCH] Fixed: Transfer patient pop-up behavior (#8245) * Updated Pop Close * Updaed Pop-up Close for Transfer --- .../Facility/DuplicatePatientDialog.tsx | 5 ++-- src/Components/Patient/PatientRegister.tsx | 24 +++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/Components/Facility/DuplicatePatientDialog.tsx b/src/Components/Facility/DuplicatePatientDialog.tsx index 7450d9fd8f1..b948ad91fa3 100644 --- a/src/Components/Facility/DuplicatePatientDialog.tsx +++ b/src/Components/Facility/DuplicatePatientDialog.tsx @@ -7,13 +7,12 @@ interface Props { patientList: Array; handleOk: (action: string) => void; handleCancel: () => void; - isNew: boolean; } const tdClass = "border border-secondary-400 p-2 text-left"; const DuplicatePatientDialog = (props: Props) => { - const { patientList, handleOk, handleCancel, isNew } = props; + const { patientList, handleOk, handleCancel } = props; const [action, setAction] = useState(""); return ( @@ -118,7 +117,7 @@ const DuplicatePatientDialog = (props: Props) => { { }); const [careExtId, setCareExtId] = useState(""); const [formField, setFormField] = useState(); + const [resetNum, setResetNum] = useState(false); const [isDistrictLoading, setIsDistrictLoading] = useState(false); const [isLocalbodyLoading, setIsLocalbodyLoading] = useState(false); const [isWardLoading, setIsWardLoading] = useState(false); @@ -1003,21 +1004,29 @@ export const PatientRegister = (props: PatientRegisterProps) => { { + handleDialogClose("close"); + setResetNum(true); + }} /> )} {statusDialog.transfer && ( handleDialogClose("back")} + onClose={() => { + setResetNum(true); + handleDialogClose("close"); + }} title="Patient Transfer Form" className="max-w-md md:min-w-[600px]" > handleDialogClose("close")} - handleCancel={() => handleDialogClose("back")} + handleCancel={() => { + setResetNum(true); + handleDialogClose("close"); + }} facilityId={facilityId} /> @@ -1134,6 +1143,13 @@ export const PatientRegister = (props: PatientRegisterProps) => { > {(field) => { if (!formField) setFormField(field); + if (resetNum) { + field("phone_number").onChange({ + name: "phone_number", + value: "+91", + }); + setResetNum(false); + } return ( <>