amelioration(champ.rna): affiche les retours UX avec les bons composant text dsfr

This commit is contained in:
Martin 2023-06-22 16:04:56 +02:00 committed by mfo
parent 0edf5d2c58
commit 4858239768
2 changed files with 5 additions and 4 deletions

View file

@ -1,3 +1,4 @@
= @form.text_field(:value, input_opts( id: @champ.input_id, aria: { describedby: @champ.describedby_id }, placeholder: t(".placeholder"), data: { controller: 'turbo-input', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.data.blank?, turbo_input_url_value: champs_rna_path(@champ.id) }, required: @champ.required?, pattern: "W[0-9]{9}", title: t(".title"), class: "width-33-desktop", maxlength: 10))
.rna-info{ id: dom_id(@champ, :rna_info) }
= render 'shared/champs/rna/association', champ: @champ, error: nil

View file

@ -1,11 +1,11 @@
- case error
- when :invalid
%p.fr-pt-1.fr-pb-0
%p.fr-error-text
Le numéro RNA doit commencer par un W majuscule suivi de 9 chiffres
- when :not_found
%p.fr-pt-1.fr-pb-0= t('.not_found')
%p.fr-error-text= t('.not_found')
- when :network_error
%p.fr-pt-1.fr-pb-0= t('.network_error')
%p.fr-error-text= t('.network_error')
- else
- if champ.value.present?
%p.fr-pt-1.fr-pb-0= t('.data_fetched', title: champ.title)
%p.fr-info-text= t('.data_fetched', title: champ.title)