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

Add 'warn' alternative to 'validate' #1780

Merged
merged 4 commits into from Sep 22, 2016
Merged

Add 'warn' alternative to 'validate' #1780

merged 4 commits into from Sep 22, 2016

Conversation

timhwang21
Copy link
Contributor

Referencing #1779 and #1649.

To use, add a function warn() to reduxForm decorator. This function should
be similar to validate(). Behavior will be identical, except warnings do not
mark a form as invalid.

(If I missed any steps in the PR process, please let me know. Thanks!)

Also updated tests to cover new feature. There are two odd tests marked with
TODO in reduxForm.spec.js involving unexpected renders, though.

@codecov-io
Copy link

codecov-io commented Sep 15, 2016

Current coverage is 100% (diff: 100%)

Merging #1780 into master will not change coverage

@@           master   #1780   diff @@
=====================================
  Files          53      53          
  Lines        1144    1189    +45   
  Methods         0       0          
  Messages        0       0          
  Branches        0       0          
=====================================
+ Hits         1144    1189    +45   
  Misses          0       0          
  Partials        0       0          

Powered by Codecov. Last update 7489aa4...5d1db16

// username input rerendered twice, once for value, once for sync warning
expect(usernameInput.calls.length).toBe(3)

// should be valid now
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just realized some of these comments are nonsensical now. I could re-add the validity checks (warning should not invalidate form), or just take out the comments.

@erikras
Copy link
Member

erikras commented Sep 17, 2016

Excellent work. Can you do the same process in the docs?

@timhwang21
Copy link
Contributor Author

Thanks for the response!

  • Described warnings usage in reduxForm.md
  • Added simple warning to Sync Validation example -- if this is unnecessary, can be removed.

Let me know if you need anything else. Thanks again!

@erikras
Copy link
Member

erikras commented Sep 19, 2016

Needs to be in Field.md, too.

@timhwang21
Copy link
Contributor Author

Done!

@erikras
Copy link
Member

erikras commented Sep 22, 2016

😞 Sorry, your PR was first, but something got merged that is causing a conflict. Can you resolve? I will merge asap.

Tim Hwang and others added 4 commits September 22, 2016 10:13
To use, add a function warn() to reduxForm decorator. This function should
be similar to validate(). Behavior will be identical, except warnings do not
mark a form as invalid.

Also updated tests to cover new feature. There are two odd tests marked with
TODO in reduxForm.spec.js involving unexpected renders, though.
* Described usage in reduxForm.md
* Added simple warning to Sync Validation example
@timhwang21
Copy link
Contributor Author

Yep, no problem -- fixed it and pushed.

(Would it be better practice to squash my four commits and add the issue number? Thanks!)

@elodszopos
Copy link
Contributor

I'm actually looking forward to this one too, always wondered why it was always black or white only. 👍

@erikras erikras merged commit 49d0bc5 into redux-form:master Sep 22, 2016
@timhwang21
Copy link
Contributor Author

Thanks! 😄

@ilxanlar
Copy link

Finally got what I was waiting for, Thank you guys.

@btroop
Copy link

btroop commented Sep 26, 2016

thanks @timhwang21 !

@erikras
Copy link
Member

erikras commented Oct 7, 2016

Published in v6.1.0.

@lock
Copy link

lock bot commented Jun 2, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants