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

Remove phone duplication check on patient update #6359

Merged
merged 4 commits into from
Sep 27, 2023
Merged

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Sep 27, 2023

WHAT

🤖 Generated by Copilot at 1fc93a7

Improved form validation for patient registration. Added support for async validation functions in the Form component and used it to check for duplicate phone numbers in the PatientRegister component. Removed unnecessary debounce logic.

Proposed Changes

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

HOW

🤖 Generated by Copilot at 1fc93a7

  • Allow asynchronous validation in Form component by changing validate prop type to accept a function that returns a promise of errors (link)
  • Await the result of validate function and assign it to validationResult variable before omitting empty errors and checking error keys in Form component (link)
  • Remove unused debounce import and require statement from PatientRegister component (link, link)
  • Change validateForm function to an async function and use for...of loop instead of forEach to iterate over form fields in PatientRegister component (link, link)
  • Replace return statements with break statements inside switch cases to avoid exiting validateForm function prematurely in PatientRegister component (link, link, link, link, link, link, link)
  • Call and await duplicateCheck function inside phone_number case and add error message if duplicate phone number is found in validateForm function in PatientRegister component (link)
  • Change duplicateCheck function from a debounced function to a regular async function that returns a boolean value in PatientRegister component (link)
  • Remove call to duplicateCheck function from onChange handler of PhoneNumberField component in PatientRegister component (link)

@Ashesh3 Ashesh3 requested a review from a team September 27, 2023 13:43
@Ashesh3 Ashesh3 requested a review from a team as a code owner September 27, 2023 13:43
@Ashesh3 Ashesh3 requested a review from gigincg September 27, 2023 13:43
@vercel
Copy link

vercel bot commented Sep 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2023 3:06pm

@netlify
Copy link

netlify bot commented Sep 27, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit a6be43e
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/651444a610c00c0008b77497
😎 Deploy Preview https://deploy-preview-6359--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.

@cypress
Copy link

cypress bot commented Sep 27, 2023

Passing run #1321 ↗︎

0 78 0 0 Flakiness 0

Details:

Remove phone duplication check on patient update
Project: CARE Commit: a6be43e662
Status: Passed Duration: 03:07 💡
Started: Sep 27, 2023 3:09 PM Ended: Sep 27, 2023 3:12 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@Ashesh3 Ashesh3 changed the title Delay patient phone duplicate check Remove phone duplication check on patient update Sep 27, 2023
@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit bebb693 into develop Sep 27, 2023
29 checks passed
@khavinshankar khavinshankar deleted the fix-6347 branch September 27, 2023 16:32
@github-actions
Copy link

@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

@cypress cypress bot mentioned this pull request Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Patient Detail page is malfunctioning
3 participants