idurar / idurar-erp-crm

Open Source Headless ERP CRM E-Commerce Accounting Software | Node Js React
https://cloud.idurarapp.com/
Other
5.9k stars 1.73k forks source link

Issues/prevent invalid input #1073

Open Ouchi-Ranim opened 2 months ago

Ouchi-Ranim commented 2 months ago

Description

This pull request addresses the issue of preventing invalid input ( such as numerical values in the first/last name fields and alphabetical in phone number ) for form fields in the Idurar application specifically in people when adding a new person. I made a few changes to fix this issue that I opened 3 weeks ago #1039: The change must be in the forms/dynamicForm/index.js where I defined restrictions under the rules and I used regular expression (regex) to fix the issue, now it only accepts valid input when adding a new person and displays .

Reasoning

Invalid input can lead to data inconsistencies and usability issues in our application. By implementing validation logic on the client side, we ensure that users provide valid input before submitting forms, improving data quality and user experience.

Testing

Related Issues

Fixes #1039

Steps to Test

1) Go to peoples 2) Click On add a new person 3) enter invalid input in First Name, Last name ( numerical values) 4) enter invalid input in phone number (alphabetical values) 5) check the error message with the new update, no error message currently

Screenshots

This is the Before, no error message appears when entering invalid input image The after: image the screenshot above shows that when entering invalid input , it shows error and you cannot add another person unless you respect the regular expressions

If your changes include visual updates, it would be helpful to provide screenshots of the before and after.

Additional notes