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

Validations #89

Open
wants to merge 2 commits into
base: production
Choose a base branch
from
Open

Conversation

ymarcon
Copy link
Contributor

@ymarcon ymarcon commented Dec 16, 2021

While attempting to make a multi-step form (using the showCondition to hide fields that are not part of the current step), I had the issue that "on next step" action, the validateFormPerSchema() call was returning errors from the hidden fields. I could have ignored errors from the fields that are not in the step (extra work), but for the form logic it is still problematic to have errors on fields that cannot be modified.

=> validateFieldPerSchema() does not perform validations on fields for which showCondition is false.

I had also the issue that the error prop is expected to be a Boolean by Quasar's QInput.

=> In validateFieldPerSchema() and in evaluateError(), when error is a Boolean and is false, the error message is looked up in the errorMessage prop (if not found, a default fieldValidationError is shown). When error prop returns a string the original behavior is still operational.

@ymarcon
Copy link
Contributor Author

ymarcon commented Dec 20, 2021

I have updated the PR with the latest production branch.

@ymarcon
Copy link
Contributor Author

ymarcon commented Dec 21, 2021

I have added a fix when checking for Required error on a boolean value.

You can try this PR from my project obiba/quasar-ui-amber, and go to the test page BlitzarFormItemsStepsLayoutTest.vue.

@ymarcon
Copy link
Contributor Author

ymarcon commented Jan 5, 2022

Happy new year, any update about this PR? Validation errors on not visible fields is currently a blocker for me.

@mesqueeb
Copy link
Member

mesqueeb commented Jan 5, 2022

@ymarcon happy new year

=> validateFieldPerSchema() does not perform validations on fields for which showCondition is false.

This one I agree with, I want to merge it.

For the rest, in order to decide what to do I think I want to finish the Framework examples for the documentation. I want to experience the exact issue with Quasar to make an informative decision.

when error is a Boolean and is false, the error message is looked up in the errorMessage prop

Do you mean true ?

@ymarcon
Copy link
Contributor Author

ymarcon commented Jan 6, 2022

Yes, sorry I meant true.

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.

None yet

2 participants