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: validate add label #51

Closed
wants to merge 2 commits into from

Conversation

crazyair
Copy link
Contributor

类似于这样,添加 label

@vercel
Copy link

vercel bot commented Nov 29, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/react-component/rc-field-form/nlkiozowr
🌍 Preview: https://rc-field-form-git-fork-qq645381995-validate-add-label.react-component.now.sh

@codecov
Copy link

codecov bot commented Nov 29, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
+ Coverage   99.86%   99.86%   +<.01%     
==========================================
  Files          13       13              
  Lines         752      753       +1     
  Branches      157      159       +2     
==========================================
+ Hits          751      752       +1     
  Misses          1        1
Impacted Files Coverage Δ
src/Field.tsx 100% <100%> (ø) ⬆️
src/utils/validateUtil.ts 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 c65e768...c0032d1. Read the comment docs.

@zombieJ
Copy link
Member

zombieJ commented Dec 31, 2019

有点管多了,如果是需要定制消息的话应该使用 rule 里的 message。Field 本身应该是解耦的。

@zombieJ zombieJ closed this Dec 31, 2019
@crazyair
Copy link
Contributor Author

唉,我们这边场景是:请输入${label} ,哈哈哈。

@ghmendonca
Copy link

Why this is closed? This is exactly what I need and exactly what rc-form has. Usually you want the name of the field to be something but in the validate message you want to display something different.. For instance, my field name is full_name and it's required, I don't want to show the message: 'full_name' is required to the user, instead I want to show Full name is required, something like that.. Also, the idea to add the custom message to the field to match the message that I want is very dumb because I would have to add the custom message for every input in my entire application.

Please @zombieJ , consider merging this PR or provide me someway to achieve this.

Thanks

@zombieJ
Copy link
Member

zombieJ commented Feb 28, 2020

@ghmendonca #80

@crazyair
Copy link
Contributor Author

@ghmendonca #80

算了,不是我想要的,labelmessageVariables 还要写两次名称,我最后用了自动添加一条 rules
https://github.com/crazyair/father-doc-yform/blob/master/packages/yform/src/YForm/Items.tsx#L152

@ghmendonca
Copy link

@zombieJ I can work with #80 , I just need the PR to be merged

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

Successfully merging this pull request may close these issues.

3 participants