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
Tested validation logic with various input scenarios, including empty fields, invalid characters, and incorrect formats.
Verified that error messages are displayed correctly and submission is blocked until valid input is provided.
Conducted manual testing to ensure that the user interface remains responsive and intuitive.
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
The after:
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
This pull request follows the project's coding guidelines and best practices.
Feedback and suggestions for improvement are welcome.
Checklist
[ yes] I have tested these changes
[ ] I have updated the relevant documentation
[yes ] I have commented my code, particularly in hard-to-understand areas
[yes ] I have made corresponding changes to the codebase
[yes ] My changes generate no new warnings or errors
[yes ] The title of my pull request is clear and descriptive
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 The after: 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
This pull request follows the project's coding guidelines and best practices.
Feedback and suggestions for improvement are welcome.
Checklist
[ yes] I have tested these changes
[ ] I have updated the relevant documentation
[yes ] I have commented my code, particularly in hard-to-understand areas
[yes ] I have made corresponding changes to the codebase
[yes ] My changes generate no new warnings or errors
[yes ] The title of my pull request is clear and descriptive