-
Notifications
You must be signed in to change notification settings - Fork 60
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
Media dropzone improvements (Batch upload, Upload sorting, Folder upload, Progress notification) #2258
Conversation
const notification = { data: { message: `Created` } }; | ||
this.#notificationContext!.peek('positive', notification); | ||
// const notification = { data: { message: `Created` } }; | ||
// this.#notificationContext!.peek('positive', notification); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like some sparing on what HQ finds would be the best way to handle this. I've disabled the notification here because when uploading many files the right hand side of the screen just becomes a green wall of Created
messages. I think the best way for the drag and drop feature is to not have any Created
messages at all and only the progress and failure notification messages show up but is it feasible to move the notification from here closer to the places we would like to show it I can see this method has many references.
@@ -48,12 +49,29 @@ export class UmbMediaCollectionElement extends UmbCollectionDefaultElement { | |||
this._progress = event.progress; | |||
} | |||
|
|||
#refreshCollection() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid over updating the UI this has been added to we don't update the UI more than every 350ms
|
||
@customElement('umb-dropzone') | ||
export class UmbDropzoneElement extends UmbLitElement { | ||
@property({ attribute: false }) | ||
parentUnique: string | null = null; | ||
|
||
@property({ type: Boolean }) | ||
multiple: boolean = true; | ||
multiple: boolean = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my testing it is not possible to make a boolean property false
if it's by default true
therefore the default for multiple
has to be false
which also makes more sense when looking at the usage: <umb-dropzone multiple></umb-dropzone>
I've updated the current usages accordingly
Quality Gate passedIssues Measures |
Hi @nikcio Thanks for what seems like a well-thought-out pull request. It looks like you were trying to fix some issues which then turned into more bug fixes and even new features, great! I would like to highlight that our contribution guidelines state that we prefer new features to be discussed first to optimize the chances of them getting merged and also to divide multiple bug fixes up into smaller pull requests to make them easier to review. All that being said, we really like the proposed changes here and we would like to consider this pull request for the upcoming V15 release of Umbraco. The first RC of V15 will be released at the beginning of October, and we need to get 14.3 out of the way first, but following that, we'll start the review of your contributions in this PR. I will let this PR stay open until then. Thanks again and #h5yr |
Hey @nikcio We have been reviewing your PR and we have some comments: Progress notification: Fixed issues: This PR: Thank you for your contribution! #H5YR |
Hi @loivsen No worries. Let me know if I can do anything to help out. Just a note about 16559: The changes in this PR both reintroduce and fix this issue. It implements batching which reintroduces this issue into v14 and then subsequently fixes the issue by sorting the items after upload. 😉 |
Description
.mp3
Types of changes
Motivation and context
This aims to solve some of the problems and shortcomings of the drag-and-drop functionality in the Media library
How to test?
Usage of the media drag and drop feature. As well as other usages of the
umb-dropzone
component. This can also be found in the media type import and document type import but see the "Still present bugs" section first.Screenshots (if appropriate)
Multiple media types available for uploaded files:
Info view of files for selection (Can be shown by pressing the info icon)
Progress notification (Auto updates with progress)
Completed progress notification
Videos
Notice that in these videos I have a custom Media type that applies to the images I upload which means I get the popup every time.
To create a media type for this follow these steps:
umbracoFile
jpg
or any other required image file type toAccepted file extensions
Video 1 - Normal uploads
Umbraco.Google.Chrome.2024-09-06.22-47-36.mp4
Video 2 - Folder uploads
Umbraco.Google.Chrome.2024-09-06.22-48-02.mp4
Video 3 - Upload as Custom media type
Umbraco.Google.Chrome.2024-09-06.22-49-58.mp4
Checklist
Still present bugs
Unable to drag and drop files produced by Umbraco due to missing MIME type
In the Import media type / document type feature there is no error handling if you drag and drop for example a picture in the dropzone but that is outside the scope of this PR to fix.
You are unable to dismiss any notification when having a folder open.
SQL database table locked
Stacktrace from this: