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

[Form lib] Unexpected handling of validation onSubmit #85383

Open
jloleysens opened this issue Dec 9, 2020 · 1 comment
Open

[Form lib] Unexpected handling of validation onSubmit #85383

jloleysens opened this issue Dec 9, 2020 · 1 comment
Labels
Feature:FormLib Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@jloleysens
Copy link
Contributor

Kibana version:

Current master

Describe the bug:

There is a very specific validation implementation in ILM currently:

export const rolloverThresholdsValidator: ValidationFunc = ({ form }) => {

This validates the value of 3 fields and adds an error depending on that validation to each of the three fields. This implementation creates a situation where submitting the form will cause the form to block submitting because the validator does not return a value on error. Instead, the validator calls "setError" against each of the 3 fields when the error condition is met.

The expectation would be for the form lib to block on these fields with errors, not just checking if running validate returned any errors.

In other words the expected behaviour is; check if any fields have errors after the most recent validation was triggered. This will be triggered by submiting the form OR if the validator returned any "errors".

Any additional context:

PR implementing a work-around #85292 - fix is to have the validator return a value.

@jloleysens jloleysens added the Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more label Dec 9, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:FormLib Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

3 participants