HospitalRun / hospitalrun-frontend

Frontend for HospitalRun
https://staging.hospitalrun.io
MIT License
6.81k stars 2.18k forks source link

Creating new patient - validation messages not appropriate #2699

Open savanrajkotiya opened 3 years ago

savanrajkotiya commented 3 years ago

Before you submit an issue we recommend you drop into our Slack workspace and ask any questions you have or mention any problems you've had getting started with HospitalRun.

Please read this entire template before posting any issue. If you ignore these instructions and post an issue here that does not follow the instructions, your issue might be closed, locked, and assigned the missing discussion label.

🐛 Bug Report

The validation messages of inputs are not appropriate ex. 'Must be a valid phone number.' but what's a valid phone number pattern.? PFA the Image

To Reproduce

Steps to reproduce the behavior:

Expected behavior

A clear and appropriate validation message should appear so that user will get to know what mistake that they made.

Your Environment

Screenshot from 2021-06-14 21-52-31

dangnhon commented 3 years ago

Hi there @tehKapa, what would be the expected validation message? Something on the lines of "Must be valid 10 digit" or etc? I'm interested in this issue.

matteovivona commented 3 years ago

@dangnhon yes, it would be necessary to do a validation in terms of country code and max phone digits

reginz commented 3 years ago

Hi @tehKapa. So I found this https://github.com/jackocnr/intl-tel-input I think you can use this input field and maybe you can check if user input is equal to selectedCountryPlaceholder or not.

matteovivona commented 3 years ago

@reginz looks fine

abhiFSD commented 1 year ago

hello @tehKapa can I work on this issue?