Drop down other label set to 'Enter another option' instead of 'Other'

This commit is contained in:
Christian Lautier 2024-04-19 15:33:46 -10:00 committed by Paul Chavard
parent 4bd518f85e
commit 17bbc474ff
No known key found for this signature in database
6 changed files with 12 additions and 10 deletions

View file

@ -1,5 +1,5 @@
.drop_down_other.fr-mt-2w
.fr-input-group
%label.fr-label{ for: dom_id(@champ, :value_other) } Veuillez saisir votre autre choix
%label.fr-label{ for: dom_id(@champ, :value_other) }
= t('shared.champs.drop_down_list.other_label')
= @form.text_field :value_other, maxlength: 200, size: nil, id: dom_id(@champ, :value_other), class: 'fr-input'

View file

@ -134,7 +134,7 @@ ignore_unused:
## Ignore these keys completely:
ignore:
- 'shared.champs.drop_down_list{,.other}' # pluralization "other" false positive
- 'shared.champs.drop_down_list{,.other,.other_label}' # pluralization "other" false positive
## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
## e.g. in case of a relative key defined in a helper method.

View file

@ -53,4 +53,5 @@ en:
data_fetched: "Data concerning %{sources} linked to the INE %{ine} has been received from the MESRI."
data_fetched_title: "Data received from the MESRI"
drop_down_list:
other: Other
other: Enter another option
other_label: Enter your option

View file

@ -55,4 +55,5 @@ fr:
data_fetched: "Des données concernant %{sources} liées à lINE %{ine} ont été reçues depuis le MESRI."
data_fetched_title: "Données obtenues du MESRI"
drop_down_list:
other: Autre
other: Entrer une autre option
other_label: Saisir votre option

View file

@ -77,7 +77,7 @@ describe Logic::ChampValue do
let(:drop_down_other) { true }
it { is_expected.to eq('val1') }
it { expect(champ_value(champ.stable_id).options([champ.type_de_champ])).to match_array([["val1", "val1"], ["val2", "val2"], ["val3", "val3"], ["Autre", "__other__"]]) }
it { expect(champ_value(champ.stable_id).options([champ.type_de_champ])).to match_array([["val1", "val1"], ["val2", "val2"], ["val3", "val3"], [I18n.t('shared.champs.drop_down_list.other'), "__other__"]]) }
context 'with other filled' do
let(:other) { true }

View file

@ -25,15 +25,15 @@ describe 'dropdown list with other option activated', js: true do
scenario 'Select other option and the other input hidden must appear' do
fill_individual
choose "Autre"
choose I18n.t('shared.champs.drop_down_list.other')
expect(page).to have_selector('.drop_down_other', visible: true)
end
scenario "Getting back from other save the new option" do
fill_individual
choose "Autre"
fill_in("Veuillez saisir votre autre choix", with: "My choice")
choose I18n.t('shared.champs.drop_down_list.other')
fill_in(I18n.t('shared.champs.drop_down_list.other_label'), with: "My choice")
wait_until { user_dossier.champs_public.first.value == "My choice" }
expect(user_dossier.champs_public.first.value).to eq("My choice")
@ -62,7 +62,7 @@ describe 'dropdown list with other option activated', js: true do
fill_individual
expect(page).not_to have_selector(".drop_down_other input")
select("Autre")
select(I18n.t('shared.champs.drop_down_list.other'))
find(".drop_down_other input", visible: true)
select("Secondary 1.2")