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

Adding validation for PF4 forms #989

Closed
wants to merge 1 commit into from

Conversation

damianpm
Copy link
Contributor

@damianpm damianpm commented Jul 11, 2019

What this PR does / why we need it:

Extract PF4 Form validation to a common file

Which issue(s) this PR fixes

https://issues.jboss.org/browse/THREESCALE-2993

@damianpm damianpm force-pushed the THREESCALE-2993-Client-Side-Form-Validation branch from 3ff6f89 to f89c48b Compare July 11, 2019 15:18
@damianpm damianpm marked this pull request as ready for review July 11, 2019 15:22
Copy link
Contributor

@josemigallas josemigallas left a comment

Choose a reason for hiding this comment

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

I don't think formValidation belongs in utilities since it is not reusable. It's too tied to the login components. Also I don't see any validation at all, apart from checking passwords.

I think the idea solution is to provide a generic validation class in utilities folder and import it in the components, and validate values over input elements that can change over time.

On the other hand, if we are not going to provide a responsive validation I don't see the point of cliend-side validation at all. I mean, if we're going to validate only when clicking submit we might as well just validate on server to reduce workload in the UI.

@didierofrivia @hallelujah WDYT?

@didierofrivia
Copy link
Member

@josemigallas @damianpm Yes, I don't think that kind of validation is useful nor reusable. There are libs that can aid with simple checks (ie: password don't match, email address invalid, etc..)and we can rely on proper server-side validation to display more specific errors (i.e: user taken)

@damianpm
Copy link
Contributor Author

@josemigallas @didierofrivia I know this is not reusable. But we have an issue, we are using PF4 react components and I was trying to adjust to that. We can look for a library to do the validation, just keep in mind we should adjust to PF4 components and styling

@josemigallas
Copy link
Contributor

josemigallas commented Jul 12, 2019

@damianpm I don't understand, we should adjust to PF4 components and styling in what sense? What does that have to do with validations?

@damianpm
Copy link
Contributor Author

In that sense that there are lot of React forms packages, but we only want validation

@damianpm
Copy link
Contributor Author

Closing in favor of #1005

@damianpm damianpm closed this Jul 19, 2019
@damianpm damianpm deleted the THREESCALE-2993-Client-Side-Form-Validation branch November 15, 2019 08:06
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