Merge pull request #10020 from mfo/US/a11y-invite-with-nice-feedback

ETQ usager utilisant un lecteur d'écran: l'envoie d'une invitation est confusant (le form reste rempli, le message de confirmation n'est pas lu)
This commit is contained in:
mfo 2024-02-22 06:02:26 +00:00 committed by GitHub
commit aaf5f08f25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 29 deletions

View file

@ -15,7 +15,7 @@ class InvitesController < ApplicationController
if invite.valid?
# The notification is sent through an after commit hook in order to avoir concurrency issues
flash.notice = "Une invitation a été envoyée à #{invite.email}."
flash.notice = t('views.invites.create.success', email: invite.email)
else
flash.alert = invite.errors.full_messages
end
@ -49,9 +49,9 @@ class InvitesController < ApplicationController
if invite.present?
@dossier = invite.dossier
invite.destroy!
flash.notice = "Lautorisation de #{invite.email} vient dêtre révoquée."
flash.notice = t('views.invites.destroy.success', email: invite.email)
else
flash.alert = "Vous ne pouvez pas révoquer cette autorisation"
flash.alert = t('views.invites.destroy.error')
end
respond_to do |format|