Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #7610 Toggle Emergency Contact No. From Phone Number #7644

Conversation

manasvi-gaur
Copy link
Contributor

image

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

@manasvi-gaur manasvi-gaur requested a review from a team as a code owner April 17, 2024 10:24
Copy link

vercel bot commented Apr 17, 2024

@manasvi-gaur is attempting to deploy a commit to the Open Healthcare Network Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 8314974
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6639e7c4184fe10008fc301f
😎 Deploy Preview https://deploy-preview-7644--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for care-net failed.

Name Link
🔨 Latest commit aed8edb
🔍 Latest deploy log https://app.netlify.com/sites/care-net/deploys/661fa79f22f4c600088a0653

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Apr 17, 2024
@manasvi-gaur
Copy link
Contributor Author

@rithviknishad can you review the PR

@rithviknishad rithviknishad added cypress failed pull request with cypress test failure and removed Deploy-Failed Deplyment is not showing preview labels Apr 18, 2024
@rithviknishad
Copy link
Member

@manasvi-gaur Tests are failing. Cypress tests needs to be updated

Comment on lines 1328 to 1332
value={
isEmergencyNumberEnabled
? field("phone_number").value
: initForm.emergency_phone_number
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause issues as the displayed value may not be the one that is sent in the POST request.

Update form state for emergency phone number instead of displaying a different value conditionally.

Comment on lines 748 to 753
emergency_phone_number: parsePhoneNumber(formData.emergency_phone_number),
emergency_phone_number: isEmergencyNumberEnabled
? parsePhoneNumber(formData.phone_number)
: parsePhoneNumber(formData.emergency_phone_number),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid changing this here.
Let's keep the formData / form state the source of truth.

src/Components/Patient/PatientRegister.tsx Outdated Show resolved Hide resolved
src/Components/Patient/PatientRegister.tsx Outdated Show resolved Hide resolved
@nihal467
Copy link
Member

@manasvi-gaur can you fix the issues ASAP

@manasvi-gaur
Copy link
Contributor Author

@nihal467 okay

@manasvi-gaur
Copy link
Contributor Author

@rithviknishad I have made all relevant changes but I am unable to get cypress test failing reason, can you tell what updates do i have to make in cypress ?

@rithviknishad
Copy link
Member

@manasvi-gaur the patient registration cypress tests need to be modified to account for the changes made in this PR.

Also ensure lint checks are passing. Ensure prettier is configured in your local and has latest packages installed.

@nihal467
Copy link
Member

nihal467 commented Apr 29, 2024

  • Go to patient_registration.cy.ts file and modify any existing test to include this toggle function in the emergency phone number

@nihal467
Copy link
Member

nihal467 commented May 7, 2024

LGTM

@nihal467 nihal467 added tested and removed needs testing Cypress Test Pending The Cypress test are to be verified labels May 7, 2024
@khavinshankar khavinshankar merged commit 3e2ebab into coronasafe:develop May 7, 2024
28 of 30 checks passed
Copy link

github-actions bot commented May 7, 2024

@manasvi-gaur Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toggle to be made available to Enter Emergency Contact No. From Phone Number
5 participants