Commit graph

4914 commits

Author SHA1 Message Date
Chaïb Martinez
b2135b6576 Sendinblue email balancing using interceptor
Signed-off-by: Chaïb Martinez <chaibax@gmail.com>
2019-11-04 15:30:44 +01:00
Pierre de La Morinerie
2e8d365b93 instructeurs: disable the email column 2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
f8358b3ae9 instructeurs: create without providing the email 2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
f131dbb80d instructeurs: make the create form not using email directly
Before the form attempted to read an email value from the Instructeur
model, and failed (because the empty Instructeur had no user yet).

We could let `Instructeur#email` return `nil` if there is no User –
but as a created Instructeur is always supposed to have a User, this
seems like a nice safeguard to keep.

So instead this commit rewrites the create form, which now doesn’t
depend on an Instructeur model. Seems easy enough for now.
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
d78d206544 instructeurs: fix expert creation not to use Instructeur.email
It kind of worked until now, because the email field is disabled, and
thus never accessed.

But better make it clean, by accessing an object (User) where the email
field actually exists.
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
8e6930d257 instructeurs: fix ProcedurePresentation to use instructeur.user.email
The `joins` are declared explicitely in order to associate a predictable
name to the joined table.

Otherwise, when the query is joined with `:users`, ActiveRecord will
alias the join automatically  to solve the conflict. Unfortunately, the
automatic resolution means that the table name becomes unpredictable,
and thus unsuitable to perform queries on.
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
8b8213c301 instructeurs: always eager load the user relationship
Now that `Instructeur.email` is merely an alias to `instructeur.user.email`,
and we changed every occurence of `instructeurs.pluck(:email)` to
`instructeurs.map(&:email)`, the new version using `map` may cause N+1 queries
if the users have not been preloaded.

It makes sense to always preload the user when fetching an Instructeur:

- Instructeur and User have a strongly coupled relationship
- It avoids N+1 queries everywhere in the app

Of course fetching an instructeur without needing its user will now do an
unecessary fetch of the associated user. But it seems better than leaving
a risk of N+1 queries in many places.
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
a462edb9bc instructeurs: alias instructeur.email
This also means we need to replace instances of `pluck` on the email
column.
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
cd478b489e instructeurs: replace calls to Instructeur.find_by(email: …) 2019-11-04 10:44:23 +01:00
Paul Chavard
839b0d7e6d Add Entreprise raison sociale to dossier export
fix #4422
2019-10-31 17:11:46 +01:00
Paul Chavard
18e91e7ca3 Extend old export format till mid-November 2019-10-31 17:11:46 +01:00
Pierre de La Morinerie
627d30191f manager: allow hidden procedures to be searched
The Manager::DossiersController already allow hidden dossiers to be
searched and displayed. Give the same behavior to Procedures.
2019-10-31 17:03:02 +01:00
Pierre de La Morinerie
076e3a9294 procedure: improve layout of the "webhook" field 2019-10-31 16:04:47 +01:00
Pierre de La Morinerie
817662f7d9 procedure: move description to views/shared
Now that the description is used not only in the layout, but also in the
procedure form, better to make it an official shared partial.
2019-10-31 10:27:19 +01:00
Pierre de La Morinerie
2e0ef84941 images: rename 'attachment' icon to 'attached'
This avoids conflicts with the 'attachment' component.
2019-10-31 10:27:19 +01:00
Pierre de La Morinerie
aea93779cc procedure: use the attachment view to upload files 2019-10-31 10:27:19 +01:00
Pierre de La Morinerie
1c61f2de58 views: refactor the attachment/edit view
Make it more reusable, by:

- Renaming `attachment/update` to `attachment/edit`
- Refactoring the CSS styles into their own stylesheet
- Allow to specify the 'accept' option
2019-10-31 10:27:19 +01:00
Pierre de La Morinerie
5be83bd01e procedure: make the layout more similar to the mockup 2019-10-31 10:27:19 +01:00
Pierre de La Morinerie
02384b078c procedure: remove UI to edit the european flag
This is an option we want to deprecate, and remove entirely in the
future.

Admins can still add the EU flag manually to their uploaded logo.
2019-10-31 10:27:19 +01:00
Pierre de La Morinerie
112b44bdea procedure: align radio buttons vertically
- Remove the unused `.radios.vertical`
- Add a `.editable-champ-radio.vertical` variant for vertical radios
- Add an example of vertical radios to the patron
- Use vertical radios to display the procedure options
2019-10-31 10:27:19 +01:00
Nicolas Bouilleaud
72b7ff221c move procedure to new design 2019-10-31 10:27:19 +01:00
simon lehericey
652e95d0c5 Add link from instructeur procedure view 2019-10-30 14:27:51 +01:00
simon lehericey
477f7c9837 Remove instructeur 2019-10-30 14:27:51 +01:00
simon lehericey
79b808470c Add instructeur 2019-10-30 14:27:51 +01:00
simon lehericey
94081a3997 Show Groupe Instructeur 2019-10-30 14:27:51 +01:00
simon lehericey
4491dca19a Index Groupe Instructeur 2019-10-30 14:27:51 +01:00
simon lehericey
def9c67c56 Clean html 2019-10-30 14:27:51 +01:00
Paul Chavard
6a3d725134 Revert "Revert "Decommission ActiveStorage proxy service and use openstack service""
This reverts commit 71227be37f.
2019-10-30 12:11:45 +01:00
simon lehericey
71227be37f Revert "Decommission ActiveStorage proxy service and use openstack service"
This reverts commit 0ff6c793ae.
2019-10-29 10:30:40 +01:00
simon lehericey
4febf1851f notifications_for_procedure is now based on instructeur.groupe_instructeurs 2019-10-25 09:42:17 +02:00
simon lehericey
d411bfddc8 We can send a dossier to instructeurs from the same groupe 2019-10-25 09:42:17 +02:00
simon lehericey
e290fc3674 No need to update column as the sign_up process activates the user 2019-10-24 18:32:48 +02:00
simon lehericey
8ae592fe25 [fix #4361] administrateur active 2019-10-24 18:32:48 +02:00
Pierre de La Morinerie
dc1f3b4220 champs: add a "plus" icon to the "Add row" button 2019-10-24 16:52:29 +02:00
Pierre de La Morinerie
906f0fc468 champs: fix margin of "Add row" button in the Preview 2019-10-24 16:52:29 +02:00
Pierre de La Morinerie
35e97ac617 patron: add content to the repetition champ 2019-10-24 16:52:29 +02:00
Pierre de La Morinerie
8f4ead96b0 patron: make the labels more readable 2019-10-24 16:52:29 +02:00
clemkeirua
d9e993571c add a warning during export generation 2019-10-24 16:27:10 +02:00
clemkeirua
cb5f922bb6 cleanup the queue flag during cleanup job 2019-10-24 16:27:10 +02:00
clemkeirua
da590cc73a sequence async file generation so that the queue flag is cleared 2019-10-24 16:27:10 +02:00
Pierre de La Morinerie
bb024d1850 javascript: display a localized message on upload errors 2019-10-24 16:12:56 +02:00
Pierre de La Morinerie
a3057afc22 javascript: report upload errors to Sentry 2019-10-24 16:12:56 +02:00
Paul Chavard
a192924ee5 Fix infinit rerendering of TypeDeChamp component
fix #4428
2019-10-24 13:31:54 +02:00
simon lehericey
90ae4181bf fix dossier_linked_path in routed procedure 2019-10-23 21:47:20 +02:00
simon lehericey
fbe93e0fce Fix pluralization in search page 2019-10-23 21:47:20 +02:00
simon lehericey
35bba62297 Update routing critéria name 2019-10-23 21:47:20 +02:00
simon lehericey
d136d023cd Add feature flipped link in admin nav bar 2019-10-23 21:47:20 +02:00
simon lehericey
a5ffe9f54b Remove instructeur from the group 2019-10-23 21:47:20 +02:00
simon lehericey
a6deafd885 Add instructeurs to groupe 2019-10-23 21:47:20 +02:00
simon lehericey
3dd3af8482 Groupe instructeur update 2019-10-23 21:47:20 +02:00