amelioration(champ.rna): affiche les retours UX avec les bons composant text dsfr
This commit is contained in:
parent
0edf5d2c58
commit
4858239768
2 changed files with 5 additions and 4 deletions
|
@ -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))
|
= @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) }
|
.rna-info{ id: dom_id(@champ, :rna_info) }
|
||||||
= render 'shared/champs/rna/association', champ: @champ, error: nil
|
= render 'shared/champs/rna/association', champ: @champ, error: nil
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
- case error
|
- case error
|
||||||
- when :invalid
|
- 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
|
Le numéro RNA doit commencer par un W majuscule suivi de 9 chiffres
|
||||||
- when :not_found
|
- when :not_found
|
||||||
%p.fr-pt-1.fr-pb-0= t('.not_found')
|
%p.fr-error-text= t('.not_found')
|
||||||
- when :network_error
|
- when :network_error
|
||||||
%p.fr-pt-1.fr-pb-0= t('.network_error')
|
%p.fr-error-text= t('.network_error')
|
||||||
- else
|
- else
|
||||||
- if champ.value.present?
|
- 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)
|
||||||
|
|
Loading…
Reference in a new issue