diff --git a/cypress/e2e/users_spec/UsersCreation.cy.ts b/cypress/e2e/users_spec/UsersCreation.cy.ts index 2c5797fefa7..392c9ff987d 100644 --- a/cypress/e2e/users_spec/UsersCreation.cy.ts +++ b/cypress/e2e/users_spec/UsersCreation.cy.ts @@ -79,13 +79,10 @@ describe("User Creation", () => { ); userCreationPage.typeIntoElementByIdPostClear("lastName", "Cypress"); userCreationPage.selectDropdownOption("gender", "Male"); - userCreationPage.typeIntoElementByIdPostClear( - "phoneNumber", - "+91" + phone_number, - ); + userCreationPage.typeIntoElementByIdPostClear("phoneNumber", phone_number); userCreationPage.typeIntoElementByIdPostClear( "altPhoneNumber", - "+91" + emergency_phone_number, + emergency_phone_number, ); userCreationPage.typeIntoElementByIdPostClear("email", "test@test.com"); userCreationPage.typeIntoElementByIdPostClear("weekly_working_hours", "14"); diff --git a/cypress/e2e/users_spec/UsersProfile.cy.ts b/cypress/e2e/users_spec/UsersProfile.cy.ts index 8dc1ad7ef0a..3073cebe7ce 100644 --- a/cypress/e2e/users_spec/UsersProfile.cy.ts +++ b/cypress/e2e/users_spec/UsersProfile.cy.ts @@ -10,7 +10,7 @@ describe("Manage User Profile", () => { const date_of_birth = "01011999"; const gender = "Male"; const email = "test@example.com"; - const phone = "+918899887788"; + const phone = "8899887788"; const workinghours = "8"; const qualification = "MBBS"; const doctorYoE = "10"; diff --git a/cypress/pageobject/Facility/FacilityLocation.ts b/cypress/pageobject/Facility/FacilityLocation.ts index be14e9a8c81..31bc30290f7 100644 --- a/cypress/pageobject/Facility/FacilityLocation.ts +++ b/cypress/pageobject/Facility/FacilityLocation.ts @@ -84,7 +84,7 @@ class FacilityLocation { } clickNotification() { - cy.get(".pnotify").click(); + cy.get(".pnotify-container").click(); } enterBedName(name: string) { diff --git a/src/components/Form/FormFields/PhoneNumberFormField.tsx b/src/components/Form/FormFields/PhoneNumberFormField.tsx index 4d1bda64399..92bca8126ea 100644 --- a/src/components/Form/FormFields/PhoneNumberFormField.tsx +++ b/src/components/Form/FormFields/PhoneNumberFormField.tsx @@ -92,10 +92,6 @@ export default function PhoneNumberFormField(props: Props) { } }, [setValue]); - useEffect(() => { - setValue(field.value || "+91"); - }, []); - return ( { - if (value == null) { + if (!value) { return "+91 "; } diff --git a/src/components/Users/UserProfile.tsx b/src/components/Users/UserProfile.tsx index 92d7f34aaa6..7aa3c9eff34 100644 --- a/src/components/Users/UserProfile.tsx +++ b/src/components/Users/UserProfile.tsx @@ -126,6 +126,7 @@ export default function UserProfile() { isChecking: false, isUpdateAvailable: false, }); + const [dirty, setDirty] = useState(false); const authUser = useAuthUser(); @@ -181,6 +182,7 @@ export default function UserProfile() { type: "set_form", form: formData, }); + setDirty(false); }, }); @@ -333,6 +335,7 @@ export default function UserProfile() { type: "set_form", form: { ...states.form, [event.name]: event.value }, }); + setDirty(true); }; const getDate = (value: any) => @@ -857,7 +860,11 @@ export default function UserProfile() {
- +