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

Updated the required validator to properly handle falsy numeric values #1485

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

malloy045
Copy link

@malloy045 malloy045 commented Sep 25, 2024

NOTE: This is a draft PR because I only have access to windows machine. I was able to successfully build and run the tests for the react-form-renderer workspace, but not the entire repository. I will try to get this working on a windows machine, but can't make any promises.

Fixes #1484

Description
When passing a falsy numeric value to the "is required" validator, the validator would report an error. These changes properly handle this case.

Checklist: (please see documentation page for more information)

  • Yarn build passes
  • Yarn lint passes
  • Yarn test passes
  • Test coverage for new code (if applicable)
  • Documentation update (if applicable)
  • Correct commit message
    • format fix|feat({scope}): {description}
    • i.e. fix(pf3): wizard correctly handles next button
    • fix will release a new _._.X version
    • feat will release a new _.X._ version (use when you introduce new features)
      • we want to avoid any breaking changes, please contact us, if there is no way how to avoid them
    • scope: package
    • if you update the documentation or tests, do not use this format
      • i.e. Fix button on documenation example page

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-forms ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 6:34pm

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.50%. Comparing base (a3488fc) to head (8ad3c55).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1485   +/-   ##
=======================================
  Coverage   94.49%   94.50%           
=======================================
  Files         210      210           
  Lines        3978     3984    +6     
  Branches     1630     1633    +3     
=======================================
+ Hits         3759     3765    +6     
  Misses        219      219           
Flag Coverage Δ
94.50% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@malloy045 malloy045 marked this pull request as draft September 25, 2024 19:11
@Hyperkid123
Copy link
Member

@malloy045 the code changes look good and the tests seem to verify it. I'll run this locally and I think we can go ahead and merge the changes.

Sounds good for you? Or do you want to challenge yourself and make the project work on your system?

@malloy045 malloy045 marked this pull request as ready for review September 26, 2024 11:43
@malloy045
Copy link
Author

malloy045 commented Sep 26, 2024

@malloy045 the code changes look good and the tests seem to verify it. I'll run this locally and I think we can go ahead and merge the changes.

Sounds good for you? Or do you want to challenge yourself and make the project work on your system?

@Hyperkid123, sounds good to me. I did try to get this working on windows and made some progress (this isn't in my wheelhouse), but it still isn't there yet. I'll keep working on it as time permits and raise a new PR if I get it working.

@Hyperkid123 Hyperkid123 merged commit a48da17 into data-driven-forms:master Sep 26, 2024
5 checks passed
@rvsia
Copy link
Contributor

rvsia commented Sep 26, 2024

@rvsia rvsia added the released label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Required validator does not allow 0 as numeric value
3 participants