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

feat: Bails and Continues Modifiers #1451

Merged
merged 10 commits into from
Jul 1, 2018
Merged

feat: Bails and Continues Modifiers #1451

merged 10 commits into from
Jul 1, 2018

Conversation

logaretm
Copy link
Owner

@logaretm logaretm commented Jun 30, 2018

This PR introduces a couple of directive modifiers to the v-validate directive:

  • bails modifier: The field validation pipeline should stop at the first error.
  • continues modifier: The field validation pipeline runs through till all rules are tested.

Both have higher priority over the fastExit configuration, which allows you to exclude specific fields from the global option.

<!-- This fields overrides the global fastExit option and forces the validation to stop after the first failure -->
<input type="text" name="bails" v-validate.bails="'required|min:3|is:3'">
<!-- This field overrides the global fastExit option and forces the validation to test all rules -->
<input type="text" name="continues" v-validate.continues="'required|min:3|is:3'">
<!-- This field doesn't specify so it will respect the global 'fastExit' option -->
<input type="text" name="undefined" v-validate="'required|min:3|is:3'">

closes #1358, closes #1337

@logaretm logaretm added the 🌟 feature New feature label Jun 30, 2018
@codecov
Copy link

codecov bot commented Jun 30, 2018

Codecov Report

Merging #1451 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1451      +/-   ##
==========================================
+ Coverage   99.57%   99.58%   +<.01%     
==========================================
  Files          51       51              
  Lines        1663     1674      +11     
  Branches      543      549       +6     
==========================================
+ Hits         1656     1667      +11     
  Misses          7        7
Impacted Files Coverage Δ
src/core/field.js 100% <100%> (ø) ⬆️
src/core/validator.js 100% <100%> (ø) ⬆️
src/core/resolver.js 99.13% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eff0c2c...12d7b29. Read the comment docs.

@logaretm logaretm merged commit f9370c0 into master Jul 1, 2018
@logaretm logaretm deleted the feat-bail-n-continue branch July 11, 2018 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow empty field validation to be configurable Make fastExit configurable after VeeValidate initialization
1 participant