Commit graph

7 commits

Author SHA1 Message Date
Pierre de La Morinerie
55788990da javascript: add a helpful message on connectivity error 2020-04-16 11:20:45 +02:00
Pierre de La Morinerie
432967bd76 javascript: make Uploader always throw the same kind of errors
A DirectUpload may fail for several reasons, and return many types of
errors (string, xhr response, Error objects, etc).

For convenience, wrap all these errors in a FileUploadError object.

- It makes easier for clients of the Uploader class to handle errors;
- It allows to propagate the error code and failure responsability.
2020-04-16 11:20:45 +02:00
Pierre de La Morinerie
d8f3b86b0e javascript: move auto-upload attachment to the Uploader class
Rationale:

- It makes more sense to handle the progress bar updates in a single class;
- This will allow us to unify the error handling.
2020-04-16 11:20:45 +02:00
Pierre de La Morinerie
444732b117 javascript: don't allow to retry on direct upload 422
When the authenticity token is invalid, the creation of the blob before
the direct upload returns a 422.

In that case, the token will never become valid again, and it is useless
to try again. Don’t show the "Retry" button in this case.

NB: of course the real fix is to understand why the authenticity token
is so often invalid – but this will be for later.
2020-04-08 15:48:23 +02:00
Pierre de La Morinerie
c506402dcb dossier: remove the now unused champId in auto-upload 2020-04-06 11:50:31 +02:00
Pierre de La Morinerie
91260e2867 dossier: fix upload route of piece_justificative in repetitions
In repetitions, `form.index` doesn't make much sense. Turns out we
don't really need the index of the champ: we can just use the champ id.
2020-04-06 11:50:31 +02:00
Pierre de La Morinerie
6417c0d2c0 dossiers: allow auto upload of attachments 2020-03-31 13:09:44 +02:00