diff --git a/app/components/editable_champ/address_component.rb b/app/components/editable_champ/address_component.rb index b3cc203cc..0bcefb5e0 100644 --- a/app/components/editable_champ/address_component.rb +++ b/app/components/editable_champ/address_component.rb @@ -1,2 +1,5 @@ class EditableChamp::AddressComponent < EditableChamp::EditableChampBaseComponent + def dsfr_input_classname + 'fr-select' + end end diff --git a/app/components/editable_champ/annuaire_education_component.rb b/app/components/editable_champ/annuaire_education_component.rb index 0cb736e9c..847b6cc21 100644 --- a/app/components/editable_champ/annuaire_education_component.rb +++ b/app/components/editable_champ/annuaire_education_component.rb @@ -2,4 +2,11 @@ class EditableChamp::AnnuaireEducationComponent < EditableChamp::ComboSearchComp def dsfr_input_classname 'fr-input' end + + def react_input_opts + opts = input_opts(id: @champ.input_id, required: @champ.required?, aria: { describedby: @champ.describedby_id }) + opts[:className] = "#{opts.delete(:class)} fr-mt-1w" + + opts + end end diff --git a/app/components/editable_champ/annuaire_education_component/annuaire_education_component.html.haml b/app/components/editable_champ/annuaire_education_component/annuaire_education_component.html.haml index 0dcfe97d0..00ce7bbba 100644 --- a/app/components/editable_champ/annuaire_education_component/annuaire_education_component.html.haml +++ b/app/components/editable_champ/annuaire_education_component/annuaire_education_component.html.haml @@ -3,7 +3,5 @@ = @form.hidden_field :value = @form.hidden_field :external_id = react_component("ComboAnnuaireEducationSearch", - required: @champ.required?, - id: @champ.input_id, - describedby: @champ.describedby_id, + **react_input_opts, **react_combo_props) diff --git a/app/components/editable_champ/communes_component.rb b/app/components/editable_champ/communes_component.rb index cc5bfee0b..80fbb70e9 100644 --- a/app/components/editable_champ/communes_component.rb +++ b/app/components/editable_champ/communes_component.rb @@ -1,3 +1,7 @@ class EditableChamp::CommunesComponent < EditableChamp::EditableChampBaseComponent include ApplicationHelper + + def dsfr_input_classname + 'fr-select' + end end diff --git a/app/components/editable_champ/rnf_component.rb b/app/components/editable_champ/rnf_component.rb index fc6835c2c..8638f1a64 100644 --- a/app/components/editable_champ/rnf_component.rb +++ b/app/components/editable_champ/rnf_component.rb @@ -1,2 +1,5 @@ class EditableChamp::RNFComponent < EditableChamp::EditableChampBaseComponent + def dsfr_input_classname + 'fr-input' + end end diff --git a/app/components/editable_champ/rnf_component/rnf_component.html.haml b/app/components/editable_champ/rnf_component/rnf_component.html.haml index 9fc2bca98..c8685d8ca 100644 --- a/app/components/editable_champ/rnf_component/rnf_component.html.haml +++ b/app/components/editable_champ/rnf_component/rnf_component.html.haml @@ -1,4 +1,4 @@ -= @form.text_field :external_id, required: @champ.required?, class: "width-33-desktop fr-input small-margin", id: @champ.input_id += @form.text_field :external_id, input_opts(id: @champ.input_id, required: @champ.required?, class: "width-33-desktop fr-input small-margin", aria: { describedby: @champ.describedby_id }) .rnf-info{ id: dom_id(@champ, :rnf_info) } - if @champ.fetch_external_data_error?