jurassix / react-validation-mixin

Simple validation mixin (HoC) for React.
MIT License
283 stars 38 forks source link

Labels for error keys #1

Closed ivan-kleshnin closed 9 years ago

ivan-kleshnin commented 9 years ago

At this moment react-validation-mixin doesn't provide either helper or guidance on this. I documented current approach to show how this may be done manually (via Joi, of course). I also added handy method to auto pull labels from form fields to Joi validation scheme. See updated documentation, please.

jurassix commented 9 years ago

Thanks for the pull request.

Being able to scrap the form for custom labels is nice feature too. I agree custom labels needed documentation, that was in the works.

I will add test to support your merge request and get this merged in soon.

jurassix commented 9 years ago

I've reviewed this pull request. I like the automated approach of pulling the label off the ref; pretty slick.

I'm not sure about exposing the 'autoLabel' option, or the implementation of the automated labelt. I'd like to rework this implementation and back it by a front-end test harness.

Can you modify this pull request to just include the documentation updates to the README around custom Joi labels?

Then open a subsequent issue, and provide your autoLabel implementation. We can work towards getting this feature in.

Again, I think your idea is great, but the implementation and api around autoLabels needs to be a bigger conversation.

ivan-kleshnin commented 9 years ago

Sure, no problem.

jurassix commented 9 years ago

Thanks! Published to npm as version 2.0.13

jurassix commented 9 years ago

oh...looks like I got the previous one pull merged in...Ok i'm backing out the changes to ValidationMixin and will release 2.0.14. Please open another issue for the autoLabel implementation. Thanks