style(champ): add placeholders for email, iban, phone, siret champs

Closes #7428
This commit is contained in:
Colin Darie 2022-07-04 18:37:30 +02:00
parent 2d23215836
commit 9768f4e1c9
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
8 changed files with 38 additions and 11 deletions

View file

@ -1,5 +1,5 @@
= form.email_field :value,
id: champ.input_id,
aria: { describedby: champ.describedby_id },
placeholder: champ.libelle,
placeholder: t(".placeholder"),
required: champ.mandatory?

View file

@ -1,6 +1,6 @@
= form.text_field :value,
id: champ.input_id,
placeholder: "27 caractères au format FR7630006000011234567890189",
placeholder: t(".placeholder"),
required: champ.mandatory?,
aria: { describedby: champ.describedby_id },
data: { controller: 'iban-input'}

View file

@ -4,6 +4,6 @@
= form.phone_field :value,
id: champ.input_id,
aria: { describedby: champ.describedby_id },
placeholder: champ.libelle,
placeholder: t(".placeholder"),
required: champ.mandatory?,
pattern: "[^a-z^A-Z]+"

View file

@ -1,7 +1,7 @@
= form.text_field :value,
id: champ.input_id,
aria: { describedby: champ.describedby_id },
placeholder: champ.libelle,
placeholder: t(".placeholder"),
data: { controller: 'turbo-input', turbo_input_url_value: champs_siret_path(champ.id) },
required: champ.mandatory?,
pattern: "[0-9]{14}",

View file

@ -12,12 +12,20 @@ en:
numero_fiscal_notice: It is usually composed of 13 to 14 characters.
reference_avis_label: Tax notice reference
reference_avis_notice: It is usually composed of 13 to 14 characters.
pole_emploi:
identifiant_label: Identifier
identifiant_notice: It is usually composed of alphanumeric characters.
email:
placeholder: "camilya.martin@laposte.net"
iban:
placeholder: "FR76 3000 6000 0012 3456 7890 189"
mesri:
ine_label: INE
ine_notice: Student National Number. It is usually composed of alphanumeric characters.
phone:
placeholder: "0612345678"
pole_emploi:
identifiant_label: Identifier
identifiant_notice: It is usually composed of alphanumeric characters.
siret:
placeholder: "50000123456789"
header:
expires_at:
brouillon: "Expires on %{date} (%{duree_conservation_totale} months after this file was created)"

View file

@ -12,12 +12,20 @@ fr:
numero_fiscal_notice: Il est généralement composé de 13 ou 14 caractères.
reference_avis_label: La référence d'avis d'imposition
reference_avis_notice: Elle est généralement composée de 13 ou 14 caractères.
pole_emploi:
identifiant_label: Identifiant
identifiant_notice: Il est généralement composé de caractères alphanumériques.
email:
placeholder: "camilya.martin@laposte.net"
iban:
placeholder: "FR76 3000 6000 0012 3456 7890 189"
mesri:
ine_label: INE
ine_notice: Identifiant National Étudiant. Il est généralement composé de caractères alphanumériques.
phone:
placeholder: "0612345678"
pole_emploi:
identifiant_label: Identifiant
identifiant_notice: Il est généralement composé de caractères alphanumériques.
siret:
placeholder: "50000123456789"
header:
expires_at:
brouillon: "Expirera le %{date} (%{duree_conservation_totale} mois après la création du dossier)"

View file

@ -11,7 +11,7 @@ describe 'The user' do
fill_individual
# fill data
fill_in('text', with: 'super texte')
fill_in('text *', with: 'super texte')
fill_in('textarea', with: 'super textarea')
fill_in('date', with: '12-12-2012')
select_date_and_time(Time.zone.parse('06/01/2030 7h05'), form_id_for_datetime('datetime'))

View file

@ -23,6 +23,17 @@ describe 'shared/dossiers/edit.html.haml', type: :view do
expect(subject).to have_field(champ_dossier_link.libelle, with: champ_dossier_link.value)
expect(subject).to have_field(champ_textarea.libelle, with: champ_textarea.value)
end
context "with standard champs" do
let(:champ_email) { create(:champ_email, dossier: dossier) }
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$="laposte.net"]')
expect(subject).to have_css('input[type="tel"][placeholder^="0612"]')
end
end
end
context 'with a single-value list' do