idurar / idurar-erp-crm

Free Open Source ERP CRM Accounting Invoicing Software | Node Js React
https://cloud.idurarapp.com
GNU Affero General Public License v3.0
6.58k stars 2.04k forks source link

Issues/preventing invalid input in forms #1071

Closed Ouchi-Ranim closed 7 months ago

Ouchi-Ranim commented 7 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