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

chore: clarify error about children of Form.Item with name #38038

Merged
merged 9 commits into from Nov 7, 2022

Conversation

cincodenada
Copy link
Contributor

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other - Error message improvement

🔗 Related issue link

No issue directly related, but this issue is indirectly about it: #25150

💡 Background and solution

Existing message is confusingly phrased in English, and doesn't really describe the problem or how to fix it.

📝 Changelog

Language Changelog
🇺🇸 English Improve error message about multiple Form.Item children
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

This is a common error and the message as written was not very clear.

This should be more helpful pointing people in the right direction
@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2022

Referring to "render props" is confusing because the docs don't explain what that is, and it's not really a prop.
Also improve the test names for some
Missed a couple messages
@codecov
Copy link

codecov bot commented Oct 15, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (cfda132) compared to base (9cec008).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head cfda132 differs from pull request most recent head 74bc376. Consider uploading reports for the commit 74bc376 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #38038   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          444       444           
  Lines         8231      8217   -14     
  Branches      2488      2491    +3     
=========================================
- Hits          8231      8217   -14     
Impacted Files Coverage Δ
components/form/FormItem/index.tsx 100.00% <100.00%> (ø)
components/_util/wave.tsx 100.00% <0.00%> (ø)
components/locale/it_IT.tsx 100.00% <0.00%> (ø)
components/anchor/Anchor.tsx 100.00% <0.00%> (ø)
components/button/button.tsx 100.00% <0.00%> (ø)
components/mentions/index.tsx 100.00% <0.00%> (ø)
components/typography/Link.tsx 100.00% <0.00%> (ø)
components/typography/Text.tsx 100.00% <0.00%> (ø)
components/typography/Title.tsx 100.00% <0.00%> (ø)
components/anchor/AnchorLink.tsx 100.00% <0.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

warning(
false,
'Form.Item',
'A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://ant.design/components/form/#components-form-demo-complex-form-control.'
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool, I've opened a PR to add a couple links for these error messages, I'll update this PR when that is merged 👍

@cincodenada cincodenada changed the title Clarify error about children of Form.Item with name chore: clarify error about children of Form.Item with name Oct 20, 2022
@afc163 afc163 merged commit 5a61762 into ant-design:master Nov 7, 2022
elevensky pushed a commit to elevensky/ant-design that referenced this pull request Nov 12, 2022
…ign#38038)

* Clarify error about children of Form.Item with `name`

This is a common error and the message as written was not very clear.

This should be more helpful pointing people in the right direction

* Update error message in test

* Clarify more error messages

Referring to "render props" is confusing because the docs don't explain what that is, and it's not really a prop.

* Update tests for new error messages

Also improve the test names for some

* Further test message updates

Missed a couple messages

* Add short URLs

* Update test error messages

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Ell Bradshaw <joelbr@tailormed.co>
Co-authored-by: afc163 <afc163@gmail.com>
@Wxh16144 Wxh16144 mentioned this pull request Nov 14, 2022
19 tasks
elevensky pushed a commit to elevensky/ant-design that referenced this pull request Nov 22, 2022
…ign#38038)

* Clarify error about children of Form.Item with `name`

This is a common error and the message as written was not very clear.

This should be more helpful pointing people in the right direction

* Update error message in test

* Clarify more error messages

Referring to "render props" is confusing because the docs don't explain what that is, and it's not really a prop.

* Update tests for new error messages

Also improve the test names for some

* Further test message updates

Missed a couple messages

* Add short URLs

* Update test error messages

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Ell Bradshaw <joelbr@tailormed.co>
Co-authored-by: afc163 <afc163@gmail.com>
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.

None yet

2 participants