Commit graph

8556 commits

Author SHA1 Message Date
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
38f994a151 instructeurs: fix mailer previews not to use Instructeur.email
Mailers previews now create mock Instructeurs without directly accessing
the email.
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
c14dc7ad64
Merge pull request #4460 from tchak/fix-export-issues
Fix export issues
2019-10-31 17:23:05 +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
Paul Chavard
77cdd522bd
Merge pull request #4464 from betagouv/manager-improve-procedure
manager: allow hidden procedures to be searched
2019-10-31 17:10:41 +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
35f5ea2db8
procedure: improve layout of the "webhook" field (#4463)
Administrateur : amélioration de la mise en page du champ "Lien de rappel HTTP"
2019-10-31 17:01:03 +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
f1536c6c82
Bump ruby version to 2.6.5 (#4426)
Mise à jour vers Ruby 2.6.5
2019-10-31 15:04:14 +01:00
Pierre de La Morinerie
7fa996cb41 ops: bump ruby version to 2.6.5
This fixes a crash related to "Spring + Postgres" occuring on local
development environments on Ruby 2.6.1.
2019-10-31 14:54:40 +01:00
Paul Chavard
252a7f931e
Merge pull request #4443 from tchak/update-javascript-dependencies
Update javascript dependencies
2019-10-31 11:22:38 +01:00
Paul Chavard
2336a4c490 Update javascript dependencies 2019-10-31 11:13:51 +01:00
Pierre de La Morinerie
a74fa9b1bb
Merge pull request #4280 from Keirua/procedure-new-design
Administrateur : nouvelle page de création et d'édition des démarche
2019-10-31 10:42:45 +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
LeSim
77bf1fea1a
Merge pull request #4455 from tchak/ds-proxy-url
Add a DS_PROXY_URL env variable
2019-10-30 16:29:53 +01:00
Paul Chavard
73d4ecf35d Add a DS_PROXY_URL env variable 2019-10-30 16:15:38 +01:00
LeSim
bc257911e9
Merge pull request #4450 from betagouv/instructeur_manage_groupe
Gestion des groupes instructeurs par les instructeurs
2019-10-30 14:37:39 +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
07aefdd40b Fix test in new_admin/groupe_instructeur_controller 2019-10-30 14:27:51 +01:00
simon lehericey
def9c67c56 Clean html 2019-10-30 14:27:51 +01:00
LeSim
d2bd5f497c
Merge pull request #4454 from tchak/bump-openstack
Bump openstack
2019-10-30 14:25:28 +01:00
Paul Chavard
de8a163707 Bump openstack and fog-openstack 2019-10-30 12:12:31 +01:00
Paul Chavard
5a87db9920 Revert "Revert "Update activestorage-openstack""
This reverts commit c102dc63b7.
2019-10-30 12:11:53 +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
LeSim
c8da5a22fc
Merge pull request #4451 from betagouv/fix_pj
Fix pj
2019-10-29 10:57:02 +01:00
simon lehericey
c102dc63b7 Revert "Update activestorage-openstack"
This reverts commit 9088495272.
2019-10-29 10:31:29 +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
LeSim
db8ba304e6
Merge pull request #4449 from betagouv/do_not_break_the_prod
Corrige la pr d'activation des admins
2019-10-28 15:08:10 +01:00
simon lehericey
c6513318b8 Revert "DB: drop active column from adminsitrateurs table"
This reverts commit 2cb8041560.
2019-10-28 14:59:58 +01:00
LeSim
0d8405d37e
Merge pull request #4446 from betagouv/last_defaut_groupe_instructeur
Suppression des derniers defaut_groupe_instructeur illégitimes
2019-10-25 10:05:48 +02:00
LeSim
818e7eeeb6
Merge pull request #4447 from betagouv/fix_some_typos
Corrections de quelques fautes d'orthographe
2019-10-25 10:02:31 +02:00
simon lehericey
cba9ffb753 full_scenario extended with notifications controle 2019-10-25 09:42:17 +02:00