Merge pull request #9518 from demarches-simplifiees/9497-description-champs
ETQ usager, je suis aidé à la saisie par une description des champs
This commit is contained in:
commit
da62a5ec79
56 changed files with 186 additions and 50 deletions
|
@ -20,7 +20,7 @@
|
|||
%p.fr-error-text= error_message
|
||||
|
||||
- elsif first?
|
||||
%p.fr-text--sm.fr-text-mention--grey.fr-mb-1w
|
||||
%p.fr-hint-text.fr-mb-1w
|
||||
- if max_file_size.present?
|
||||
= t('.max_file_size', max_file_size: number_to_human_size(max_file_size))
|
||||
- if allowed_formats
|
||||
|
|
|
@ -5,4 +5,3 @@ en:
|
|||
check_content_rebased: The type of this field or its description has been modified by the administration. Check its content.
|
||||
optional_champ: (optional)
|
||||
recommended_size: The recommended maximum size is %{size} characters.
|
||||
titre_identite_notice: National identity card (front side only), passport, residency permit or other proof of identity.
|
||||
|
|
|
@ -5,4 +5,3 @@ fr:
|
|||
check_content_rebased: Le type de ce champ ou sa description ont été modifiés par l'administration. Vérifier son contenu.
|
||||
optional_champ: (facultatif)
|
||||
recommended_size: La taille maximale conseillée est de %{size} caractères.
|
||||
titre_identite_notice: Carte nationale d’identité (uniquement le recto), passeport, titre de séjour ou autre justificatif d’identité.
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
%span.updated-at.highlighted
|
||||
= t('.check_content_rebased')
|
||||
|
||||
- if @champ.titre_identite?
|
||||
%span.fr-hint-text= t('.titre_identite_notice')
|
||||
|
||||
- if hint?
|
||||
%span.fr-hint-text= hint
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
= @form.number_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, step: :any, placeholder: "3.14", required: @champ.required?))
|
||||
= @form.number_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, step: :any, required: @champ.required?))
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
en:
|
||||
titre_identite_notice: National identity card (front side only), passport, residency permit or other proof of identity.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
fr:
|
||||
titre_identite_notice: Carte nationale d’identité (uniquement le recto), passeport, titre de séjour ou autre justificatif d’identité.
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
en:
|
||||
placeholder: "camilya.martin@exemple.fr"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
fr:
|
||||
placeholder: "camilya.martin@exemple.fr"
|
|
@ -1 +1 @@
|
|||
= @form.email_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, placeholder: t(".placeholder"), required: @champ.required?))
|
||||
= @form.email_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, required: @champ.required?))
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
en:
|
||||
placeholder: "FR76 3000 6000 0012 3456 7890 189"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
fr:
|
||||
placeholder: "FR76 3000 6000 0012 3456 7890 189"
|
|
@ -1 +1 @@
|
|||
= @form.text_field(:value, input_opts(id: @champ.input_id, placeholder: t(".placeholder"), required: @champ.required?, aria: { describedby: @champ.describedby_id }, data: { controller: 'format', format: 'iban' }, class: "width-66-desktop", maxlength: 34 + 9)) # count space separator of 4 digits-groups
|
||||
= @form.text_field(:value, input_opts(id: @champ.input_id, required: @champ.required?, aria: { describedby: @champ.describedby_id }, data: { controller: 'format', format: 'iban' }, class: "width-66-desktop", maxlength: 34 + 9)) # count space separator of 4 digits-groups
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
en:
|
||||
placeholder: "0612345678"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
fr:
|
||||
placeholder: "0612345678"
|
|
@ -1,4 +1,4 @@
|
|||
-# Allowed @formats:
|
||||
-# very light validation is made client-side
|
||||
-# stronger validation is made server-side
|
||||
= @form.phone_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, placeholder: t(".placeholder"), required: @champ.required?, pattern: "[^a-z^A-Z]+"))
|
||||
= @form.phone_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, required: @champ.required?, pattern: "[^a-z^A-Z]+"))
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
en:
|
||||
placeholder: "W503726238"
|
||||
title: "The RNA number must begin with a capital W followed by 9 digits"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
placeholder: "W503726238"
|
||||
title: "Le numéro RNA doit commencer par un W majuscule suivi de 9 chiffres"
|
||||
|
|
|
@ -1,4 +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 }, 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
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
en:
|
||||
placeholder: "50000123456789"
|
||||
title: "The SIRET number must have exactly 14 digits"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
fr:
|
||||
placeholder: "50000123456789"
|
||||
title: "Le numéro de SIRET doit comporter exactement 14 chiffres"
|
||||
|
|
|
@ -1,4 +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.etablissement.blank?, turbo_input_url_value: champs_siret_path(@champ.id) }, required: @champ.required?, pattern: "[0-9]{14}", title: t(".title"), class: "width-33-desktop", maxlength: 14))
|
||||
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, data: { controller: 'turbo-input', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.etablissement.blank?, turbo_input_url_value: champs_siret_path(@champ.id) }, required: @champ.required?, pattern: "[0-9]{14}", title: t(".title"), class: "width-33-desktop", maxlength: 14))
|
||||
.siret-info{ id: dom_id(@champ, :siret_info) }
|
||||
- if @champ.etablissement.present?
|
||||
= render EditableChamp::EtablissementTitreComponent.new(etablissement: @champ.etablissement)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
- if @champ.type_de_champ.piece_justificative_template&.attached?
|
||||
= render partial: "shared/piece_justificative_template", locals: { champ: @champ }
|
||||
= render Attachment::EditComponent.new(champ: @form.object, attached_file: @champ.piece_justificative_file, attachment: @champ.piece_justificative_file[0], form_object_name: @form.object_name,
|
||||
|
|
6
config/locales/models/champs/address_champ/en.yml
Normal file
6
config/locales/models/champs/address_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/address_champ:
|
||||
hints:
|
||||
value: "Enter an address, a street, a city. Example: 11 rue Réaumur, Paris"
|
6
config/locales/models/champs/address_champ/fr.yml
Normal file
6
config/locales/models/champs/address_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/address_champ:
|
||||
hints:
|
||||
value: "Saisissez une adresse, une voie, un lieu-dit ou une commune. Exemple : 11 rue Réaumur, Paris"
|
6
config/locales/models/champs/commune_champ/en.yml
Normal file
6
config/locales/models/champs/commune_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/commune_champ:
|
||||
hints:
|
||||
value: "Enter the municipality's zip code, then select the municipality from the list"
|
6
config/locales/models/champs/commune_champ/fr.yml
Normal file
6
config/locales/models/champs/commune_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/commune_champ:
|
||||
hints:
|
||||
value: "Renseignez le code postal de la ville puis, ensuite, sélectionnez la commune dans la liste"
|
6
config/locales/models/champs/date_champ/en.yml
Normal file
6
config/locales/models/champs/date_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/date_champ:
|
||||
hints:
|
||||
value: "Expected format: mm/dd/yyyy. Example: 01/15/2022"
|
6
config/locales/models/champs/date_champ/fr.yml
Normal file
6
config/locales/models/champs/date_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/date_champ:
|
||||
hints:
|
||||
value: "Format attendu : JJ/MM/AAAA. Exemple : 15/01/2022"
|
|
@ -3,5 +3,4 @@ en:
|
|||
attributes:
|
||||
champs/datetime_champ:
|
||||
hints:
|
||||
value: "Expected format : dd/mm/yyyy hh:mm"
|
||||
|
||||
value: "Expected format: mm/dd/yyyy hh:mm. Example: 01/15/2022 12:00"
|
||||
|
|
|
@ -3,5 +3,4 @@ fr:
|
|||
attributes:
|
||||
champs/datetime_champ:
|
||||
hints:
|
||||
value: "Format attendu : jj/mm/aaaa hh:mm"
|
||||
|
||||
value: "Format attendu : JJ/MM/AAAA HH:MM. Exemple : 15/01/2022 12:00"
|
||||
|
|
6
config/locales/models/champs/decimal_number_champ/en.yml
Normal file
6
config/locales/models/champs/decimal_number_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/decimal_number_champ:
|
||||
hints:
|
||||
value: "You can enter up to 3 decimal places after the decimal point. Exemple: 3.14"
|
6
config/locales/models/champs/decimal_number_champ/fr.yml
Normal file
6
config/locales/models/champs/decimal_number_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/decimal_number_champ:
|
||||
hints:
|
||||
value: "Vous pouvez saisir jusqu’à 3 décimales après la virgule. Exemple: 3,14"
|
6
config/locales/models/champs/departement_champ/en.yml
Normal file
6
config/locales/models/champs/departement_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/departement_champ:
|
||||
hints:
|
||||
value: "Enter department code or name"
|
6
config/locales/models/champs/departement_champ/fr.yml
Normal file
6
config/locales/models/champs/departement_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/departement_champ:
|
||||
hints:
|
||||
value: "Renseignez le code ou le nom du département"
|
6
config/locales/models/champs/email_champ/en.yml
Normal file
6
config/locales/models/champs/email_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/email_champ:
|
||||
hints:
|
||||
value: "Expected format: name@domain.fr"
|
6
config/locales/models/champs/email_champ/fr.yml
Normal file
6
config/locales/models/champs/email_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/email_champ:
|
||||
hints:
|
||||
value: "Format attendu : nom@domaine.fr"
|
6
config/locales/models/champs/epci_champ/en.yml
Normal file
6
config/locales/models/champs/epci_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/epci_champ:
|
||||
hints:
|
||||
value: "Enter the EPCI's department, then select the EPCI from the list."
|
6
config/locales/models/champs/epci_champ/fr.yml
Normal file
6
config/locales/models/champs/epci_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/epci_champ:
|
||||
hints:
|
||||
value: "Renseignez le département de l'EPCI puis, ensuite, sélectionnez l'EPCI dans la liste"
|
|
@ -6,4 +6,7 @@ en:
|
|||
attributes:
|
||||
value:
|
||||
invalid_iban: is not a valid IBAN
|
||||
|
||||
attributes:
|
||||
champs/iban_champ:
|
||||
hints:
|
||||
value: "Example (France) : FR76 1234 1234 1234 1234 1234 123"
|
||||
|
|
|
@ -6,3 +6,7 @@ fr:
|
|||
attributes:
|
||||
value:
|
||||
invalid_iban: n’est pas au format IBAN
|
||||
attributes:
|
||||
champs/iban_champ:
|
||||
hints:
|
||||
value: "Exemple (France) : FR76 1234 1234 1234 1234 1234 123"
|
||||
|
|
6
config/locales/models/champs/pays_champ/en.yml
Normal file
6
config/locales/models/champs/pays_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/pays_champ:
|
||||
hints:
|
||||
value: "Enter country"
|
6
config/locales/models/champs/pays_champ/fr.yml
Normal file
6
config/locales/models/champs/pays_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/pays_champ:
|
||||
hints:
|
||||
value: "Renseignez le pays"
|
6
config/locales/models/champs/phone_champ/en.yml
Normal file
6
config/locales/models/champs/phone_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/phone_champ:
|
||||
hints:
|
||||
value: "Phone number must be valid. Example : 0612345678"
|
6
config/locales/models/champs/phone_champ/fr.yml
Normal file
6
config/locales/models/champs/phone_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/phone_champ:
|
||||
hints:
|
||||
value: "Le numéro de téléphone saisi doit être valide. Exemple : 0612345678"
|
6
config/locales/models/champs/region_champ/en.yml
Normal file
6
config/locales/models/champs/region_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/region_champ:
|
||||
hints:
|
||||
value: "Enter region"
|
6
config/locales/models/champs/region_champ/fr.yml
Normal file
6
config/locales/models/champs/region_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/region_champ:
|
||||
hints:
|
||||
value: "Renseignez la région"
|
|
@ -8,3 +8,8 @@ en:
|
|||
association_date_creation: Creation date
|
||||
association_date_declaration: Declaration date
|
||||
association_date_publication: Publication date
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/rna_champ:
|
||||
hints:
|
||||
value: "Expected format : W123456789. Exemple : W503726238"
|
||||
|
|
|
@ -9,3 +9,8 @@ fr:
|
|||
association_date_creation: Date de création
|
||||
association_date_declaration: Date de déclaration
|
||||
association_date_publication: Date de publication
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/rna_champ:
|
||||
hints:
|
||||
value: "Format attendu : W123456789. Exemple : W503726238"
|
||||
|
|
6
config/locales/models/champs/siret_champ/en.yml
Normal file
6
config/locales/models/champs/siret_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/siret_champ:
|
||||
hints:
|
||||
value: "Enter 14 digits, no space. Example : 50000123456789"
|
6
config/locales/models/champs/siret_champ/fr.yml
Normal file
6
config/locales/models/champs/siret_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/siret_champ:
|
||||
hints:
|
||||
value: "Saisissez 14 chiffres sans espaces. Exemple : 50000123456789"
|
6
config/locales/models/champs/textarea_champ/en.yml
Normal file
6
config/locales/models/champs/textarea_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/textarea_champ:
|
||||
hints:
|
||||
value: "Resize the field to enter more lines"
|
6
config/locales/models/champs/textarea_champ/fr.yml
Normal file
6
config/locales/models/champs/textarea_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/textarea_champ:
|
||||
hints:
|
||||
value: "Redimensionnez le champ pour saisir plus de lignes"
|
6
config/locales/models/champs/titre_identite_champ/en.yml
Normal file
6
config/locales/models/champs/titre_identite_champ/en.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/titre_identite_champ:
|
||||
hints:
|
||||
value: "National identity card (front side only), passport, residency permit or other proof of identity."
|
6
config/locales/models/champs/titre_identite_champ/fr.yml
Normal file
6
config/locales/models/champs/titre_identite_champ/fr.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs/titre_identite_champ:
|
||||
hints:
|
||||
value: "Carte nationale d'identité (uniquement le recto), passeport, titre de séjour ou autre justificatif d’identité."
|
|
@ -30,9 +30,9 @@ describe 'shared/dossiers/edit', type: :view do
|
|||
let(:champ_phone) { create(:champ_phone, dossier: dossier) }
|
||||
let(:champs) { [champ_email, champ_phone] }
|
||||
|
||||
it "renders basic placeholders" do
|
||||
expect(subject).to have_css('input[type="email"][placeholder$="exemple.fr"]')
|
||||
expect(subject).to have_css('input[type="tel"][placeholder^="0612"]')
|
||||
it "does not render basic placeholders" do
|
||||
expect(subject).not_to have_css('input[type="email"][placeholder$="exemple.fr"]')
|
||||
expect(subject).not_to have_css('input[type="tel"][placeholder^="0612"]')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue