Repository navigation
[dtq-dev-93] Check the upload size in the browser and refresh sponsor and author subfields after a pick - #1762
Open
milanmajchrak wants to merge 2 commits into
Open
milanmajchrak wants to merge 2 commits into
milanmajchrak wants to merge 2 commits into
Conversation
The uploader reads spring.servlet.multipart.max-file-size and refuses a bigger file before it is sent. Auto upload waits for the limit. Ported from dtq-dev; units like MB are now read correctly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The autocomplete marks a picked suggestion, which fills one subfield with the whole value. Once the server returns that row saved, the form is rebuilt so each subfield shows its own part, as on dtq-dev. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
References
Ports these dtq-dev changes:
Upstream DSpace has no merged size check. An open upstream PR "Reject files above the upload size limit before sending any data" reads the limit from the upload section config instead.
Description
The uploader refuses a file over the server's upload limit before sending it. After a picked funding or author suggestion, the form is rebuilt from the saved value, so every subfield shows its own part.
Instructions for Reviewers
List of changes in this PR:
UploaderComponentreadsspring.servlet.multipart.max-file-sizeand sets it as the ng2-file-uploadmaxFileSize. A bigger file is not queued, andonUploadErrorgets the existing size-limit message, whichSubmissionUploadFilesComponentalready shows.4GB,512MB, a bare number is bytes,-1is no limit). The dtq-dev code read every value as GB.suggestionPicked.SubmissionSectionFormComponentremembers the pick and its row, and rebuilds the form when the server returns that row saved. Typed text never rebuilds the form. Contact and size have no suggestions, so there is nothing to fill in from the server. dtq-dev also rebuilds only for sponsor and author.uploader.component.spec.ts,section-form.component.spec.tsandds-dynamic-autocomplete.component.spec.ts. Each one that covers a fix fails without it.How to test:
spring.servlet.multipart.max-file-size = 1MBin the backendlocal.cfgand restart it.Smith, Jr.as the last name andJohnas the first name. The form is not rebuilt and nothing you type is lost.npm run test -- --include=src/app/shared/upload/uploader/uploader.component.spec.ts --include=src/app/submission/sections/form/section-form.component.spec.ts --include=src/app/shared/form/builder/ds-dynamic-form-ui/models/autocomplete/ds-dynamic-autocomplete.component.spec.tsCodex review (gpt-6.2-sol, high), 3 rounds: 4 findings fixed (a typed comma looked like a pick, the same value in another row confirmed a pick, two ways a file was sent before the limit was known). The last round found 4, not changed in this PR:
0is not applied in the browser.Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.🤖 Generated with Claude Code