From b20c2b91fdd865a08938110e1a6fa17880ffcd9f Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 11:03:08 +0200 Subject: [PATCH 01/12] add hints to champs --- config/locales/models/champs/address_champ/fr.yml | 6 ++++++ config/locales/models/champs/commune_champ/fr.yml | 6 ++++++ config/locales/models/champs/date_champ/fr.yml | 6 ++++++ config/locales/models/champs/datetime_champ/fr.yml | 3 +-- config/locales/models/champs/decimal_number_champ/fr.yml | 6 ++++++ config/locales/models/champs/departement_champ/fr.yml | 6 ++++++ config/locales/models/champs/email_champ/fr.yml | 6 ++++++ config/locales/models/champs/epci_champ/fr.yml | 6 ++++++ config/locales/models/champs/iban_champ/fr.yml | 4 ++++ config/locales/models/champs/pays_champ/fr.yml | 6 ++++++ config/locales/models/champs/phone_champ/fr.yml | 6 ++++++ config/locales/models/champs/region_champ/fr.yml | 6 ++++++ config/locales/models/champs/rna_champ/fr.yml | 5 +++++ config/locales/models/champs/siret_champ/fr.yml | 6 ++++++ config/locales/models/champs/textarea_champ/fr.yml | 6 ++++++ 15 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 config/locales/models/champs/address_champ/fr.yml create mode 100644 config/locales/models/champs/commune_champ/fr.yml create mode 100644 config/locales/models/champs/date_champ/fr.yml create mode 100644 config/locales/models/champs/decimal_number_champ/fr.yml create mode 100644 config/locales/models/champs/departement_champ/fr.yml create mode 100644 config/locales/models/champs/email_champ/fr.yml create mode 100644 config/locales/models/champs/epci_champ/fr.yml create mode 100644 config/locales/models/champs/pays_champ/fr.yml create mode 100644 config/locales/models/champs/phone_champ/fr.yml create mode 100644 config/locales/models/champs/region_champ/fr.yml create mode 100644 config/locales/models/champs/siret_champ/fr.yml create mode 100644 config/locales/models/champs/textarea_champ/fr.yml diff --git a/config/locales/models/champs/address_champ/fr.yml b/config/locales/models/champs/address_champ/fr.yml new file mode 100644 index 000000000..1af76dbce --- /dev/null +++ b/config/locales/models/champs/address_champ/fr.yml @@ -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" diff --git a/config/locales/models/champs/commune_champ/fr.yml b/config/locales/models/champs/commune_champ/fr.yml new file mode 100644 index 000000000..bf5e4954c --- /dev/null +++ b/config/locales/models/champs/commune_champ/fr.yml @@ -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" diff --git a/config/locales/models/champs/date_champ/fr.yml b/config/locales/models/champs/date_champ/fr.yml new file mode 100644 index 000000000..200ea9bc0 --- /dev/null +++ b/config/locales/models/champs/date_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/date_champ: + hints: + value: "Format attendu : JJ/MM/AAAA. Exemple : 15/01/2022" diff --git a/config/locales/models/champs/datetime_champ/fr.yml b/config/locales/models/champs/datetime_champ/fr.yml index 1035c03d8..bbfae0710 100644 --- a/config/locales/models/champs/datetime_champ/fr.yml +++ b/config/locales/models/champs/datetime_champ/fr.yml @@ -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" diff --git a/config/locales/models/champs/decimal_number_champ/fr.yml b/config/locales/models/champs/decimal_number_champ/fr.yml new file mode 100644 index 000000000..69f0f20c7 --- /dev/null +++ b/config/locales/models/champs/decimal_number_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/decimal_number_champ: + hints: + value: "Vous pouvez saisir jusqu’à 3 décimales après la virgule" diff --git a/config/locales/models/champs/departement_champ/fr.yml b/config/locales/models/champs/departement_champ/fr.yml new file mode 100644 index 000000000..91ed7f0df --- /dev/null +++ b/config/locales/models/champs/departement_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/departement_champ: + hints: + value: "Renseignez le code ou le nom du département" diff --git a/config/locales/models/champs/email_champ/fr.yml b/config/locales/models/champs/email_champ/fr.yml new file mode 100644 index 000000000..98e47d929 --- /dev/null +++ b/config/locales/models/champs/email_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/email_champ: + hints: + value: "Format attendu : nom@domaine.fr" diff --git a/config/locales/models/champs/epci_champ/fr.yml b/config/locales/models/champs/epci_champ/fr.yml new file mode 100644 index 000000000..3f57d1190 --- /dev/null +++ b/config/locales/models/champs/epci_champ/fr.yml @@ -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" diff --git a/config/locales/models/champs/iban_champ/fr.yml b/config/locales/models/champs/iban_champ/fr.yml index 5d14ed4f6..fe76e8406 100644 --- a/config/locales/models/champs/iban_champ/fr.yml +++ b/config/locales/models/champs/iban_champ/fr.yml @@ -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" diff --git a/config/locales/models/champs/pays_champ/fr.yml b/config/locales/models/champs/pays_champ/fr.yml new file mode 100644 index 000000000..0366209ef --- /dev/null +++ b/config/locales/models/champs/pays_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/pays_champ: + hints: + value: "Renseignez le pays" diff --git a/config/locales/models/champs/phone_champ/fr.yml b/config/locales/models/champs/phone_champ/fr.yml new file mode 100644 index 000000000..55d6a93d6 --- /dev/null +++ b/config/locales/models/champs/phone_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/phone_champ: + hints: + value: "Le numéro de téléphone saisi doit être valide" diff --git a/config/locales/models/champs/region_champ/fr.yml b/config/locales/models/champs/region_champ/fr.yml new file mode 100644 index 000000000..b1a78f7b4 --- /dev/null +++ b/config/locales/models/champs/region_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/region_champ: + hints: + value: "Renseignez la région" diff --git a/config/locales/models/champs/rna_champ/fr.yml b/config/locales/models/champs/rna_champ/fr.yml index 08160f243..52bf93d17 100644 --- a/config/locales/models/champs/rna_champ/fr.yml +++ b/config/locales/models/champs/rna_champ/fr.yml @@ -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" diff --git a/config/locales/models/champs/siret_champ/fr.yml b/config/locales/models/champs/siret_champ/fr.yml new file mode 100644 index 000000000..bc4063e55 --- /dev/null +++ b/config/locales/models/champs/siret_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/siret_champ: + hints: + value: "Saisissez 14 chiffres sans espaces" diff --git a/config/locales/models/champs/textarea_champ/fr.yml b/config/locales/models/champs/textarea_champ/fr.yml new file mode 100644 index 000000000..2738d9be7 --- /dev/null +++ b/config/locales/models/champs/textarea_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/textarea_champ: + hints: + value: "Redimensionnez le champ pour saisir plus de lignes" From 9c2c3785887e2c27b4c64c1477aeaebeead730b9 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 14:11:40 +0200 Subject: [PATCH 02/12] use model locales for titre identite hint --- .../champ_label_content_component.en.yml | 1 - .../champ_label_content_component.fr.yml | 1 - .../champ_label_content_component.html.haml | 3 --- .../editable_champ_component.en.yml | 4 ---- .../editable_champ_component.fr.yml | 3 --- config/locales/models/champs/titre_identite_champ/en.yml | 6 ++++++ config/locales/models/champs/titre_identite_champ/fr.yml | 6 ++++++ 7 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 app/components/editable_champ/editable_champ_component/editable_champ_component.en.yml delete mode 100644 app/components/editable_champ/editable_champ_component/editable_champ_component.fr.yml create mode 100644 config/locales/models/champs/titre_identite_champ/en.yml create mode 100644 config/locales/models/champs/titre_identite_champ/fr.yml diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml index fbbc60b2e..1464f7d03 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.en.yml @@ -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. diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml index d129bfa1e..7ec2075a3 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.fr.yml @@ -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é. diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml index bfa3148f3..f83359ec7 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml @@ -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 diff --git a/app/components/editable_champ/editable_champ_component/editable_champ_component.en.yml b/app/components/editable_champ/editable_champ_component/editable_champ_component.en.yml deleted file mode 100644 index e944e6ca5..000000000 --- a/app/components/editable_champ/editable_champ_component/editable_champ_component.en.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -en: - titre_identite_notice: National identity card (front side only), passport, residency permit or other proof of identity. - diff --git a/app/components/editable_champ/editable_champ_component/editable_champ_component.fr.yml b/app/components/editable_champ/editable_champ_component/editable_champ_component.fr.yml deleted file mode 100644 index dc1731448..000000000 --- a/app/components/editable_champ/editable_champ_component/editable_champ_component.fr.yml +++ /dev/null @@ -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é. diff --git a/config/locales/models/champs/titre_identite_champ/en.yml b/config/locales/models/champs/titre_identite_champ/en.yml new file mode 100644 index 000000000..07d521749 --- /dev/null +++ b/config/locales/models/champs/titre_identite_champ/en.yml @@ -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." diff --git a/config/locales/models/champs/titre_identite_champ/fr.yml b/config/locales/models/champs/titre_identite_champ/fr.yml new file mode 100644 index 000000000..0b990458a --- /dev/null +++ b/config/locales/models/champs/titre_identite_champ/fr.yml @@ -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é." From e972514ec6c3495ce52e75eaeaff379f7291bf1e Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 14:12:35 +0200 Subject: [PATCH 03/12] remove useless blank line --- .../titre_identite_component/titre_identite_component.html.haml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/components/editable_champ/titre_identite_component/titre_identite_component.html.haml b/app/components/editable_champ/titre_identite_component/titre_identite_component.html.haml index 778ce957c..22f93966c 100644 --- a/app/components/editable_champ/titre_identite_component/titre_identite_component.html.haml +++ b/app/components/editable_champ/titre_identite_component/titre_identite_component.html.haml @@ -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, From 3ff7bc72346d0659818e5fa9491f82f31fc56e5c Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 14:32:09 +0200 Subject: [PATCH 04/12] display max size and format as hint --- .../attachment/edit_component/edit_component.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/attachment/edit_component/edit_component.html.haml b/app/components/attachment/edit_component/edit_component.html.haml index 116271c19..8c3b9fb71 100644 --- a/app/components/attachment/edit_component/edit_component.html.haml +++ b/app/components/attachment/edit_component/edit_component.html.haml @@ -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 From 1af3b035ac84f8c1fd5833d39e25a1c4721aa3dd Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 15:33:48 +0200 Subject: [PATCH 05/12] add en locales for champs --- config/locales/models/champs/address_champ/en.yml | 6 ++++++ config/locales/models/champs/commune_champ/en.yml | 6 ++++++ config/locales/models/champs/date_champ/en.yml | 6 ++++++ config/locales/models/champs/datetime_champ/en.yml | 3 +-- config/locales/models/champs/decimal_number_champ/en.yml | 6 ++++++ config/locales/models/champs/departement_champ/en.yml | 6 ++++++ config/locales/models/champs/email_champ/en.yml | 6 ++++++ config/locales/models/champs/epci_champ/en.yml | 6 ++++++ config/locales/models/champs/iban_champ/en.yml | 5 ++++- config/locales/models/champs/pays_champ/en.yml | 6 ++++++ config/locales/models/champs/phone_champ/en.yml | 6 ++++++ config/locales/models/champs/region_champ/en.yml | 6 ++++++ config/locales/models/champs/rna_champ/en.yml | 5 +++++ config/locales/models/champs/siret_champ/en.yml | 6 ++++++ config/locales/models/champs/textarea_champ/en.yml | 6 ++++++ 15 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 config/locales/models/champs/address_champ/en.yml create mode 100644 config/locales/models/champs/commune_champ/en.yml create mode 100644 config/locales/models/champs/date_champ/en.yml create mode 100644 config/locales/models/champs/decimal_number_champ/en.yml create mode 100644 config/locales/models/champs/departement_champ/en.yml create mode 100644 config/locales/models/champs/email_champ/en.yml create mode 100644 config/locales/models/champs/epci_champ/en.yml create mode 100644 config/locales/models/champs/pays_champ/en.yml create mode 100644 config/locales/models/champs/phone_champ/en.yml create mode 100644 config/locales/models/champs/region_champ/en.yml create mode 100644 config/locales/models/champs/siret_champ/en.yml create mode 100644 config/locales/models/champs/textarea_champ/en.yml diff --git a/config/locales/models/champs/address_champ/en.yml b/config/locales/models/champs/address_champ/en.yml new file mode 100644 index 000000000..ad556e5de --- /dev/null +++ b/config/locales/models/champs/address_champ/en.yml @@ -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" diff --git a/config/locales/models/champs/commune_champ/en.yml b/config/locales/models/champs/commune_champ/en.yml new file mode 100644 index 000000000..552a75a34 --- /dev/null +++ b/config/locales/models/champs/commune_champ/en.yml @@ -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" diff --git a/config/locales/models/champs/date_champ/en.yml b/config/locales/models/champs/date_champ/en.yml new file mode 100644 index 000000000..0e0a37607 --- /dev/null +++ b/config/locales/models/champs/date_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/date_champ: + hints: + value: "Expected format: mm/dd/yyyy. Example: 01/15/2022" diff --git a/config/locales/models/champs/datetime_champ/en.yml b/config/locales/models/champs/datetime_champ/en.yml index eb0b92533..c91082766 100644 --- a/config/locales/models/champs/datetime_champ/en.yml +++ b/config/locales/models/champs/datetime_champ/en.yml @@ -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" diff --git a/config/locales/models/champs/decimal_number_champ/en.yml b/config/locales/models/champs/decimal_number_champ/en.yml new file mode 100644 index 000000000..ed6804653 --- /dev/null +++ b/config/locales/models/champs/decimal_number_champ/en.yml @@ -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" diff --git a/config/locales/models/champs/departement_champ/en.yml b/config/locales/models/champs/departement_champ/en.yml new file mode 100644 index 000000000..0db2840d5 --- /dev/null +++ b/config/locales/models/champs/departement_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/departement_champ: + hints: + value: "Enter department code or name" diff --git a/config/locales/models/champs/email_champ/en.yml b/config/locales/models/champs/email_champ/en.yml new file mode 100644 index 000000000..887eef21f --- /dev/null +++ b/config/locales/models/champs/email_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/email_champ: + hints: + value: "Expected format: name@domain.fr" diff --git a/config/locales/models/champs/epci_champ/en.yml b/config/locales/models/champs/epci_champ/en.yml new file mode 100644 index 000000000..3495d8ca2 --- /dev/null +++ b/config/locales/models/champs/epci_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/epci_champ: + hints: + value: "Enter the EPCI's department, then select the EPCI from the list." diff --git a/config/locales/models/champs/iban_champ/en.yml b/config/locales/models/champs/iban_champ/en.yml index 9623eea19..9761a5a3a 100644 --- a/config/locales/models/champs/iban_champ/en.yml +++ b/config/locales/models/champs/iban_champ/en.yml @@ -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" diff --git a/config/locales/models/champs/pays_champ/en.yml b/config/locales/models/champs/pays_champ/en.yml new file mode 100644 index 000000000..8620ab898 --- /dev/null +++ b/config/locales/models/champs/pays_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/pays_champ: + hints: + value: "Enter country" diff --git a/config/locales/models/champs/phone_champ/en.yml b/config/locales/models/champs/phone_champ/en.yml new file mode 100644 index 000000000..e12f59e2a --- /dev/null +++ b/config/locales/models/champs/phone_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/phone_champ: + hints: + value: "Phone number must be valid" diff --git a/config/locales/models/champs/region_champ/en.yml b/config/locales/models/champs/region_champ/en.yml new file mode 100644 index 000000000..b26e9d33b --- /dev/null +++ b/config/locales/models/champs/region_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/region_champ: + hints: + value: "Enter region" diff --git a/config/locales/models/champs/rna_champ/en.yml b/config/locales/models/champs/rna_champ/en.yml index 281e52641..3ac9e32ab 100644 --- a/config/locales/models/champs/rna_champ/en.yml +++ b/config/locales/models/champs/rna_champ/en.yml @@ -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" diff --git a/config/locales/models/champs/siret_champ/en.yml b/config/locales/models/champs/siret_champ/en.yml new file mode 100644 index 000000000..26ab16106 --- /dev/null +++ b/config/locales/models/champs/siret_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/siret_champ: + hints: + value: "Enter 14 digits, no space" diff --git a/config/locales/models/champs/textarea_champ/en.yml b/config/locales/models/champs/textarea_champ/en.yml new file mode 100644 index 000000000..95f01c0a0 --- /dev/null +++ b/config/locales/models/champs/textarea_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/textarea_champ: + hints: + value: "Resize the field to enter more lines" From ae08f044ed667e8003a0463ad4c39615b37d088c Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 16:25:08 +0200 Subject: [PATCH 06/12] remove placeholder for email component --- .../editable_champ/email_component/email_component.en.yml | 3 --- .../editable_champ/email_component/email_component.fr.yml | 3 --- .../editable_champ/email_component/email_component.html.haml | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 app/components/editable_champ/email_component/email_component.en.yml delete mode 100644 app/components/editable_champ/email_component/email_component.fr.yml diff --git a/app/components/editable_champ/email_component/email_component.en.yml b/app/components/editable_champ/email_component/email_component.en.yml deleted file mode 100644 index 9b0cf94b2..000000000 --- a/app/components/editable_champ/email_component/email_component.en.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -en: - placeholder: "camilya.martin@exemple.fr" diff --git a/app/components/editable_champ/email_component/email_component.fr.yml b/app/components/editable_champ/email_component/email_component.fr.yml deleted file mode 100644 index 1feea0e6b..000000000 --- a/app/components/editable_champ/email_component/email_component.fr.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -fr: - placeholder: "camilya.martin@exemple.fr" diff --git a/app/components/editable_champ/email_component/email_component.html.haml b/app/components/editable_champ/email_component/email_component.html.haml index 9f77ce08a..95fd3a476 100644 --- a/app/components/editable_champ/email_component/email_component.html.haml +++ b/app/components/editable_champ/email_component/email_component.html.haml @@ -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?)) From bd3f7eeb3804e7b4e3658ea3cab19f65b8fba02e Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 16:40:33 +0200 Subject: [PATCH 07/12] remove placeholder for siret component --- .../editable_champ/siret_component/siret_component.en.yml | 1 - .../editable_champ/siret_component/siret_component.fr.yml | 1 - .../editable_champ/siret_component/siret_component.html.haml | 2 +- config/locales/models/champs/siret_champ/en.yml | 2 +- config/locales/models/champs/siret_champ/fr.yml | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/components/editable_champ/siret_component/siret_component.en.yml b/app/components/editable_champ/siret_component/siret_component.en.yml index 11d21a902..7d0cdc092 100644 --- a/app/components/editable_champ/siret_component/siret_component.en.yml +++ b/app/components/editable_champ/siret_component/siret_component.en.yml @@ -1,4 +1,3 @@ --- en: - placeholder: "50000123456789" title: "The SIRET number must have exactly 14 digits" diff --git a/app/components/editable_champ/siret_component/siret_component.fr.yml b/app/components/editable_champ/siret_component/siret_component.fr.yml index 3bb1b86c3..6231d97ad 100644 --- a/app/components/editable_champ/siret_component/siret_component.fr.yml +++ b/app/components/editable_champ/siret_component/siret_component.fr.yml @@ -1,4 +1,3 @@ --- fr: - placeholder: "50000123456789" title: "Le numéro de SIRET doit comporter exactement 14 chiffres" diff --git a/app/components/editable_champ/siret_component/siret_component.html.haml b/app/components/editable_champ/siret_component/siret_component.html.haml index 29a131b71..4f052b2f1 100644 --- a/app/components/editable_champ/siret_component/siret_component.html.haml +++ b/app/components/editable_champ/siret_component/siret_component.html.haml @@ -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) diff --git a/config/locales/models/champs/siret_champ/en.yml b/config/locales/models/champs/siret_champ/en.yml index 26ab16106..4fa59a07e 100644 --- a/config/locales/models/champs/siret_champ/en.yml +++ b/config/locales/models/champs/siret_champ/en.yml @@ -3,4 +3,4 @@ en: attributes: champs/siret_champ: hints: - value: "Enter 14 digits, no space" + value: "Enter 14 digits, no space. Example : 50000123456789" diff --git a/config/locales/models/champs/siret_champ/fr.yml b/config/locales/models/champs/siret_champ/fr.yml index bc4063e55..2c8f73bdc 100644 --- a/config/locales/models/champs/siret_champ/fr.yml +++ b/config/locales/models/champs/siret_champ/fr.yml @@ -3,4 +3,4 @@ fr: attributes: champs/siret_champ: hints: - value: "Saisissez 14 chiffres sans espaces" + value: "Saisissez 14 chiffres sans espaces. Exemple : 50000123456789" From 8bacb30e366966828ad48a3e51475d3a10ee8db7 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 16:46:25 +0200 Subject: [PATCH 08/12] remove placeholder for iban component --- .../editable_champ/iban_component/iban_component.en.yml | 3 --- .../editable_champ/iban_component/iban_component.fr.yml | 3 --- .../editable_champ/iban_component/iban_component.html.haml | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 app/components/editable_champ/iban_component/iban_component.en.yml delete mode 100644 app/components/editable_champ/iban_component/iban_component.fr.yml diff --git a/app/components/editable_champ/iban_component/iban_component.en.yml b/app/components/editable_champ/iban_component/iban_component.en.yml deleted file mode 100644 index 3ebc9472c..000000000 --- a/app/components/editable_champ/iban_component/iban_component.en.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -en: - placeholder: "FR76 3000 6000 0012 3456 7890 189" diff --git a/app/components/editable_champ/iban_component/iban_component.fr.yml b/app/components/editable_champ/iban_component/iban_component.fr.yml deleted file mode 100644 index 91bce885f..000000000 --- a/app/components/editable_champ/iban_component/iban_component.fr.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -fr: - placeholder: "FR76 3000 6000 0012 3456 7890 189" diff --git a/app/components/editable_champ/iban_component/iban_component.html.haml b/app/components/editable_champ/iban_component/iban_component.html.haml index 3c2bc8425..011acc371 100644 --- a/app/components/editable_champ/iban_component/iban_component.html.haml +++ b/app/components/editable_champ/iban_component/iban_component.html.haml @@ -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 From 18e5c32363e6b6653bbad798772c070faa13df1a Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 16:55:27 +0200 Subject: [PATCH 09/12] remove placehoder for rna component --- .../editable_champ/rna_component/rna_component.en.yml | 1 - .../editable_champ/rna_component/rna_component.fr.yml | 1 - .../editable_champ/rna_component/rna_component.html.haml | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/components/editable_champ/rna_component/rna_component.en.yml b/app/components/editable_champ/rna_component/rna_component.en.yml index 795d75d07..464a41d85 100644 --- a/app/components/editable_champ/rna_component/rna_component.en.yml +++ b/app/components/editable_champ/rna_component/rna_component.en.yml @@ -1,4 +1,3 @@ --- en: - placeholder: "W503726238" title: "The RNA number must begin with a capital W followed by 9 digits" diff --git a/app/components/editable_champ/rna_component/rna_component.fr.yml b/app/components/editable_champ/rna_component/rna_component.fr.yml index 4099fff5c..993e5d6b3 100644 --- a/app/components/editable_champ/rna_component/rna_component.fr.yml +++ b/app/components/editable_champ/rna_component/rna_component.fr.yml @@ -1,4 +1,3 @@ --- fr: - placeholder: "W503726238" title: "Le numéro RNA doit commencer par un W majuscule suivi de 9 chiffres" diff --git a/app/components/editable_champ/rna_component/rna_component.html.haml b/app/components/editable_champ/rna_component/rna_component.html.haml index b57423b27..ee1a5eba2 100644 --- a/app/components/editable_champ/rna_component/rna_component.html.haml +++ b/app/components/editable_champ/rna_component/rna_component.html.haml @@ -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 From 168616b8c64dad1ea6c0bc464c200bee2fc266aa Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 16:59:34 +0200 Subject: [PATCH 10/12] remove placeholder for phone component --- .../editable_champ/phone_component/phone_component.en.yml | 3 --- .../editable_champ/phone_component/phone_component.fr.yml | 3 --- .../editable_champ/phone_component/phone_component.html.haml | 2 +- config/locales/models/champs/phone_champ/en.yml | 2 +- config/locales/models/champs/phone_champ/fr.yml | 2 +- 5 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 app/components/editable_champ/phone_component/phone_component.en.yml delete mode 100644 app/components/editable_champ/phone_component/phone_component.fr.yml diff --git a/app/components/editable_champ/phone_component/phone_component.en.yml b/app/components/editable_champ/phone_component/phone_component.en.yml deleted file mode 100644 index d16bb25d2..000000000 --- a/app/components/editable_champ/phone_component/phone_component.en.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -en: - placeholder: "0612345678" diff --git a/app/components/editable_champ/phone_component/phone_component.fr.yml b/app/components/editable_champ/phone_component/phone_component.fr.yml deleted file mode 100644 index 6c86da5ab..000000000 --- a/app/components/editable_champ/phone_component/phone_component.fr.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -fr: - placeholder: "0612345678" diff --git a/app/components/editable_champ/phone_component/phone_component.html.haml b/app/components/editable_champ/phone_component/phone_component.html.haml index d9b079783..79ffaca84 100644 --- a/app/components/editable_champ/phone_component/phone_component.html.haml +++ b/app/components/editable_champ/phone_component/phone_component.html.haml @@ -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]+")) diff --git a/config/locales/models/champs/phone_champ/en.yml b/config/locales/models/champs/phone_champ/en.yml index e12f59e2a..c475c4f94 100644 --- a/config/locales/models/champs/phone_champ/en.yml +++ b/config/locales/models/champs/phone_champ/en.yml @@ -3,4 +3,4 @@ en: attributes: champs/phone_champ: hints: - value: "Phone number must be valid" + value: "Phone number must be valid. Example : 0612345678" diff --git a/config/locales/models/champs/phone_champ/fr.yml b/config/locales/models/champs/phone_champ/fr.yml index 55d6a93d6..9cfda3470 100644 --- a/config/locales/models/champs/phone_champ/fr.yml +++ b/config/locales/models/champs/phone_champ/fr.yml @@ -3,4 +3,4 @@ fr: attributes: champs/phone_champ: hints: - value: "Le numéro de téléphone saisi doit être valide" + value: "Le numéro de téléphone saisi doit être valide. Exemple : 0612345678" From abad463bb105a3b7e8e1a849681419840f9728e8 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 17:05:04 +0200 Subject: [PATCH 11/12] remove placeholder for decimal number component --- .../decimal_number_component/decimal_number_component.html.haml | 2 +- config/locales/models/champs/decimal_number_champ/en.yml | 2 +- config/locales/models/champs/decimal_number_champ/fr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/editable_champ/decimal_number_component/decimal_number_component.html.haml b/app/components/editable_champ/decimal_number_component/decimal_number_component.html.haml index 0c9c6c0d7..3be6fd3eb 100644 --- a/app/components/editable_champ/decimal_number_component/decimal_number_component.html.haml +++ b/app/components/editable_champ/decimal_number_component/decimal_number_component.html.haml @@ -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?)) diff --git a/config/locales/models/champs/decimal_number_champ/en.yml b/config/locales/models/champs/decimal_number_champ/en.yml index ed6804653..a597a4b92 100644 --- a/config/locales/models/champs/decimal_number_champ/en.yml +++ b/config/locales/models/champs/decimal_number_champ/en.yml @@ -3,4 +3,4 @@ en: attributes: champs/decimal_number_champ: hints: - value: "You can enter up to 3 decimal places after the decimal point" + value: "You can enter up to 3 decimal places after the decimal point. Exemple: 3.14" diff --git a/config/locales/models/champs/decimal_number_champ/fr.yml b/config/locales/models/champs/decimal_number_champ/fr.yml index 69f0f20c7..3b6879514 100644 --- a/config/locales/models/champs/decimal_number_champ/fr.yml +++ b/config/locales/models/champs/decimal_number_champ/fr.yml @@ -3,4 +3,4 @@ fr: attributes: champs/decimal_number_champ: hints: - value: "Vous pouvez saisir jusqu’à 3 décimales après la virgule" + value: "Vous pouvez saisir jusqu’à 3 décimales après la virgule. Exemple: 3,14" From 08363546d57f449501704141e5c1ec8eadb5a6df Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 25 Sep 2023 18:01:54 +0200 Subject: [PATCH 12/12] update spec for placeholder --- spec/views/shared/dossiers/_edit.html.haml_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/views/shared/dossiers/_edit.html.haml_spec.rb b/spec/views/shared/dossiers/_edit.html.haml_spec.rb index 9987ad34c..269389c41 100644 --- a/spec/views/shared/dossiers/_edit.html.haml_spec.rb +++ b/spec/views/shared/dossiers/_edit.html.haml_spec.rb @@ -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