Merge pull request #10312 from mfo/US/ensure-dsfr-style-on-some-champs

ETQ usager, je veux que tous les champs aient un style DSFR
This commit is contained in:
mfo 2024-04-12 13:41:16 +00:00 committed by GitHub
commit d4e8227827
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 19 additions and 4 deletions

View file

@ -1,2 +1,5 @@
class EditableChamp::AddressComponent < EditableChamp::EditableChampBaseComponent
def dsfr_input_classname
'fr-select'
end
end

View file

@ -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

View file

@ -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)

View file

@ -1,3 +1,7 @@
class EditableChamp::CommunesComponent < EditableChamp::EditableChampBaseComponent
include ApplicationHelper
def dsfr_input_classname
'fr-select'
end
end

View file

@ -1,2 +1,5 @@
class EditableChamp::RNFComponent < EditableChamp::EditableChampBaseComponent
def dsfr_input_classname
'fr-input'
end
end

View file

@ -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?