Skip to content

feat(Upload): redesign upload components #6049

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

Open
wants to merge 157 commits into
base: main
Choose a base branch
from
Open

feat(Upload): redesign upload components #6049

wants to merge 157 commits into from

Conversation

ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented May 18, 2025

Link issues

fixes #5981

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ 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
  • Merge the latest code from the main branch

Summary by Sourcery

Redesign all upload components on a unified base to streamline multi-file and directory uploads, progress and lifecycle callbacks, default file presets, and customizable file icons, while cleaning up obsolete APIs, improving styling, and updating demos and CI configuration.

New Features:

  • Support uploading entire directories via a new IsDirectory parameter
  • Enable multi-file uploads with IsMultiple and MaxFileCount, deprecating IsSingle/Max
  • Allow preset file lists through DefaultFileList and a global OnAllFileUploaded callback
  • Optionally show upload progress per file with ShowProgress and progress update callbacks
  • Expose download and cancel operations per file via OnDownload, OnCancel, and ShowDownloadButton
  • Add custom file format icon support via OnGetFileFormat
  • Extend InputUpload, ButtonUpload, AvatarUpload, CardUpload, and DropUpload to use a unified UploadBase with new capabilities

Enhancements:

  • Refactor all upload components to inherit from a single UploadBase, removing duplicate base classes
  • Deprecate old IsSingle/Max parameters in favor of IsMultiple/MaxFileCount
  • Reorganize CSS/SCSS variables and class builders for consistent styling and layout
  • Improve UploadFile extensions to detect image formats, base64 URLs, and allowed extensions
  • Clean up obsolete code and consolidate parameter handling across ButtonUpload, AvatarUpload, CardUpload, InputUpload, and DropUpload
  • Update sample/demo pages and menu entries to showcase redesigned upload components

CI:

  • Fix test project name in build workflow from UnitTestLocalization to UnitTest.Localization

Copy link

codecov bot commented May 24, 2025

Codecov Report

Attention: Patch coverage is 99.53596% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.99%. Comparing base (4ad4ea4) to head (01ce5c9).

Files with missing lines Patch % Lines
...trapBlazor/Components/Upload/AvatarUpload.razor.cs 97.43% 0 Missing and 1 partial ⚠️
...lazor/Components/Upload/UploadPreviewList.razor.cs 98.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main    #6049      +/-   ##
===========================================
- Coverage   100.00%   99.99%   -0.01%     
===========================================
  Files          703      704       +1     
  Lines        31019    30979      -40     
  Branches      4386     4380       -6     
===========================================
- Hits         31019    30977      -42     
- Partials         0        2       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(DropUpload): 是不是可以安排拖拽上传 支持 IsMultiple 和 IsDirectory
1 participant