allow siret prefilling

This commit is contained in:
Sébastien Carceles 2023-01-11 10:45:54 +01:00 committed by sebastiencarceles
parent 88136daf14
commit 3eb76d8a43
5 changed files with 7 additions and 3 deletions

View file

@ -272,7 +272,8 @@ class TypeDeChamp < ApplicationRecord
TypeDeChamp.type_champs.fetch(:drop_down_list),
TypeDeChamp.type_champs.fetch(:repetition),
TypeDeChamp.type_champs.fetch(:multiple_drop_down_list),
TypeDeChamp.type_champs.fetch(:epci)
TypeDeChamp.type_champs.fetch(:epci),
TypeDeChamp.type_champs.fetch(:siret)
])
end

View file

@ -136,6 +136,7 @@ en:
date_html: ISO8601 date
datetime_html: ISO8601 datetime
drop_down_list_other_html: Any value
siret_html: A SIRET number
repetition_html: A array of hashes with possible values for each field of the repetition.
epci_html: An array of the department code and the <a href="https://geo.api.gouv.fr/epcis" target="_blank" rel="noopener noreferrer">EPCI one</a>.
examples:
@ -154,6 +155,7 @@ en:
date: "2023-02-01"
datetime: "2023-02-01T10:30"
checkbox: "true"
siret: 828212345600023
prefill_link_title: Prefill link (GET)
prefill_link_info: Use the button to copy the link, then remplace the values with your data.
prefill_link_too_long: Warning, the prefill link is too long and may not work on all browsers.

View file

@ -127,6 +127,7 @@ fr:
datetime_html: Datetime au format ISO8601
date_html: Date au format ISO8601
drop_down_list_other_html: Toute valeur
siret_html: Un numéro de SIRET
repetition_html: Un tableau de dictionnaires avec les valeurs possibles pour chaque champ de la répétition.
epci_html: Un tableau contenant le code de département et <a href="https://geo.api.gouv.fr/epcis" target="_blank" rel="noopener noreferrer">celui de l'EPCI</a>.
examples:
@ -146,6 +147,7 @@ fr:
date: "2023-02-01"
datetime: "2023-02-01T10:30"
checkbox: "true"
siret: 82812345600023
prefill_link_title: Lien de préremplissage (GET)
prefill_link_info: Copiez le lien grâce au bouton ci-dessous et remplacez les valeurs par les données dont vous disposez.
prefill_link_too_long: Attention, ce lien de préremplissage est trop long et risque de ne pas fonctionner sur certains navigateurs.

View file

@ -217,7 +217,6 @@ RSpec.describe PrefillParams do
it_behaves_like "a champ public value that is unauthorized", :regions, "value"
it_behaves_like "a champ public value that is unauthorized", :departements, "value"
it_behaves_like "a champ public value that is unauthorized", :communes, "value"
it_behaves_like "a champ public value that is unauthorized", :siret, "value"
it_behaves_like "a champ public value that is unauthorized", :rna, "value"
it_behaves_like "a champ public value that is unauthorized", :annuaire_education, "value"
it_behaves_like "a champ public value that is unauthorized", :multiple_drop_down_list, ["value"]

View file

@ -255,6 +255,7 @@ describe TypeDeChamp do
it_behaves_like "a prefillable type de champ", :type_de_champ_repetition
it_behaves_like "a prefillable type de champ", :type_de_champ_multiple_drop_down_list
it_behaves_like "a prefillable type de champ", :type_de_champ_epci
it_behaves_like "a prefillable type de champ", :type_de_champ_siret
it_behaves_like "a non-prefillable type de champ", :type_de_champ_number
it_behaves_like "a non-prefillable type de champ", :type_de_champ_dossier_link
@ -269,7 +270,6 @@ describe TypeDeChamp do
it_behaves_like "a non-prefillable type de champ", :type_de_champ_mesri
it_behaves_like "a non-prefillable type de champ", :type_de_champ_carte
it_behaves_like "a non-prefillable type de champ", :type_de_champ_address
it_behaves_like "a non-prefillable type de champ", :type_de_champ_siret
it_behaves_like "a non-prefillable type de champ", :type_de_champ_rna
it_behaves_like "a non-prefillable type de champ", :type_de_champ_annuaire_education
end