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 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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

layershifter commented May 10, 2019

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

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

@bubunyo

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

layershifter commented Jun 23, 2019

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

@layershifter layershifter merged commit 5990d82 into Semantic-Org:master Jun 28, 2019
3 checks passed
3 checks passed
ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 99.83%)
Details
codecov/project 99.83% (+<.01%) compared to a25809e
Details
@welcome

This comment has been minimized.

Copy link

welcome bot commented Jun 28, 2019

Congrats on merging your first pull request! 🎉🎉🎉

robot victory dance

@sholladay

This comment has been minimized.

@layershifter looks like this line was merged, presumably by mistake.

This comment has been minimized.

Copy link
Member Author

layershifter replied Jun 29, 2019

Yep, it was removed in 991b357 👍 And was not merged with PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.