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(Form): make error prop shorthand in Form.Field #3603

Merged
merged 9 commits into from
Jun 28, 2019

Conversation

bubunyo
Copy link
Contributor

@bubunyo bubunyo commented May 9, 2019

Fixes #3602.

This PR makes error prop in Form.Field shorthand that allows to define custom error message inside it.

<Form.Input  error='Please enter your last name' label='Last name' />
<Form.Checkbox
  label='I agree to the Terms and Conditions' 
  error='You must agree to the terms and conditions'
/>

image

@welcome
Copy link

welcome bot commented May 9, 2019

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Run yarn lint locally to catch formatting errors. This will fix some errors automatically, commit and push any changes.
  • Run yarn test locally to catch errors. This ensures all components still behave as they should.
  • Run yarn start to run the doc site locally and try a few pages, ensuring everything is in good working order.
  • Include tests when adding/changing behavior.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@codecov-io
Copy link

codecov-io commented May 9, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3603      +/-   ##
==========================================
+ Coverage   99.83%   99.83%   +<.01%     
==========================================
  Files         174      174              
  Lines        3100     3104       +4     
==========================================
+ Hits         3095     3099       +4     
  Misses          5        5
Impacted Files Coverage Δ
src/collections/Form/FormField.js 100% <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 a25809e...9f2e27f. Read the comment docs.

@layershifter
Copy link
Member

https://semantic-ui.com/behaviors/form.html#validating-on-blur-and-other-events

SUI has similar thing actually, will share more thoughts tomorrow.

@bubunyo
Copy link
Contributor Author

bubunyo commented May 10, 2019

Sure, As much as the SUI way attempts to solve the same problem, I think their way can be easily replicated, using already existing components. I don't see this PR being merged unless there is an earlier PR on SUI to deals with the formatting. CSS is not my strong suit, but I am attempting to submit a PR for that. I will welcome any help on that.

@layershifter layershifter changed the title Input error msg feat(Form): make error prop shorthand in Form.Field Jun 23, 2019
@layershifter
Copy link
Member

@bubunyo I pushed some updates to this PR, can you please check? 🙏

@layershifter layershifter merged commit 5990d82 into Semantic-Org:master Jun 28, 2019
@welcome
Copy link

welcome bot commented Jun 28, 2019

Congrats on merging your first pull request! 🎉🎉🎉

robot victory dance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for error messages in <Form.Field/>
5 participants