Commit graph

9736 commits

Author SHA1 Message Date
Pierre de La Morinerie
a328e8d94a features: refactor the editor specs
- Add an `add_champ` helper
- Stop relying on a default champ being created
- Wait for all champs to be created by watching the "Add champ" button 

This should fix the flakiness of these tests.

Refs #4417
2019-11-27 11:58:46 +01:00
Pierre de La Morinerie
52051914aa editor: disable the "Add champ" button until the champ is saved
Otherwise some champs are created before the previous one has been
saved, and React complains that several champs have the same
`champ-undefined` key.

(Plus it made the tests flaky and unreliable.)
2019-11-27 11:58:46 +01:00
Pierre de La Morinerie
7ed649dfca editor: don't create a champ by default
Before the editor attempted to create a default champ as soon as the
list became empty.

This created many race conditions, which made the tests flaky.

Remove this behavior, and add an empty label instead.
2019-11-27 11:58:45 +01:00
Pierre de La Morinerie
d0cd875e91 features: add a leave_browser_open helper 2019-11-27 11:58:45 +01:00
Pierre de La Morinerie
0ef4a5253c features: move feature matchers to their own file
This allows to have the same syntax than native Capybara matchers.
2019-11-27 11:58:45 +01:00
Pierre de La Morinerie
5d797abb8c
Autosave : amélioration de la fiabilité (#4571)
Usager : amélioration de la fiabilité de l'enregistrement automatique
2019-11-27 11:58:21 +01:00
Pierre de La Morinerie
f58f9f9950 dossiers: render a valid response after an autosave
This helps Firefox DevTools to mark the request as valid and completed
successfuly.
2019-11-27 10:37:33 +00:00
Pierre de La Morinerie
30b822b135 dossiers: don't trigger an autosave when an attachment is modified
The draft autosave should not be triggered when attaching a file
(as file inputs are handled separately).
2019-11-27 10:37:33 +00:00
Pierre de La Morinerie
c6eab70679 dossiers: autosave shouldn't send files being uploaded
When a file is being uploaded asynchronosely, hidden input fields
are created by DirectUpload to contain the result of the upload.

However, before the upload finishes, the value of these inputs is not
meaningful. Moreover, it makes the ActiveRecord signature invalid – thus
preventing drafts from being saved.

Exclude these fields from the auto-save.
2019-11-27 10:37:33 +00:00
Pierre de La Morinerie
64d96646a3 javascript: autosave with explicit cookies settings
Older browsers implemented a different default value for `window.fetch`
credentials: it was omitted unless explicitely set.

So we force the value for these older browsers:

- Firefox 39-60
- Chrome 42-67
- Safari 10.1-11.1.2

See https://github.com/github/fetch#sending-cookies
2019-11-27 10:37:33 +00:00
Pierre de La Morinerie
2309017727 javascript: add a window.fetch polyfill
This allows the autosave to work on browsers that don't support fetch:

- IE 11
- Edge < 14
- Safari < 11
2019-11-27 10:37:33 +00:00
LeSim
44f28241c4
Merge pull request #4540 from maatinito/issue/bad_closing_hour
Prise en compte des fuseaux horaires pour la fermeture des procédures
2019-11-26 16:56:19 +01:00
maatinito
9de9a1fd71 Use time.zone functions instead of server time functions
(Time.zone.today vs Date.today)
2019-11-26 14:26:36 +01:00
maatinito
14bc2b99b9 auto-archive badly occurs in UTC time and not in local time (1 hour too late in France, 10 hours before in Tahiti ;-) 2019-11-25 14:39:42 +01:00
LeSim
6c2c3aae14
Merge pull request #4569 from betagouv/fix-instructeur-admin-dashboard
manager: fix Instructeur and Administrateur email
2019-11-25 14:38:09 +01:00
Pierre de La Morinerie
c2c332244e manager: fix Instructeur and Administrateur email
Use the email attribute on the User (rather than the deprecated email
column on Instructeur or Administrateur).

Fix #4565
2019-11-25 13:01:22 +01:00
Keirua
77abd65bab
Merge pull request #4547 from Keirua/4378-pjs-messagerie-durant-telechargement
Ajout des fichiers de la messagerie dans l'export zip du dossier
2019-11-25 10:38:01 +01:00
clemkeirua
789fcf72ca ajout d'un test automatisé 2019-11-25 10:37:10 +01:00
clemkeirua
9503a363e5 4378 Ajout des PJ de la messagerie dans le zip des PJs du dossier 2019-11-25 10:36:32 +01:00
LeSim
9a3be41c90
Merge pull request #4564 from betagouv/fix-routage-feature-spec
Corrige un test bout en bout peu fiable sur le routage
2019-11-21 20:43:25 +01:00
Pierre de La Morinerie
1de4ef8a9a specs: fix error in routing feature test by waiting for Turbolinks 2019-11-21 18:37:51 +01:00
Pierre de La Morinerie
b78134c691 specs: make the routing feature test more robust
- Use human-readable form labels
- Always wait for the result of the previous action to be loaded before
  starting another action
2019-11-21 18:29:45 +01:00
LeSim
04f29b404f
Merge pull request #4556 from betagouv/more_accessibility
Corrige des fautes syntaxiques html
2019-11-21 17:17:09 +01:00
simon lehericey
054181a16f Champ Repetition has no label, thus it's displayed as a section 2019-11-21 15:34:59 +01:00
simon lehericey
2162522814 ul should have li childs 2019-11-21 15:34:59 +01:00
simon lehericey
bc85e9b7ec Use aria-describedby to link notice and input again
https://www.w3.org/WAI/tutorials/forms/instructions/#using-aria-describedby
2019-11-21 15:34:59 +01:00
simon lehericey
84b125d272 p cannot be included in label
The main problem come from
%label{for: input_id}
  #{champ.libelle}
  %span.notice= string_to_html(champ.description)
%input

where string_to_html contains p tags

The proposed solution is
%label #{champ.libelle}
%p.notice
%input

It should be iso in the graphic sense.
2019-11-21 15:34:59 +01:00
simon lehericey
d5da7916e5 Placeholder not allowed in date input 2019-11-21 15:34:59 +01:00
simon lehericey
f45ede7f44 href should not contain space 2019-11-21 15:34:59 +01:00
Keirua
1bba20a782
Merge pull request #4550 from Keirua/fix-devise-mailer-smtp-syntax-error
#4419 - correction des erreurs d'envoi de mail Devise
2019-11-21 15:13:29 +01:00
clemkeirua
f2c69400aa add rescue_from to UserDeviseMailer 2019-11-21 14:59:30 +01:00
Pierre de La Morinerie
ff3f4774e8 Add a Github Actions workflow for automatic rebase
Add /rebase to a comment to trigger an automatic rebase.
2019-11-21 14:51:52 +01:00
Pierre de La Morinerie
b4a4d8c0ea
Merge pull request #4551 from betagouv/autosave
Usager : permet d'enregistrer les brouillons automatiquement (désactivé pour l'instant)
2019-11-21 14:44:14 +01:00
Pierre de La Morinerie
6de5c0c9d1 autosave: make requests time out
This avoids recent requests being stuck because an older request never
finished.
2019-11-21 14:00:06 +01:00
Pierre de La Morinerie
68f5aae99d autosave: add feature test 2019-11-21 14:00:06 +01:00
Pierre de La Morinerie
bff7892ba8 dossiers: autosave drafts 2019-11-21 14:00:06 +01:00
Paul Chavard
6f2779a312
Merge pull request #3991 from tchak/cleanup-old-export
Supprimer le code du vieux export de xls (15/11/2019)
2019-11-21 10:50:03 +01:00
Paul Chavard
0c6705f7fd Drop old export service 2019-11-21 10:25:40 +01:00
Keirua
36ffde35a2
Merge pull request #4549 from betagouv/fix-unknown-format
Fix UnknownFormat durant les exports de procédures
2019-11-21 09:53:13 +01:00
clemkeirua
be7fde1103 fix UnknownFormat raised in Instructeurs::ProceduresController#download_export 2019-11-21 09:52:38 +01:00
Pierre de La Morinerie
0b8512362e
javascript: make utils resilient to missing elements (#4546)
Javascript : les fonctions utilitaires fonctionnent lorsque l'élément n'existe pas
2019-11-20 17:41:51 +01:00
Pierre de La Morinerie
74a9db6580 javascript: make utils resilient to missing elements 2019-11-20 17:36:09 +01:00
LeSim
10ebb8a373
Merge pull request #4539 from betagouv/4163-suivi-automatique-apres-envoi-instructeur
permet le suivi auto d'un dossier après envoi instructeur
2019-11-20 16:49:20 +01:00
Christophe Robillard
b42f21264e permet le suivi auto après envoi instructeur
Close #4163
2019-11-20 16:41:30 +01:00
Keirua
de9be2f0e5
Merge pull request #4538 from mfaure/4537-Description-des-entrées-du-env.example
DOC ajout commentaires + explications pour env.example
2019-11-20 16:16:34 +01:00
Keirua
c2035ba797
Merge branch 'dev' into 4537-Description-des-entrées-du-env.example 2019-11-20 16:07:12 +01:00
Matthieu FAURE
87813c42d9
Update config/env.example
Co-Authored-By: Keirua <Keirua@users.noreply.github.com>
2019-11-20 15:40:02 +01:00
Matthieu FAURE
1f2f904f8f
Update config/env.example
Co-Authored-By: Keirua <Keirua@users.noreply.github.com>
2019-11-20 15:39:50 +01:00
Pierre de La Morinerie
5038df54df
dossiers controller: render JSON if needed (#4545)
DossiersController : évite de générer du HTML en cas de requête JSON
2019-11-20 13:02:18 +01:00
Pierre de La Morinerie
5f9a9d059e dossiers: render JSON if needed
When receiving a request that expects JSON, return a simple '200'.

This avoids the unecessary work of rendering all the HTML page (which
ultimately will not be used).
2019-11-20 11:30:27 +01:00