Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature) Length Validation for TextInput Fields #38

Merged
merged 3 commits into from
Apr 20, 2023
Merged

Conversation

eudson
Copy link
Contributor

@eudson eudson commented Apr 20, 2023

Length based validation for textInputField component.

  • This adds new validation to the form engine lib, this will allow users to specify a min and max character length.
  • My work includes tests
  • Screenshot of working validation

image

Copy link
Member

@donaldkibet donaldkibet left a comment

Choose a reason for hiding this comment

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

🚀 LGTM just a nit

Comment on lines +11 to +12
min: '5',
max: '10',
Copy link
Member

Choose a reason for hiding this comment

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

for TextInput i feel having the name minLength and maxLength is more descriptive of what we want to achieve with it.

@pirupius pirupius merged commit 2285d8c into openmrs:main Apr 20, 2023
@donaldkibet
Copy link
Member

Seem we have a problem with this validation. We need to check for scenario where the min and max length aren't defined. Check this sample example

Screenshot 2023-04-20 at 11 12 05 PM

@pirupius
Copy link
Member

@donaldkibet let me issue a follow up PR to resolve this

@eudson
Copy link
Contributor Author

eudson commented Apr 21, 2023

Seem we have a problem with this validation. We need to check for scenario where the min and max length aren't defined. Check this sample example

Screenshot 2023-04-20 at 11 12 05 PM

Thanks @donaldkibet I will issue a PR

CynthiaKamau pushed a commit to CynthiaKamau/openmrs-form-engine-lib that referenced this pull request Apr 25, 2023
* Updated instructions for local development

* Added length validation to text-input field + tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants