From a69d60efef7f14e879a54219dcb7faf4635b2ea6 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Tue, 26 Mar 2024 14:45:01 +0100 Subject: [PATCH 1/4] feat(multiple_drop_down_list): Add hint text - fix #10185 --- config/locales/models/champs/multiple_drop_down_list/en.yml | 6 ++++++ config/locales/models/champs/multiple_drop_down_list/fr.yml | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 config/locales/models/champs/multiple_drop_down_list/en.yml create mode 100644 config/locales/models/champs/multiple_drop_down_list/fr.yml diff --git a/config/locales/models/champs/multiple_drop_down_list/en.yml b/config/locales/models/champs/multiple_drop_down_list/en.yml new file mode 100644 index 000000000..6edaa4169 --- /dev/null +++ b/config/locales/models/champs/multiple_drop_down_list/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/multiple_drop_down_list_champ: + hints: + value: "You can select one or more options." diff --git a/config/locales/models/champs/multiple_drop_down_list/fr.yml b/config/locales/models/champs/multiple_drop_down_list/fr.yml new file mode 100644 index 000000000..f478301cd --- /dev/null +++ b/config/locales/models/champs/multiple_drop_down_list/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/multiple_drop_down_list_champ: + hints: + value: "Vous pouvez séléctionner un ou plusieurs choix." From ab6a76ad469c0852e6264090a554413faa008c18 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Tue, 26 Mar 2024 15:27:59 +0100 Subject: [PATCH 2/4] feat(multiple_drop_down_list) : Add missing space - fix #10185 --- .../multiple_drop_down_list_component.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml index 1a16052ed..a212d4d21 100644 --- a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml +++ b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml @@ -11,7 +11,7 @@ - else %div{ 'data-turbo-focus-group': true } - if @champ.selected_options.present? - .fr-mb-2w{ "data-turbo": "true" } + .fr-mb-2w.fr-mt-2w{ "data-turbo": "true" } - @champ.selected_options.each do |option| = render NestedForms::OwnedButtonComponent.new(formaction: champs_options_path(@champ.id, option:), http_method: :delete, opt: { aria: {pressed: true }, class: 'fr-tag fr-tag-bug fr-mb-1w fr-mr-1w', id: @champ.checkbox_id(option) }) do = option From ba290110e5ff1c01b9b9a7cfe032dcac2a0500c2 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Tue, 26 Mar 2024 15:39:05 +0100 Subject: [PATCH 3/4] feat(multiple_drop_down_list): Replace blank option --- .../multiple_drop_down_list_component.en.yml | 3 +++ .../multiple_drop_down_list_component.fr.yml | 3 +++ .../multiple_drop_down_list_component.html.haml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.en.yml create mode 100644 app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.fr.yml diff --git a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.en.yml b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.en.yml new file mode 100644 index 000000000..9077e600a --- /dev/null +++ b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.en.yml @@ -0,0 +1,3 @@ +--- +en: + prompt: "Select" \ No newline at end of file diff --git a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.fr.yml b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.fr.yml new file mode 100644 index 000000000..c6bf71bba --- /dev/null +++ b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.fr.yml @@ -0,0 +1,3 @@ +--- +fr: + prompt: "Sélectionner" \ No newline at end of file diff --git a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml index a212d4d21..f3d8007b9 100644 --- a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml +++ b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml @@ -16,4 +16,4 @@ = render NestedForms::OwnedButtonComponent.new(formaction: champs_options_path(@champ.id, option:), http_method: :delete, opt: { aria: {pressed: true }, class: 'fr-tag fr-tag-bug fr-mb-1w fr-mr-1w', id: @champ.checkbox_id(option) }) do = option - if @champ.unselected_options.present? - = @form.select :value, @champ.unselected_options, { selected: '', include_blank: '' }, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: 'fr-select fr-mt-2v' + = @form.select :value, @champ.unselected_options, { selected: '', include_blank: false, prompt: t('.prompt') }, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: 'fr-select fr-mt-2v' From 4cfcd702666851e2a8de7d251e00fc99fd9326e4 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer <2088264+inseo@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:11:29 +0100 Subject: [PATCH 4/4] Update config/locales/models/champs/multiple_drop_down_list/fr.yml Fix typo Co-authored-by: Colin Darie --- config/locales/models/champs/multiple_drop_down_list/fr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/models/champs/multiple_drop_down_list/fr.yml b/config/locales/models/champs/multiple_drop_down_list/fr.yml index f478301cd..5961f4a36 100644 --- a/config/locales/models/champs/multiple_drop_down_list/fr.yml +++ b/config/locales/models/champs/multiple_drop_down_list/fr.yml @@ -3,4 +3,4 @@ fr: attributes: champs/multiple_drop_down_list_champ: hints: - value: "Vous pouvez séléctionner un ou plusieurs choix." + value: "Vous pouvez sélectionner un ou plusieurs choix."