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: support thumbnail for non-image files by upload onChange #25432

Merged

Conversation

AlbertAZ1992
Copy link
Contributor

@AlbertAZ1992 AlbertAZ1992 commented Jul 4, 2020

[中文版模板 / 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
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

close #25401

💡 Background and solution

isImageUrl call isImageFileType to check file.type first when file was uploaded manually.
so if file.thumbUrl was configured, skip that check.

📝 Changelog

Language Changelog
🇺🇸 English Upload supports to show thumbnail for non-image files as thumbUrl configured in onChange event
🇨🇳 Chinese Upload 支持上传非图片文件时在 onChange 事件中设置 thumbUrl 来展示缩略图

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • 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

@AlbertAZ1992 AlbertAZ1992 changed the title feat: show thumbnail for non-image files by upload onChange feat: support thumbnail for non-image files by upload onChange Jul 4, 2020
@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jul 4, 2020

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jul 4, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 4, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ff245e6:

Sandbox Source
antd reproduction template Configuration

@AlbertAZ1992 AlbertAZ1992 force-pushed the feat-show-thumbnail-upload-onchange branch from e7d6c1c to 686ab31 Compare Jul 5, 2020
@codecov
Copy link

codecov bot commented Jul 5, 2020

Codecov Report

Merging #25432 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #25432   +/-   ##
=======================================
  Coverage   99.51%   99.51%           
=======================================
  Files         368      368           
  Lines        7204     7204           
  Branches     2009     1962   -47     
=======================================
  Hits         7169     7169           
  Misses         35       35           
Impacted Files Coverage Δ
components/upload/utils.tsx 100.00% <100.00%> (ø)

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 b06e256...ff245e6. Read the comment docs.

@JadeLiuYC
Copy link

JadeLiuYC commented Jul 6, 2020

目前使用upload 组件报这个警告,需要怎么操作? [antd: Progress] successPercent is deprecated. Please use success instead

</div>
</div>
</span>
</div>
Copy link
Member

@afc163 afc163 Jul 6, 2020

Choose a reason for hiding this comment

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

不用修改 demo,补充到 test case 里去。

@afc163
Copy link
Member

afc163 commented Jul 6, 2020

可以发到 master,作为一个 修复

@AlbertAZ1992
Copy link
Contributor Author

AlbertAZ1992 commented Jul 6, 2020

可以发到 master,作为一个 修复

好的,稍等我改下

@AlbertAZ1992 AlbertAZ1992 force-pushed the feat-show-thumbnail-upload-onchange branch from f3c4a0d to ff245e6 Compare Jul 6, 2020
@AlbertAZ1992 AlbertAZ1992 changed the base branch from feature to master Jul 6, 2020
@AlbertAZ1992 AlbertAZ1992 changed the title feat: support thumbnail for non-image files by upload onChange fix: support thumbnail for non-image files by upload onChange Jul 6, 2020
@AlbertAZ1992
Copy link
Contributor Author

AlbertAZ1992 commented Jul 6, 2020

可以发到 master,作为一个 修复

done

@afc163 afc163 merged commit 6f2aa5a into ant-design:master Jul 6, 2020
26 checks passed
@zombieJ zombieJ mentioned this pull request Jul 11, 2020
13 tasks
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.

4 participants