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

Passing optional client-side validation props into the formik config #1637

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

monotasker
Copy link

Description

Allows custom deposit forms the option of using formik's client-side validation, while changing nothing about the form's server-side validation.

Formik's client-side validation capabilities are currently not accessible to anyone who is building a custom deposit form (i.e., overriding the RDMDepositForm component). There is no way to pass the client-side validation props from RDMDepositForm through to formik. This commit makes client-side validation accessible by passing two props ("validate" and "validationSchema") into formik config via DepositFormApp and DepositBoostrap. This way developers can choose either to pass through a validation function or to pass through a yup schema which formik understands.

These two props default to undefined in which case they are ignored. They do not interfere at all with the current server-side validation. So there's no risk or negative side-effect to passing them through.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Third-party code

If you've added third-party code (copy/pasted or new dependencies), please reach out to an architect.

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@Samk13 Samk13 requested a review from kpsherva December 15, 2023 09:48
Copy link
Contributor

This PR was automatically marked as stale.

@github-actions github-actions bot added the stale label Feb 14, 2024
…and simply required that the string not be empty

(cherry picked from commit aeae270)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To review
Development

Successfully merging this pull request may close these issues.

1 participant