Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

feat(patient): add input validation #2032

Merged
merged 5 commits into from
May 3, 2020

Conversation

LucasBN
Copy link
Contributor

@LucasBN LucasBN commented May 1, 2020

Fixes #1976

Changes proposed in this pull request:

  • Prefix / Suffix / Family Name / Preferred Language Validated to ensure no numerical input
  • Added to both edit and create
  • Provides feedback to user
  • Added tests for new code

@gitpod-io
Copy link

gitpod-io bot commented May 1, 2020

@vercel
Copy link

vercel bot commented May 1, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/hk3hui3qb
✅ Preview: https://hospitalrun-frontend-git-fork-lucasbn-patientvalidation.hospitalrun.now.sh

jackcmeyer
jackcmeyer previously approved these changes May 1, 2020
Copy link
Member

@jackcmeyer jackcmeyer left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@jackcmeyer jackcmeyer added patients issue/pull request that interacts with patients module 🚀enhancement an issue/pull request that adds a feature to the application labels May 1, 2020
@jackcmeyer jackcmeyer added this to the v2.0 milestone May 1, 2020
@matteovivona
Copy link
Contributor

@LucasBN can you resolve the 3 conflicts? thanks!

@lgtm-com
Copy link

lgtm-com bot commented May 2, 2020

This pull request introduces 1 alert when merging ee3769e into 91a1a5c - view on LGTM.com

new alerts:

  • 1 for Syntax error

@LucasBN
Copy link
Contributor Author

LucasBN commented May 2, 2020

@LucasBN can you resolve the 3 conflicts? thanks!

@tehkapa Done

Comment on lines 206 to 210
dateOfBirth: addDays(new Date(), 4).toISOString(),
suffix: '061002',
prefix: '061002',
familyName: '061002',
preferredLanguage: '061002',
Copy link
Member

Choose a reason for hiding this comment

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

This test was changed to only check for required fields. I think that we should remove everything but givenName in this test.

I think we'll need to add some other test which checks for numbers in the string.

Copy link
Member

Choose a reason for hiding this comment

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

I believe this is why the build is failing.

@@ -386,6 +395,10 @@ describe('patients slice', () => {
id: expectedPatientId,
givenName: undefined,
dateOfBirth: addDays(new Date(), 4).toISOString(),
suffix: '061002',
Copy link
Member

Choose a reason for hiding this comment

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

let's change this test to only test the numbers in the values.

@matteovivona matteovivona added the in progress indicates that issue/pull request is currently being worked on label May 3, 2020
@jackcmeyer jackcmeyer merged commit bb02fa2 into HospitalRun:master May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀enhancement an issue/pull request that adds a feature to the application in progress indicates that issue/pull request is currently being worked on patients issue/pull request that interacts with patients module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create/Edit Patient inputs are not validated
3 participants