Show the uploaded file name in submission upload notifications - #6057
Open
milanmajchrak wants to merge 1 commit into
Open
Show the uploaded file name in submission upload notifications#6057milanmajchrak wants to merge 1 commit into
milanmajchrak wants to merge 1 commit into
Conversation
Dropping several files into a submission produced identical "Upload successful" toasts, so a single failure inside a batch was impossible to attribute. Each notification now names the file it refers to, falling back to the existing generic messages when no client-side name is available. The uploader gains an additive `onCompleteItemWithFile` output carrying the parsed response together with the file name. The existing `onCompleteItem` is retained and still emits the bare response first, so the other consumers of `ds-uploader` are unaffected. `onUploadError` is retyped from `any` to the existing `UploaderError`, and a single `getNotificationContent()` helper is now the only place an upload notification key appears. Locales that have not translated the two new keys render the generic message via the `default` interpolate param that MissingTranslationHelper already honours, rather than a raw dotted key. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
@milanmajchrak thanks for submitting this improvement to usability! |
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.
Description
Drop three files into a submission and you get three identical "Upload successful" toasts. If one of them fails, there's no way to tell which. This makes each notification name its file. When we don't have a name to show, you get the old generic message, same as before.
Instructions for Reviewers
What changed:
ds-uploadergets a second output,onCompleteItemWithFile, carrying{ response, fileName? }. The oldonCompleteItemstill fires first and still emits the bare response, so the three other places using the uploader don't notice anything.onUploadErroris typed asUploaderErrornow instead ofany, and the upload notification keys all moved into one smallgetNotificationContent()helper.en.json5. Locales that don't have them yet fall back to the generic message instead of printing a rawsubmission.sections.upload.*key — that's what thedefaultinterpolate param is doing.To try it: drop two or three files into the Upload section and check each toast names the right one. For the size-limit path you need
dspace.upload.maxconfigured, otherwise the feature is simply off and the test tells you nothing.Before, both files give you the same message:
After:
Checklist
main— no, this one is a backport ontodtq-dev.role="alert"region and the same escaped rendering path, only the text differs. I haven't put a screen reader on it.Written with some help from Claude Code.