diff --git a/app/models/types_de_champ/prefill_drop_down_list_type_de_champ.rb b/app/models/types_de_champ/prefill_drop_down_list_type_de_champ.rb index 648f2d17e..6930905e7 100644 --- a/app/models/types_de_champ/prefill_drop_down_list_type_de_champ.rb +++ b/app/models/types_de_champ/prefill_drop_down_list_type_de_champ.rb @@ -1,5 +1,5 @@ class TypesDeChamp::PrefillDropDownListTypeDeChamp < TypesDeChamp::PrefillTypeDeChamp - def possible_values_list + def all_possible_values if drop_down_other? drop_down_list_enabled_non_empty_options.insert( 0, @@ -11,6 +11,6 @@ class TypesDeChamp::PrefillDropDownListTypeDeChamp < TypesDeChamp::PrefillTypeDe end def example_value - possible_values_list.first + all_possible_values.first end end diff --git a/app/models/types_de_champ/prefill_pays_type_de_champ.rb b/app/models/types_de_champ/prefill_pays_type_de_champ.rb index a5e6aad21..9279b2f97 100644 --- a/app/models/types_de_champ/prefill_pays_type_de_champ.rb +++ b/app/models/types_de_champ/prefill_pays_type_de_champ.rb @@ -1,5 +1,5 @@ class TypesDeChamp::PrefillPaysTypeDeChamp < TypesDeChamp::PrefillTypeDeChamp - def possible_values_list + def all_possible_values countries.map { |country| "#{country[:code]} (#{country[:name]})" } end diff --git a/app/models/types_de_champ/prefill_region_type_de_champ.rb b/app/models/types_de_champ/prefill_region_type_de_champ.rb index 7d52601b4..ae9d0501a 100644 --- a/app/models/types_de_champ/prefill_region_type_de_champ.rb +++ b/app/models/types_de_champ/prefill_region_type_de_champ.rb @@ -1,5 +1,5 @@ class TypesDeChamp::PrefillRegionTypeDeChamp < TypesDeChamp::PrefillTypeDeChamp - def possible_values_list + def all_possible_values regions.map { |region| "#{region[:code]} (#{region[:name]})" } end diff --git a/app/models/types_de_champ/prefill_repetition_type_de_champ.rb b/app/models/types_de_champ/prefill_repetition_type_de_champ.rb index c1a879c5c..6cf1f5153 100644 --- a/app/models/types_de_champ/prefill_repetition_type_de_champ.rb +++ b/app/models/types_de_champ/prefill_repetition_type_de_champ.rb @@ -5,7 +5,7 @@ class TypesDeChamp::PrefillRepetitionTypeDeChamp < TypesDeChamp::PrefillTypeDeCh def possible_values [ I18n.t("views.prefill_descriptions.edit.possible_values.#{type_champ}_html"), - subchamps_possible_values_list + subchamps_all_possible_values ].join("
").html_safe # rubocop:disable Rails/OutputSafety end @@ -25,7 +25,7 @@ class TypesDeChamp::PrefillRepetitionTypeDeChamp < TypesDeChamp::PrefillTypeDeCh private - def subchamps_possible_values_list + def subchamps_all_possible_values "" diff --git a/app/models/types_de_champ/prefill_type_de_champ.rb b/app/models/types_de_champ/prefill_type_de_champ.rb index 3ab56de61..31422be58 100644 --- a/app/models/types_de_champ/prefill_type_de_champ.rb +++ b/app/models/types_de_champ/prefill_type_de_champ.rb @@ -27,7 +27,7 @@ class TypesDeChamp::PrefillTypeDeChamp < SimpleDelegator [possible_values_list_display, link_to_all_possible_values].compact.join('
').html_safe # rubocop:disable Rails/OutputSafety end - def possible_values_list + def all_possible_values return [] unless prefillable? [I18n.t("views.prefill_descriptions.edit.possible_values.#{type_champ}_html")] @@ -56,14 +56,14 @@ class TypesDeChamp::PrefillTypeDeChamp < SimpleDelegator end def too_many_possible_values? - possible_values_list.count > POSSIBLE_VALUES_THRESHOLD + all_possible_values.count > POSSIBLE_VALUES_THRESHOLD end def possible_values_list_display if too_many_possible_values? I18n.t("views.prefill_descriptions.edit.possible_values.#{type_champ}_html").html_safe # rubocop:disable Rails/OutputSafety else - possible_values_list.to_sentence + all_possible_values.to_sentence end end end diff --git a/app/views/prefill_type_de_champs/show.html.haml b/app/views/prefill_type_de_champs/show.html.haml index 8a1610340..67b52ec66 100644 --- a/app/views/prefill_type_de_champs/show.html.haml +++ b/app/views/prefill_type_de_champs/show.html.haml @@ -26,7 +26,7 @@ = t("views.prefill_descriptions.edit.possible_values.title") %td .fr-grid-row.fr-grid-row--gutters.fr-py-5w - - @type_de_champ.possible_values_list.each do |possible_value| + - @type_de_champ.all_possible_values.each do |possible_value| .fr-col-lg-3.fr-col-md-4.fr-col-sm-6.fr-col-12 = possible_value %tr