This PR removes the use of uppy everywhere. We now use real mutations to upload files for:
item thumbnail: I didn't change the layout
h5p: a button
zip: a button
files: file drop zone
My implementation is a mixed of showing upload progress within the drop zone and toaster. The reason is that we sometimes clear the dropzone before the complete upload is finished. Here are the 3 ways we can upload files:
from the dropzone in the screen (when the folder is empty): use toast because the view is updated at the first item upload (websockets).
from new item modal: the loading is show in the dropzone, and the modal closes when it finishes
drop in a folder that already contains items: the dropzone disappear immediately, so the loading and errors happens in toastr.
A bug I've noticed is that the backend actually cannot handle multiple files upload (it gets stuck and never return for more than 1 file). Uploading one file is okay, and was actually working with uppy because uppy was sending one file at a time! So I faked this behavior by sending one request per file.
Something that could considered a glitch is "showing n notifications when uploading n files". This is because the notifications are triggered by query client. Personally I think it is okay, but let me know what you think.
This PR removes the use of uppy everywhere. We now use real mutations to upload files for:
My implementation is a mixed of showing upload progress within the drop zone and toaster. The reason is that we sometimes clear the dropzone before the complete upload is finished. Here are the 3 ways we can upload files:
A bug I've noticed is that the backend actually cannot handle multiple files upload (it gets stuck and never return for more than 1 file). Uploading one file is okay, and was actually working with uppy because uppy was sending one file at a time! So I faked this behavior by sending one request per file. Something that could considered a glitch is "showing n notifications when uploading n files". This is because the notifications are triggered by query client. Personally I think it is okay, but let me know what you think.
https://github.com/graasp/graasp-builder/assets/11229627/647dd533-962d-40d5-897c-105191c0f5d8
TODO: