feat(experts_procedures#create): link to typo errors

This commit is contained in:
mfo 2024-07-01 11:01:38 +02:00
parent e6a3f210d4
commit 77bf93dfc2
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
2 changed files with 2 additions and 2 deletions

View file

@ -1,7 +1,7 @@
= render Dsfr::AlertComponent.new(title: "nous pensons avoir identifié une faute de frappe : ", state: :warning, extra_class_names: 'fr-mb-3w') do |c|
- c.with_body do
%p= @title
%ul
%ul#maybe_typos_errors
- @maybe_typos.each do |(actual_email, suggested_email)|
%li
= "Je confirme "

View file

@ -15,7 +15,7 @@ module Administrateurs
.map { |email| [email, EmailChecker.check(email:)[:suggestions]&.first] }
.partition { _1[1].present? }
errors = if !@maybe_typos.empty?
["Attention, nous pensons avoir identifié une faute de frappe dans les invitations : #{@maybe_typos.map(&:first).join(', ')}"]
["Attention, nous pensons avoir identifié une faute de frappe dans les invitations : #{@maybe_typos.map(&:first).join(', ')}. Veuillez, #{view_context.link_to(" verifier l'orthographe", "#maybe_typos_errors")} des invitations."]
else
[]
end