[WC-3361] FileUploader: enhance limits and feedback#2208
Draft
yordan-st wants to merge 6 commits into
Draft
Conversation
430b80b to
4d8b53f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
When the file upload limit was reached, the dropzone silently turned grey with no explanation to the user. This fix adds a
warningMessagecomputed property toFileUploaderStorethat reactively surfaces a "Maximum file count of X reached." message as soon as the limit is hit, without requiring the user to attempt another drop. The XML property description was also corrected, and it is now optional so that leaving it empty or setting it to 0 means unlimited.A new "Maximum files per upload batch" property was added to protect server memory (Java heap) when uploading large numbers of files. Files that exceed the batch limit appear in the list with an error message explaining why they were not uploaded.
maxFilesPerUpload— fixedrequired="false"added;0and empty both mean unlimited (default)What should be covered while testing?
Setup: File Uploader, "Maximum number of files" = 2, files mode.
File limit feedback:
Unlimited behavior:
6. Set limit = 0 → dropzone never disables regardless of file count
7. Leave limit empty → same as 0, unlimited, dropzone never disables
Batch limit:
8. Set "Maximum files per upload batch" = 2, drop 4 files at once → first 2 upload successfully, last 2 appear in list with error: "File not uploaded. Batch limit of 2 files per drop was reached."
9. Leave "Maximum files per upload batch" empty → all dropped files upload regardless of count
Other:
10. Drop 3 files at once with total limit = 2 (no batch limit set) → batch rejected with "too many files" message
11. Read-only mode → dropzone not rendered, no regression
12. Image upload mode → same limit-reached behavior applies