graasp / graasp-builder

Web client for the Graasp Platform
https://builder.graasp.org
GNU Affero General Public License v3.0
5 stars 6 forks source link

feat: remove uppy and use upload hooks #1295

Closed pyphilia closed 3 months ago

pyphilia commented 3 months ago

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.

Screenshot 2024-06-21 at 17 56 23 Screenshot 2024-06-21 at 17 44 32

https://github.com/graasp/graasp-builder/assets/11229627/647dd533-962d-40d5-897c-105191c0f5d8

TODO:

spaenleh commented 3 months ago

@pyphilia Does this PR also fix some of the issues highlighted in #572 ?

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud