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

Fix spin delay issue if mounts with spinning=true #10727

Merged
merged 3 commits into from
Jun 8, 2018

Conversation

dreamerblue
Copy link
Contributor

@dreamerblue dreamerblue commented May 31, 2018

  • Make sure that you propose PR to right branch: bugfix for master, feature for latest active branch feature-x.x.
  • Make sure that you follow antd's code convention.
  • Run npm run lint and fix those errors before submitting in order to keep consistent code style.
  • Rebase before creating a PR to keep commit history clear.
  • Add some descriptions and refer relative issues for you PR.

Extra checklist:

if isBugFix :

  • Make sure that you add at least one unit test for the bug which you had fixed.

If a spin component mounts with spinning=true and delay (e.g. in case of rendering a component with data loading initially), it won't be delayed. This PR just fix for it.

@ant-design-bot
Copy link
Contributor

ant-design-bot commented May 31, 2018

Deploy preview for ant-design ready!

Built with commit 2ea8998

https://deploy-preview-10727--ant-design.netlify.com

@codecov
Copy link

codecov bot commented May 31, 2018

Codecov Report

Merging #10727 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10727      +/-   ##
==========================================
+ Coverage   91.52%   91.58%   +0.05%     
==========================================
  Files         194      194              
  Lines        4743     4764      +21     
  Branches     1322     1329       +7     
==========================================
+ Hits         4341     4363      +22     
+ Misses        398      397       -1     
  Partials        4        4
Impacted Files Coverage Δ
components/spin/index.tsx 79.62% <100%> (+2.07%) ⬆️
components/pagination/Pagination.tsx 100% <0%> (ø) ⬆️
components/layout/Sider.tsx 76.54% <0%> (ø) ⬆️
components/transfer/operation.tsx 100% <0%> (ø) ⬆️
components/transfer/index.tsx 87.41% <0%> (ø) ⬆️
components/list/index.tsx 97.46% <0%> (+0.09%) ⬆️
components/form/FormItem.tsx 98.62% <0%> (+0.74%) ⬆️
components/menu/SubMenu.tsx 90.9% <0%> (+0.9%) ⬆️
components/message/index.tsx 86.44% <0%> (+2.12%) ⬆️

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 0525168...2ea8998. Read the comment docs.

@yesmeck
Copy link
Member

yesmeck commented Jun 2, 2018

@dreamerblue Could you add a test case?

@dreamerblue
Copy link
Contributor Author

@yesmeck OK, I have added a test case.

@@ -56,6 +56,14 @@ export default class Spin extends React.Component<SpinProps, SpinState> {
return !!(this.props && this.props.children);
}

componentWillMount() {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use componentDidMount? Because componentWillMount will be marked as unsafe in the feature versions of react.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot to reply there. The method has been changed to "componentDidMount".

@dreamerblue
Copy link
Contributor Author

@yesmeck Thanks for your suggestion. I have changed the method and tested it again.

@yesmeck
Copy link
Member

yesmeck commented Jun 7, 2018

CI failed

@dreamerblue
Copy link
Contributor Author

@yesmeck
I am confusing about the CI build failed problem.

At previous commit e813024 I passed CI.
But at the last commit I failed with modifying just one method name.
Then I checked Travis CI build log and found that some errors were caused by other component (table/interface) I never modified. See sample log.

I really don't know why it failed. Or can you try to rebuild CI?

@yesmeck yesmeck merged commit 8e26b68 into ant-design:master Jun 8, 2018
bors bot added a commit to mozilla/delivery-console that referenced this pull request Jun 11, 2018
189: Update dependency antd to v3.6.2 r=rehandalal a=renovate[bot]

This Pull Request updates dependency [antd](https://github.com/ant-design/ant-design) from `v3.6.1` to `v3.6.2`



<details>
<summary>Release Notes</summary>

### [`v3.6.2`](https://github.com/ant-design/ant-design/releases/3.6.2)
[Compare Source](ant-design/ant-design@70ca028...3.6.2)
- 🐞 Fix the wrong status of check all checkbox in Table when data change. [#&#8203;10629](`ant-design/ant-design#10629)
- 🐞 Fix border style of Button.Group.
- 🐞 Fix file list being reversed when `beforeUpload` returns `false` in Upload component. [#&#8203;10681](`ant-design/ant-design#10681)
- 🐞 Fix overflow of cell content in Calendar. [#&#8203;10808](`ant-design/ant-design#10808) [@&#8203;Yangzhedi](https://github.com/ant-design/Yangzhedi)
- 🐞 Fix the processing color of Badge not follows the `primary-color`.
- Spin
  - 🐞 Fix custom icon does not follow the value of `size`. [#&#8203;10786](`ant-design/ant-design#10786)
  - 🐞 Fix no `delay` issue when sets `spinning` to `true` as default.[#&#8203;10727](`ant-design/ant-design#10727) [@&#8203;dreamerblue]
- TypeScript
  - 🐞 Fix Menu type definition. [#&#8203;10773](`ant-design/ant-design#10773)
  - 🐞 Fix AutoComplete type definition. [#&#8203;10745](`ant-design/ant-design#10745) [#&#8203;10619](`ant-design/ant-design#10619)
  - 🐞 Fix Tree type definition. [#&#8203;10841](`ant-design/ant-design#10841) [@&#8203;Voronar]
  - 🐞 Fix Checkbox.Group definition. [#&#8203;10677](`ant-design/ant-design#10677)


---


- 🐞 修复 Table 数据变化时全选勾选框状态显示不正确的问题。[#&#8203;10629](`ant-design/ant-design#10629)
- 🐞 修复 Button.Group 中使用 disabled 按钮时缺失边框。
- 🐞 修复 Upload 中 `beforeUpload` 返回 `false` 时,文件列表排序会被反转的问题。[#&#8203;10681](`ant-design/ant-design#10681)
- 🐞 修复 Calendar 表格中内容溢出的问题。[#&#8203;10808](`ant-design/ant-design#10808) [@&#8203;Yangzhedi](https://github.com/ant-design/Yangzhedi)
- Spin
  - 🐞 修复使用图标时不能按照 `size` 正确显示大小的问题。[#&#8203;10786](`ant-design/ant-design#10786)
  - 🐞 修复默认旋转时 `delay` 不生效的问题。[#&#8203;10727](`ant-design/ant-design#10727) [@&#8203;dreamerblue]
- 修复 Badge 的状态色不跟主题色变化的问题。
- TypeScript
  - 🐞 修复 Menu 类型定义。[#&#8203;10773](`ant-design/ant-design#10773)
  - 🐞 修复 AutoComplete 类型定义。[#&#8203;10745](`ant-design/ant-design#10745) [#&#8203;10619](`ant-design/ant-design#10619)
  - 🐞 修复 Tree 类型定义。[#&#8203;10841](`ant-design/ant-design#10841) [@&#8203;Voronar]
  - 🐞 修复 Checkbox.Group 的类型定义。[#&#8203;10677](`ant-design/ant-design#10677)

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).

Co-authored-by: Renovate Bot <bot@renovateapp.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

3 participants