Commit graph

5559 commits

Author SHA1 Message Date
Pierre de La Morinerie
c9820adbc4 urls: fix link to autosave FAQ article 2020-05-18 16:53:19 +02:00
Pierre de La Morinerie
9f1407b6d7 expiration: fix the mailer arguments
The mailers expect serializable arguments, but were given
ActiveRecord::Relation objects instead. This made the mailers throw an
exception.

But how was that possible ? This code is tested, and the tests were
green.

Well, the specs spy on the mailer implementation, in order to check that
the mailers methods were properly called. Fair enough.

But if the specs mock the mailer code (instead of calling the original
implementation), we may not notice that the original implementation
rejects our method parameters.

Here this is the case: once we actually call the original implementation
the tests start to fail, because some arguments are not converted from
an ActiveRecord::Relation to a serializable array.

This is fixed by ensuring that the mailer code is executed (and doesn't
throw an exception).
2020-05-18 16:24:08 +02:00
Christophe Robillard
d4bb5d1f56 indique à l'usager les pièces ajoutées au dossier
- attestation sociale
- attestation fiscale
- bilans bdf
2020-05-18 16:01:13 +02:00
Pierre de La Morinerie
b63fa0e6b8 dossier: remove "Birthdate" column from export 2020-05-18 13:14:28 +00:00
clemkeirua
77101208a4 Anonymisation de l'instructeur dans la messagerie 2020-05-18 12:56:30 +00:00
clemkeirua
8542fd9f47 unique emails + remove n+1 2020-05-18 12:46:42 +00:00
clemkeirua
22a518c921 ajout d'un bouton d'export des mails des demandeurs 2020-05-18 12:46:42 +00:00
clemkeirua
9454017dd9 afficher le nom du service en alt si possible 2020-05-18 14:17:21 +02:00
Pierre de La Morinerie
833d7a3b59 javascript: ignore most common upload errors also in standard uploads
In #5149, we ignored most common upload errors, but only for
auto-uploads.

This PR ignores those errors also for standard uploads.
2020-05-18 11:50:29 +02:00
kara Diaby
db5fd9bd0f fix bug on mandatory carto champ for the new map editor 2020-05-15 13:44:50 +02:00
Pierre de La Morinerie
93bb5283ff app: remove the feature flag for pieces justificatives auto-upload
The feature works as intended: we can remove the feature flag.
2020-05-14 17:39:07 +02:00
clemkeirua
a49581cbe9 replaced marianne logo for homepage 2020-05-14 14:08:05 +00:00
clemkeirua
46940ec2a7 compression du nouveau logo via svgo 2020-05-14 14:08:05 +00:00
clemkeirua
1702903ffd ajout d'une alternative sur la marianne en header 2020-05-14 14:08:05 +00:00
clemkeirua
c5d2b4abd8 new logo in footer on home 2020-05-14 14:08:05 +00:00
clemkeirua
3c751ac696 small logo for procedures 2020-05-14 14:08:05 +00:00
clemkeirua
f6ef7944c1 add new logo 2020-05-14 14:08:05 +00:00
Paul Chavard
d44df9cc2a Fix map apercu 2020-05-14 14:28:54 +02:00
Pierre de La Morinerie
bbc0aa5465 javascript: remove debug code for FileReader errors 2020-05-14 13:29:54 +02:00
Pierre de La Morinerie
86357b65f0 javascript: ignore most common upload errors 2020-05-14 13:29:54 +02:00
Pierre de La Morinerie
4b288038d3 javascript: human-readable message for reading errors during upload 2020-05-14 13:29:54 +02:00
Paul Chavard
03075afa5b Update javascript dependencies 2020-05-14 13:21:42 +02:00
clemkeirua
236fd0291b bump zip sizes from 50 to 100 mb 2020-05-14 10:37:01 +00:00
Pierre de La Morinerie
190548844a dossiers: add piece justificative filename to spreadsheet export 2020-05-14 10:18:10 +00:00
clemkeirua
84888be255 clarification de l'archivage/suppression 2020-05-13 16:45:27 +02:00
Paul Chavard
f0148184ca Remove legacy carto code 2020-05-13 12:17:04 +02:00
Pierre de La Morinerie
51cb3a04a3 app: fix JS redirection with Turbolinks disabled
When Turbolinks is enabled, a `redirect_to` in a `format: :js` request
will emit code that instructs Turbolinks to navigate to the page.
Turbolinks will then load the redirection target as HTML, and display
it.

But with Turbolinks disabled, the same `redirect_to` will instead
respond with a standard `302: redirect`. `Rails.ajax` will interpret
this redirect as "Please perform the same call again to the redirected
URL, in the same format" – and request our redirection target, but
using `format: :js`.


This breaks the "Publish procedure" button. In that case, we really want
the page to be navigated to. Add an explicit JS redirect, so that the
redirection occurs in HTML.
2020-05-13 11:04:16 +02:00
Pierre de La Morinerie
b5f1d97629 app: disable Turbolinks
Fix #5039
2020-05-13 11:04:16 +02:00
Paul Chavard
dfc004d7bb Unarchive dossier when repasser_en_instruction 2020-05-12 19:05:18 +02:00
Paul Chavard
43a1ead1cb fix new prettier defaults 2020-05-12 18:18:37 +02:00
kara Diaby
474521c841 Adapt style for Map reader (point, line) 2020-05-12 17:47:28 +02:00
Pierre de La Morinerie
82cf9e26e1 app: remove tooltips on the old design
- Tooltips are no longer used anywhere
- They cause an error on app initialisation

Fixes "TypeError: dataAttributes.hasOwnProperty is not a function" error
that we've been seeing recently on Sentry.
2020-05-11 17:26:29 +02:00
Christophe Robillard
aab4bb81ee return bilan bdf csv for expert 2020-05-11 13:05:50 +02:00
Christophe Robillard
cad8245540 fix bilans bdf link 2020-05-11 13:05:50 +02:00
kara Diaby
1cc04092f4 import GPX file in browser [Carto] 2020-05-11 11:36:36 +02:00
Paul Chavard
4f2e504cc2 Add carto import api
takes a FeatureCollection to import and returns an augmented champ FeatureCollection
2020-05-07 12:06:42 +02:00
Christophe Robillard
5a27629ee9 add effectifs in instructeur dossier pdf export 2020-05-06 18:01:01 +02:00
Christophe Robillard
10a21f9010 expose attestationSocialeAttachment and attestationFiscaleAttachment 2020-05-06 17:25:04 +02:00
Paul Chavard
05e408225b Implement atomic operations on MapEditor 2020-05-06 16:46:14 +02:00
Christophe Robillard
dbf04dd0d8 make api entreprise call only if token not expired 2020-05-06 10:57:45 +02:00
Christophe Robillard
f587e6600a extract class ApiEntrepriseToken
and check if token is expired
2020-05-06 10:57:45 +02:00
clemkeirua
088e08ff55 descriptions sur tous les types de champs 2020-05-05 20:50:39 +02:00
clemkeirua
f8519a6920 ajout des descriptions - cas general 2020-05-05 20:50:39 +02:00
clemkeirua
7065accf64 ajout du descriptif de procedure dans le pdf 2020-05-05 20:50:39 +02:00
Paul Chavard
6556df2a85 Fix a crash in case of invalid geometry 2020-05-05 15:56:05 +02:00
Christophe Robillard
733e282e76 fix identite entreprise view 2020-04-30 16:53:33 +02:00
Christophe Robillard
9de2c7c85a improve csv generation for bilans bdf 2020-04-30 16:15:16 +02:00
Christophe Robillard
9873826dd4 remove date computed column
we will add it when more info of business
2020-04-30 16:15:16 +02:00
Christophe Robillard
22e2c2e133 render csv bidf bilans 2020-04-30 16:15:16 +02:00
Christophe Robillard
b12226c667 fetch and store bilans bdf 2020-04-30 16:15:16 +02:00
Christophe Robillard
85b2e9ef44 create bilans_bdf_adapter 2020-04-30 16:15:16 +02:00
Paul Chavard
843e033c38 Allow instructeurs to download a GeoJSON document for a given dossier 2020-04-30 15:49:43 +02:00
Paul Chavard
ef2d9e1138 Expose stable_id on champ 2020-04-30 15:49:31 +02:00
Christophe Robillard
59357f2100 show attestations sociales and fiscales only for instructeurs 2020-04-30 11:53:17 +02:00
Christophe Robillard
3ddb5a4cb4 store attestation fiscale and display 2020-04-30 11:39:54 +02:00
Christophe Robillard
38c68b16e3 create attestation_fiscale_adapter 2020-04-30 11:39:54 +02:00
Paul Chavard
b516cbc179 Enable republish on démarches dépubliée 2020-04-29 18:04:35 +02:00
Christophe Robillard
ddd3e6bb02 don't copy api_entreprise_token when cloning
except for an admin who owns the parent procedure
2020-04-29 17:17:20 +02:00
Christophe Robillard
158b4802ab store attestation sociale and display 2020-04-29 16:25:47 +02:00
Christophe Robillard
d74b14c205 fetch attestation sociale url 2020-04-29 14:25:55 +02:00
Christophe Robillard
b147956a92 create attestation_sociale_adapter 2020-04-29 14:01:48 +02:00
Christophe Robillard
e29af48420 call api_entreprise with specific token if exist 2020-04-28 15:17:11 +02:00
Christophe Robillard
14ff18ca80 store specific api-entreprise token for a procedure 2020-04-28 15:17:11 +02:00
clemkeirua
1ac7ec2dca precision dans mail suppression dossier en construction 2020-04-28 12:42:00 +00:00
kara Diaby
9aea1fffee Migrate the map editor to mapbox-gl with react component 2020-04-27 11:30:32 +02:00
Paul Chavard
2a3530738d Do not crash on boot if geos is not installed 2020-04-23 20:12:31 +02:00
Pierre de La Morinerie
04cf174039 Revert "app: add a warning about the file upload"
This reverts commit 7f45c7d97b.
2020-04-23 18:31:59 +02:00
Pierre de La Morinerie
0845777fa0 Merge branch 'file-banner' into dev 2020-04-23 17:00:49 +02:00
Pierre de La Morinerie
7f45c7d97b app: add a warning about the file upload 2020-04-23 16:54:27 +02:00
Christophe Robillard
339066778d send notif only to the right instructeurs
after a dossier creation, only the instructeurs that belong to the group
instructeur of the dossier, and who want notif will be notified by mail
2020-04-23 13:01:57 +02:00
Pierre de La Morinerie
6f4075f38e javascript: fix FileUploadError stacktraces
When subclassing a JS error, most browsers include the constructor
stacktrace :/

This is an issue, because:
- The stacktrace is deeper than it should be
- The stacktrace reaches into a polyfill for which there is not source
map, which causes Sentry to infer the issue grouping from the JS file
name. And the fingerprinted name changes on each release. So for each
release, the stacktrace is different ; and Sentry can't group issues
properly.
2020-04-23 12:27:26 +02:00
Paul Chavard
9cb612bb3d Show area and length on champ carto selections utilisateur 2020-04-23 10:21:18 +02:00
Christophe Robillard
792e755af9 expose effectif_annuel dans api graphql 2020-04-23 09:53:27 +02:00
Christophe Robillard
453adf3c74 instructeurs: affiche l'effectif moyen annuel n-1 2020-04-23 09:53:27 +02:00
Christophe Robillard
85d119fa4d n'affiche plus le code effectif 2020-04-23 09:53:27 +02:00
Christophe Robillard
a507359f5c précise source pour effectifs mensuels 2020-04-23 09:53:27 +02:00
Paul Chavard
b849fc6fc3 Mark as sent or destroy right after each notification is sent to enable a better recovery in case of mid loop failures 2020-04-23 09:36:09 +02:00
Paul Chavard
31943f7d9c Add handeling of expired processed dossiers to deletion service 2020-04-22 15:39:10 +02:00
Paul Chavard
f1b531911b Handle processed dossiers in deletion mailers 2020-04-22 15:39:10 +02:00
Paul Chavard
bdbee38ff1 Add expired termine scopes to dossier 2020-04-22 15:39:10 +02:00
Pierre de La Morinerie
f29ec5c775 instucteurs: don't show discarded procedures in the list 2020-04-22 15:16:21 +02:00
Pierre de La Morinerie
1cb18e51ac champ: return the parent dossier even when discarded
Dossier has a `default_scope { kept }`.

Because of that, when the parent dossier is discarded, `champ.dossier`
will return nil.

We should kill the default scope. But meanwhile, ensure that
`champ.dossier` returns even a discarded dossier.
2020-04-22 11:46:42 +02:00
Pierre de La Morinerie
ef009f73e2 javascript: report upload FileReader errors to Sentry
We have quite a lot of `Error reading file` errors when uploading files.
These errors are generated by ActiveStorage `file_checksum.js` component
but it eats the actual reason of errors.

(See https://github.com/rails/rails/blob/5-2-stable/activestorage/app/javascript/activestorage/file_checksum.js#L38)

We can't really override the class to generate better errors, as they
are deeply nested in ActiveStorage class hierarchy, and not exported to
external code.

Instead, we hook into the FileReader event handler, to insert a logger
when this error occur. The original event handler will also still be
called as usual.

This is intended to be temporary. The debug code will be removed once
we get a better idea of what is going on.
2020-04-22 11:26:16 +02:00
Christophe Robillard
149b98007f add effectif mensuel to graphql api 2020-04-21 21:13:07 +02:00
Christophe Robillard
1165f8483d rename effectif columns 2020-04-21 21:13:07 +02:00
Christophe Robillard
db3ef195ad fetch and show effectif mensuel
- fetch and store effectif mensuel (at the creation of the dossier or
when updating a siret field

- show effectif mensuel only for instructeurs
2020-04-21 14:22:11 +02:00
Christophe Robillard
599d8e33e8 create ApiEntreprise::EffectifsAdapter 2020-04-21 14:22:11 +02:00
Paul Chavard
fcd136c566 Enable deletion of expired dossiers en_construction
fix #4977
2020-04-21 10:41:54 +02:00
clemkeirua
2d68d7dc59 fix to_tsquery disallowed chars 2020-04-20 15:15:22 +02:00
Pierre de La Morinerie
52a491bde3 instructeur: improve description of unfiltered tab
The previous text was misleading: filters can be applied to this tab.
What it really does is present all dossiers regardless of their status.

Fix #5056
2020-04-20 11:34:57 +02:00
Paul Chavard
8f01eebf1f fix legacy api carte serializer 2020-04-17 12:48:42 +02:00
Paul Chavard
e512870fd2 Cleanup procedure duree_conservation_dossiers_dans_ds validations 2020-04-16 19:40:19 +02:00
Paul Chavard
bc8217e030 Carte Editor sends FeatureCollection to the server 2020-04-16 18:29:19 +02:00
Pierre de La Morinerie
769e98f63e javascript: fix the progress bar removal on success
When using auto-attach, the response HTML fragment replaces the progress
bar – so it doesn't need to be removed twice.
2020-04-16 17:02:23 +02:00
Pierre de La Morinerie
647ad3ba10 javascript: consider unknown upload errors as client errors 2020-04-16 12:59:14 +02:00
Pierre de La Morinerie
b006c33ebe javascript: parse the upload status code correctly
Previously the status was "Status: 422" instead of just 422.
2020-04-16 12:54:18 +02:00
Pierre de La Morinerie
b2231e98d5 javascript: don't report connectivity issues to Sentry 2020-04-16 11:20:45 +02:00
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