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 image url display with non-image extention in Upload #9936

Merged
merged 1 commit into from Apr 4, 2018

Conversation

Projects
None yet
3 participants
@afc163
Member

afc163 commented Apr 4, 2018

Improve the image-judgement behavior in #9621 cc @zswang .

Now we need to use file.isNotImage to indicate the non-image files in uploadList.

close #9835

close #9681

@ant-design-bot

This comment has been minimized.

ant-design-bot commented Apr 4, 2018

Deploy preview for stupefied-hodgkin-56a61d ready!

Built with commit d9fe8ca

https://deploy-preview-9936--stupefied-hodgkin-56a61d.netlify.com

@afc163

This comment has been minimized.

Member

afc163 commented Apr 4, 2018

Awesome deploy preview!

Fix image url display with non-image extention in Upload
now we treat url following below rules:

1. `data:image..` => image
2. `http://xxx.com/xxxx.(webp|svg|png|gif|jpg|jpeg)` => image
3. `http://xxx.com/xxx.zip` other extensions => non-image
4. `data:application..` other minetypes in base64 text => non-image
5. `http://xxx.com/xxx` without any extensions => image

close #9835

close #9681

ref #9621

@afc163 afc163 force-pushed the fix-upload-picture-style branch from 92d3303 to d9fe8ca Apr 4, 2018

@afc163

This comment has been minimized.

Member

afc163 commented Apr 4, 2018

@yesmeck Is the deploy/netlify can detect deploy status of site? Maybe we can remove npm run site in travis.yml which is too slow.

@afc163 afc163 referenced this pull request Apr 4, 2018

Closed

upload component need notice or doc #9835

1 of 1 task complete
@yesmeck

This comment has been minimized.

Member

yesmeck commented Apr 4, 2018

Yes, netlify will send notification if deploy fails.

@codecov

This comment has been minimized.

codecov bot commented Apr 4, 2018

Codecov Report

Merging #9936 into master will increase coverage by 0.01%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9936      +/-   ##
==========================================
+ Coverage   86.27%   86.29%   +0.01%     
==========================================
  Files         197      197              
  Lines        4722     4734      +12     
  Branches     1316     1320       +4     
==========================================
+ Hits         4074     4085      +11     
- Misses        645      646       +1     
  Partials        3        3
Impacted Files Coverage Δ
components/upload/UploadList.tsx 88.54% <93.75%> (+0.44%) ⬆️

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 1612ef6...d9fe8ca. Read the comment docs.

@afc163 afc163 merged commit a9376ef into master Apr 4, 2018

6 checks passed

codecov/patch 93.75% of diff hit (target 86.27%)
Details
codecov/project 86.29% (+0.01%) compared to 1612ef6
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
security/snyk No dependency changes
Details

@afc163 afc163 deleted the fix-upload-picture-style branch Apr 4, 2018

@afc163 afc163 referenced this pull request Apr 8, 2018

Merged

Compatible with non-image format file preview in UploadList #9621

3 of 3 tasks complete

zheeeng added a commit to zheeeng/ant-design that referenced this pull request Apr 12, 2018

Fix image url display with non-image extention in Upload (ant-design#…
…9936)

now we treat url following below rules:

1. `data:image..` => image
2. `http://xxx.com/xxxx.(webp|svg|png|gif|jpg|jpeg)` => image
3. `http://xxx.com/xxx.zip` other extensions => non-image
4. `data:application..` other minetypes in base64 text => non-image
5. `http://xxx.com/xxx` without any extensions => image

close ant-design#9835

close ant-design#9681

ref ant-design#9621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment