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: 4.x gif thumb url base64 type should be corrected #44129

Merged
merged 5 commits into from Aug 16, 2023

Conversation

linxianxi
Copy link
Contributor

@linxianxi linxianxi commented Aug 9, 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

#44083 这个 pr 修复到 4.x

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix the bug that Upload gif thumbnail will not play
🇨🇳 Chinese 修复 Upload gif 缩略图不会动的问题

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

This pull request fixes some issues and adds some features related to the upload component. It prevents errors and memory leaks from object URLs in tests, adds a test case for gif preview, and improves the fileToObject function to handle gif files and release object URLs.

🔍 Walkthrough

🤖 Generated by Copilot at 55d5318

  • Add and restore mock for window.URL.revokeObjectURL in tests to avoid jsdom errors (link, link)
  • Add parentheses around arrow function parameters for consistency and readability (link, link, link, link, link, link, link, link, link, link, link)
  • Release object URL after converting canvas to data URL in fileToObjectUrl to avoid memory leaks (link)
  • Handle gif file type in fileToObjectUrl by reading data URL directly without canvas (link)
  • Add test case for uploading gif file and previewing in base64 format (link)

@stackblitz
Copy link

stackblitz bot commented Aug 9, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

@argos-ci
Copy link

argos-ci bot commented Aug 9, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 63 changes Aug 9, 2023, 9:03 AM

@linxianxi linxianxi marked this pull request as draft August 9, 2023 07:54
@linxianxi linxianxi marked this pull request as ready for review August 9, 2023 08:47
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (7251397) 100.00% compared to head (aed0bcd) 100.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##           4.x-stable    #44129   +/-   ##
============================================
  Coverage      100.00%   100.00%           
============================================
  Files             450       450           
  Lines            8345      8351    +6     
  Branches         2540      2542    +2     
============================================
+ Hits             8345      8351    +6     
Files Changed Coverage Δ
components/upload/utils.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -303,7 +303,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
</thead>
<tbody>
<tr
class="ant-picker-week-panel-row ant-picker-week-panel-row-selected"
class="ant-picker-week-panel-row"
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.

react-component/picker#664 貌似是这个,修复了 4.x 的

Copy link
Member

Choose a reason for hiding this comment

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

@zombieJ 看看是否是预期行为。

Copy link
Member

Choose a reason for hiding this comment

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

嗯,预期的。rc-picker patch 也是从 v5 里 pick 的

@zombieJ zombieJ merged commit a556f1f into ant-design:4.x-stable Aug 16, 2023
53 checks passed
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