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: add warning of tip with spin #42293

Merged
merged 1 commit into from
May 12, 2023
Merged

chore: add warning of tip with spin #42293

merged 1 commit into from
May 12, 2023

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented May 11, 2023

[中文版模板 / 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
  • Workflow
  • Other (about what?)

🔗 Related issue link

close #42291

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Spin add warning if use tip when not in nest pattern.
🇨🇳 Chinese Spin 添加在非嵌套下使用 tip 的警告提示。

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

🚀 Summary

🤖 Generated by Copilot at c77da62

Improved the tip prop validation and testing for the Spin component. Refactored the imports in components/spin files.

🔍 Walkthrough

🤖 Generated by Copilot at c77da62

  • Reorder imports in components/spin/__tests__/index.test.tsx and components/spin/index.tsx to follow convention and group React imports (link, link)
  • Add warning function to components/spin/index.tsx to log a warning when tip prop is used without a nested element (link)
  • Add condition to components/spin/index.tsx to render tip only when tip prop is present and component has a nested element (link)
  • Add test case to components/spin/__tests__/index.test.tsx to check warning and tip rendering logic (link)

@github-actions
Copy link
Contributor

github-actions bot commented May 11, 2023

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
./dist/antd.min.js 376.44 KB (+6 B 🔺)
./dist/antd-with-locales.min.js 435.7 KB (+7 B 🔺)

@li-jia-nan
Copy link
Member

cov 机器人又不 work 了

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (4207b71) 100.00% compared to head (c77da62) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #42293   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          619       619           
  Lines        10548     10550    +2     
  Branches      2881      2883    +2     
=========================================
+ Hits         10548     10550    +2     
Impacted Files Coverage Δ
components/spin/index.tsx 100.00% <100.00%> (ø)

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

@li-jia-nan
Copy link
Member

打脸了……刚说完就有了

@zombieJ zombieJ merged commit 31852e1 into master May 12, 2023
95 checks passed
@zombieJ zombieJ deleted the spin-warn branch May 12, 2023 01:51
@CherryNo1
Copy link

为什么我升级到5.5.1还是有这个错误

@jin-benben
Copy link
Contributor

为什么我升级到5.5.1还是有这个错误

5.6.3依然有

@wanpan11
Copy link
Contributor

wanpan11 commented Jul 18, 2023

为什么我升级到5.5.1还是有这个错误

5.6.3依然有

现在需要 将 tip 写在 children 里才能正常工作
image

否则会报错 v5.7.0
image

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.

Spin组件的tip在5.4.7中无效
5 participants