Core and Modules
- drupal 8.4.0
- media_entity: 8.x-1.6+11-dev
- entity_browser: 8.x-1.3
- dropzonejs_eb_widget: 8.x-1.0-alpha8
Field:
- Entity Reference: Media Entity (Images)
Field widget:
- Entity Browser
- Entity display plugin: Rendered entity
- Display Remove button: Check
- Show widget details as open by default: Check
- Selection mode: Append to selection
Entity Browser:
- Display Plugin: iFrame
- Widget selector plugin: Tabs
- Selection display plugin: No selection display
- Widget plugin 1: Media Entity DropzoneJS
- Widget plugin 2: View
The problem:
As a second step, after adding some images to the dropzoneJS (selecting) the button must be clicked to upload the pictures. And this can take some time... And the upload button is not showing a throbber. If so, this wouldn't be a problem. But without, the normal user doesn't know exactly what's going on and whether the upload is done or not (many or large images). So the chance is high that the user clicks on.
Question:
Can we add a throbber to this upload button?
Pending technical debts:
- Currently, the ajax command libraries are loaded inside
WidgetBase
. I believe they should be loaded as part ofDisplayBase
, or somewhere else in the stack. Similarly, I found that the current ajax submit callback can be easily removed, or can be moved to somewhere else in the stack.
Pending work:
It works if you have selected an existingmedia
entity, but breaks when a new entity is selected.Implement progress status callback.
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff-9-12.txt | 678 bytes | subhojit777 |
#12 | 2921274-12.patch | 12.71 KB | subhojit777 |
#9 | interdiff-8-9.txt | 0 bytes | subhojit777 |
#9 | 2921274-9.patch | 12.65 KB | subhojit777 |
#6 | interdiff-5-6.txt | 487 bytes | subhojit777 |
Comments
Comment #2
sistocarta CreditAttribution: sistocarta commentedI have the same problem.
Drupal Core 8.4.0.
is there a solution?
Comment #3
subhojit777I am using
Modal
as display, andAcquia DAM
as widget plugin. I too want this feature.I was partially able to fix it by adding an ajax callback inside the form builder
getForm()
. The idea is to make use of the ajax throbber and the wait message "Please wait..." and make the end user understand that a process is in progress.the problem is it does not closes the modal. I am figuring out if there is a better way to do this.
Comment #4
subhojit777I have managed to show a progress bar when the form is submitted.
Comment #5
subhojit777I managed to find the reason. The patch is fine. I was
echo
-ing the time it takes for fetching the resource from the external service (WebDAM), and the output was getting appended to the `JSONResponse` and it was messing the whole thing.Comment #6
subhojit777Decided to move the
progress
type to custom widget.Comment #7
subhojit777The progress type can be modified like this #3005892-2: Show infinite progress bar during asset download
Comment #8
subhojit777Comment #9
subhojit777I have used the ajax callback to show status messages in the form. This implementation can be improved.
Comment #10
subhojit777Comment #11
subhojit777Making sure that
IFrame
display does not override passedAjaxResponse
.Comment #12
subhojit777