From af7e16c372c63ae55ce85bf9a4447de92f331be6 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 21 Mar 2023 11:23:45 +0100 Subject: [PATCH] fix(champ): use champ.required? --- .../departements_component/departements_component.html.haml | 2 +- .../drop_down_list_component.html.haml | 2 +- .../editable_champ/epci_component/epci_component.html.haml | 4 ++-- .../editable_champ/pays_component/pays_component.html.haml | 2 +- .../regions_component/regions_component.html.haml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/components/editable_champ/departements_component/departements_component.html.haml b/app/components/editable_champ/departements_component/departements_component.html.haml index c5a6f744d..5d121dcf1 100644 --- a/app/components/editable_champ/departements_component/departements_component.html.haml +++ b/app/components/editable_champ/departements_component/departements_component.html.haml @@ -1 +1 @@ -= @form.select :value, options, select_options, required: @champ.mandatory?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile" += @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile" diff --git a/app/components/editable_champ/drop_down_list_component/drop_down_list_component.html.haml b/app/components/editable_champ/drop_down_list_component/drop_down_list_component.html.haml index 612c6ba58..286a437e0 100644 --- a/app/components/editable_champ/drop_down_list_component/drop_down_list_component.html.haml +++ b/app/components/editable_champ/drop_down_list_component/drop_down_list_component.html.haml @@ -16,7 +16,7 @@ = @form.radio_button :value, Champs::DropDownListChamp::OTHER, checked: @champ.other_value_present? Autre - else - = @form.select :value, @champ.options_without_empty_value_when_mandatory(@champ.options), { selected: @champ.selected }, required: @champ.mandatory?, id: @champ.input_id, aria: { describedby: @champ.describedby_id } + = @form.select :value, @champ.options_without_empty_value_when_mandatory(@champ.options), { selected: @champ.selected }, required: @champ.required?, id: @champ.input_id, aria: { describedby: @champ.describedby_id } - if @champ.drop_down_other? = render EditableChamp::DropDownOtherInputComponent.new(form: @form, champ: @champ) diff --git a/app/components/editable_champ/epci_component/epci_component.html.haml b/app/components/editable_champ/epci_component/epci_component.html.haml index 89518c588..85138d2fd 100644 --- a/app/components/editable_champ/epci_component/epci_component.html.haml +++ b/app/components/editable_champ/epci_component/epci_component.html.haml @@ -1,4 +1,4 @@ %label.notice{ for: departement_input_id } Le département de l’EPCI -= @form.select :code_departement, departement_options, departement_select_options, required: @champ.mandatory?, id: departement_input_id, class: "width-33-desktop width-100-mobile" += @form.select :code_departement, departement_options, departement_select_options, required: @champ.required?, id: departement_input_id, class: "width-33-desktop width-100-mobile" - if @champ.departement? - = @form.select :value, epci_options, epci_select_options, required: @champ.mandatory?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile" + = @form.select :value, epci_options, epci_select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile" diff --git a/app/components/editable_champ/pays_component/pays_component.html.haml b/app/components/editable_champ/pays_component/pays_component.html.haml index c5a6f744d..5d121dcf1 100644 --- a/app/components/editable_champ/pays_component/pays_component.html.haml +++ b/app/components/editable_champ/pays_component/pays_component.html.haml @@ -1 +1 @@ -= @form.select :value, options, select_options, required: @champ.mandatory?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile" += @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile" diff --git a/app/components/editable_champ/regions_component/regions_component.html.haml b/app/components/editable_champ/regions_component/regions_component.html.haml index c5a6f744d..5d121dcf1 100644 --- a/app/components/editable_champ/regions_component/regions_component.html.haml +++ b/app/components/editable_champ/regions_component/regions_component.html.haml @@ -1 +1 @@ -= @form.select :value, options, select_options, required: @champ.mandatory?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile" += @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile"