-
Notifications
You must be signed in to change notification settings - Fork 16
Acantin/recruiter form accessibility fix #371
base: master
Are you sure you want to change the base?
Conversation
d0467d8 to
75d79c3
Compare
|
Juste pour info je suis en train de (beaucoup) modifier des fichiers relatifs à la Demande de modification des métiers que tu as modifié aussi dans cette PR. Je risque d'écraser tes modifs quand je mergerai ma branche sinon ça va être trop violent comme diff... |
labonneboite/web/app.py
Outdated
| def compute_input_attributes(field): | ||
| attrs = {} | ||
|
|
||
| if field.validators and field.validators[0].__class__.__name__ == "DataRequired": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je pense que tu peux écrire ça mieux avec field.flags.required. À tester !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En effet, ça marche et c'est plus digeste !
| def inject_jepostule_enabled(): | ||
| return {'jepostule_enabled': jepostule_enabled} | ||
|
|
||
| def inject_compute_input_attributes(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ça mérite une docstring qui explique ce que ça fait !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| # aria-describedby are used to link input fields to their description and/or error messages | ||
| aria_describedby = [] | ||
| if field.description: | ||
| aria_describedby.append('{}_description'.format(field.id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Juste pour la forme, en Python 3 il y a les f-strings qui te permettent d'écrire comme ça :
aria_describedby.append(f"{field.id}_description")| fix_csrf_session() | ||
| form = forms.OfficeIdentificationForm() | ||
|
|
||
| form_has_errors = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ça me paraît super bizarre, il y a une propriété Form.errors qui existe déjà. Il y a un truc qui cloche si tu te retrouves à coder un mécanisme de détection d'erreurs à côté du natif.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le message d'erreur était un message flash, je l'ai passé en erreur au niveau du champs en question :)
|
J'ai fait les changements @kemar, je te laisse finir la PR impactante et je ferai le rebase ensuite. |
kemar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes nickel les changements ! Comme je te l'ai signalé je suis en train de travailler sur des fichiers que tu as modifié, je tenterai de faire attention pendant le merge mais il y a peut-être certaines de tes modifs qui vont sauter :'(
Sinon LGTM
|
je vais ressuciter cette PR qui manifestement est passée à la trappe |
|
Wow le merge conflict est gratiné... je retenterais quand j'aurai plus de temps. |
aria-labelledbytitlede la pageinputconcernés avecaria-labelledby