Skip to content

Commit

Permalink
add error_id to described_by
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSim authored and inseo committed Oct 28, 2024
1 parent a92bc28 commit adb3d7c
Show file tree
Hide file tree
Showing 27 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.fr-checkbox-group
= @form.check_box :value,
{ required: @champ.required?, id: @champ.input_id, checked: @champ.true?, aria: { describedby: @champ.describedby_id }, class: class_names('required' => @champ.required?)},
{ required: @champ.required?, id: @champ.input_id, checked: @champ.true?, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, class: class_names('required' => @champ.required?)},
'true',
'false'
%label.fr-label{ for: @champ.input_id, id: @champ.labelledby_id }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
%p.notice= t('.numero_allocataire_notice')
= @form.text_field :numero_allocataire,
required: @champ.required?,
aria: { describedby: @champ.describedby_id },
aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" },
class: "width-33-desktop", id: @champ.numero_allocataire_input_id

%div
= @form.label :code_postal, t('.code_postal_label'), for: @champ.code_postal_input_id
%p.notice= t('.code_postal_notice')
= @form.text_field :code_postal,
required: @champ.required?,
aria: { describedby: @champ.describedby_id },
aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" },
class: "width-33-desktop",
id: @champ.code_postal_input_id
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= @form.date_field :value,
input_opts(id: @champ.input_id,
aria: { describedby: @champ.describedby_id },
aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" },
value: @champ.value,
required: @champ.required?,
class: "width-33-desktop")
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.datetime_field(:value, input_opts(value: formatted_value_for_datetime_locale, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, data: { controller: 'datetime' }))
= @form.datetime_field(:value, input_opts(value: formatted_value_for_datetime_locale, id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, data: { controller: 'datetime' }))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, required: @champ.required?, pattern: "-?[0-9]+([\.,][0-9]{1,3})?", inputmode: :decimal, data: { controller: 'format', format: :decimal }))
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, required: @champ.required?, pattern: "-?[0-9]+([\.,][0-9]{1,3})?", inputmode: :decimal, data: { controller: 'format', format: :decimal }))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "fr-select"
= @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, class: "fr-select"
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
%p.notice= t('.numero_fiscal_notice')
= @form.text_field :numero_fiscal,
required: @champ.required?,
aria: { describedby: @champ.describedby_id },
aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" },
class: "width-33-desktop", id: @champ.numero_fiscal_input_id

%div
= @form.label :reference_avis, t('.reference_avis_label'), for: @champ.reference_avis_input_id
%p.notice= t('.reference_avis_notice')
= @form.text_field :reference_avis,
required: @champ.required?,
aria: { describedby: @champ.describedby_id },
aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" },
class: "width-33-desktop", id: @champ.reference_avis_input_id
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, inputmode: :numeric, min: 1, pattern: "[0-9]{1,12}", autocomplete: 'off', required: @champ.required?, class: "width-33-desktop #{@champ.blank? ? '' : 'small-margin'}"))
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, inputmode: :numeric, min: 1, pattern: "[0-9]{1,12}", autocomplete: 'off', required: @champ.required?, class: "width-33-desktop #{@champ.blank? ? '' : 'small-margin'}"))

- if [email protected]? && !dossier.blank?
.fr-info-text.fr-mb-4w= sanitize(dossier.text_summary)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
required: @champ.required?,
id: @champ.input_id,
class: select_class_names,
aria: { describedby: @champ.describedby_id }
aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }

- if @champ.drop_down_other?
%div{ class: other_element_class_names }
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.email_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, required: @champ.required?))
= @form.email_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, required: @champ.required?))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.text_field(:value, input_opts(id: @champ.input_id, required: @champ.required?, aria: { describedby: @champ.describedby_id }))
= @form.text_field(:value, input_opts(id: @champ.input_id, required: @champ.required?, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }))
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
.fr-select-group
= @form.label :value, for: @champ.epci_input_id, class: 'fr-label' do
- "EPCI"
= @form.select :value, epci_options, epci_select_options, required: @champ.required?, id: @champ.epci_input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile fr-select"
= @form.select :value, epci_options, epci_select_options, required: @champ.required?, id: @champ.epci_input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, class: "width-33-desktop width-100-mobile fr-select"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.text_field(:value, input_opts(id: @champ.input_id, placeholder: @champ.expression_reguliere_exemple_text, required: @champ.required?, aria: { describedby: @champ.describedby_id }))
= @form.text_field(:value, input_opts(id: @champ.input_id, placeholder: @champ.expression_reguliere_exemple_text, required: @champ.required?, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.text_field(:value, input_opts(id: @champ.input_id, required: @champ.required?, aria: { describedby: @champ.describedby_id }, data: { controller: 'format', format: 'iban' }, class: "width-66-desktop", maxlength: 34 + 9)) # count space separator of 4 digits-groups
= @form.text_field(:value, input_opts(id: @champ.input_id, required: @champ.required?, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, data: { controller: 'format', format: 'iban' }, class: "width-66-desktop", maxlength: 34 + 9)) # count space separator of 4 digits-groups
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, pattern: "-?[0-9]*", inputmode: :numeric, required: @champ.required?, data: { controller: 'format', format: :integer }))
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, pattern: "-?[0-9]*", inputmode: :numeric, required: @champ.required?, data: { controller: 'format', format: :integer }))
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.fr-select-group
= render EditableChamp::ChampLabelComponent.new form: @form, champ: @champ, seen_at: @seen_at

= @form.select :primary_value, @champ.primary_options, {}, required: @champ.required?, class: 'fr-select fr-mb-3v', id: @champ.input_id, aria: { describedby: @champ.describedby_id }
= @form.select :primary_value, @champ.primary_options, {}, required: @champ.required?, class: 'fr-select fr-mb-3v', id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }

- if @champ.has_secondary_options_for_primary?
.secondary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
%p.notice= t('.ine_notice')
= @form.text_field :ine,
required: @champ.required?,
aria: { describedby: @champ.describedby_id },
aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" },
class: "width-33-desktop", id: @champ.input_id
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- capture do
.fr-fieldset__element
.fr-checkbox-group
= b.check_box(checked: @champ.selected_options.include?(b.value), aria: { describedby: @champ.describedby_id }, id: @champ.checkbox_id(b.value), class: 'fr-checkbox-group__checkbox')
= b.check_box(checked: @champ.selected_options.include?(b.value), aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, id: @champ.checkbox_id(b.value), class: 'fr-checkbox-group__checkbox')
%label.fr-label{ for: @champ.checkbox_id(b.value) }
= b.text

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, required: @champ.required?, pattern: "-?[0-9]*", inputmode: :decimal))
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, required: @champ.required?, pattern: "-?[0-9]*", inputmode: :decimal))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @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 fr-select"
= @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, class: "width-33-desktop width-100-mobile fr-select"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-# Allowed @formats:
-# very light validation is made client-side
-# stronger validation is made server-side
= @form.phone_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, required: @champ.required?, pattern: "[^a-z^A-Z]+"))
= @form.phone_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, required: @champ.required?, pattern: "[^a-z^A-Z]+"))
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
%p.notice= t('.identifiant_notice')
= @form.text_field :identifiant,
required: @champ.required?,
aria: { describedby: @champ.describedby_id },
aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" },
class: "width-33-desktop", id: @champ.input_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= @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 fr-select"
= @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, class: "width-33-desktop width-100-mobile fr-select"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= @form.text_field(:value, input_opts( id: @champ.input_id, aria: { describedby: @champ.describedby_id }, data: { controller: 'turbo-input format', format: 'deleteSpace', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.data.blank?, turbo_input_url_value: update_path }, required: @champ.required?, pattern: "W[0-9A-Z]{9}", class: "width-33-desktop", maxlength: 10))
= @form.text_field(:value, input_opts( id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, data: { controller: 'turbo-input format', format: 'deleteSpace', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.data.blank?, turbo_input_url_value: update_path }, required: @champ.required?, pattern: "W[0-9A-Z]{9}", class: "width-33-desktop", maxlength: 10))

.rna-info{ id: dom_id(@champ, :rna_info) }
= render 'shared/champs/rna/association', champ: @champ, error: nil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= @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 })
= @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} #{@champ.error_id}" })

.rnf-info{ id: dom_id(@champ, :rnf_info) }
- if @champ.fetch_external_data_error?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, data: { controller: 'turbo-input format', format: 'siret', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.etablissement.blank?, turbo_input_url_value: update_path }, required: @champ.required?, class: "width-33-desktop"))
= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, data: { controller: 'turbo-input format', format: 'siret', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.etablissement.blank?, turbo_input_url_value: update_path }, required: @champ.required?, class: "width-33-desktop"))
.siret-info{ id: dom_id(@champ, :siret_info) }
- if @champ.etablissement.present?
= render EditableChamp::EtablissementTitreComponent.new(etablissement: @champ.etablissement)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
~ @form.text_area(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, rows: 6, required: @champ.required?, value: html_to_string(@champ.value), data: { controller: 'autoresize' }))
~ @form.text_area(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, rows: 6, required: @champ.required?, value: html_to_string(@champ.value), data: { controller: 'autoresize' }))

- if @champ.character_limit_info?
%p.fr-info-text
Expand Down

0 comments on commit adb3d7c

Please sign in to comment.