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

Don't change validationSchema based on input #15108

Closed
timroes opened this issue Jul 28, 2022 · 3 comments · Fixed by #20146
Closed

Don't change validationSchema based on input #15108

timroes opened this issue Jul 28, 2022 · 3 comments · Fixed by #20146
Assignees
Labels
area/frontend Related to the Airbyte webapp team/extensibility technical-debt issues to fix code smell

Comments

@timroes
Copy link
Collaborator

timroes commented Jul 28, 2022

Currently our code does change the validationSchema of the ServiceForm based on some values, e.g. if the user selects another oneOf value with a sub object the whole validationSchema will change to reflect that.

I think we should try to generate the validationSchema once for the connectors spec and not change it based on the form values. Yup supports when to actually annotate that specific parts of a schema are only in effect when specific criterias are met. I think we should rather use that functionality to generate one validationSchema, that uses when to validate the different choices of a oneOf JSONSchema.

Especially since Formik doesn't revalidate the form when the validationSchema changes, we need to have special hacks for that in place.

This would require #13056 to be solved, so that the formik form actually only contain the individual connectors form, and thus the validationSchema could be kept unchanged while filling the form.

@timroes timroes added technical-debt issues to fix code smell area/frontend Related to the Airbyte webapp ui/connectors labels Jul 28, 2022
@octavia-squidington-iii
Copy link
Collaborator

cc @airbytehq/frontend

@flash1293
Copy link
Contributor

part of the last refactoring PR

@flash1293
Copy link
Contributor

Approved, waiting for the code freeze

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp team/extensibility technical-debt issues to fix code smell
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants