diff --git a/app/components/editable_champ/dossier_link_component/dossier_link_component.html.haml b/app/components/editable_champ/dossier_link_component/dossier_link_component.html.haml index 2db3bd805..5389f084d 100644 --- a/app/components/editable_champ/dossier_link_component/dossier_link_component.html.haml +++ b/app/components/editable_champ/dossier_link_component/dossier_link_component.html.haml @@ -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}", placeholder: "Numéro de dossier", 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 }, inputmode: :numeric, min: 1, pattern: "[0-9]{1,12}", autocomplete: 'off', required: @champ.required?, class: "width-33-desktop #{@champ.blank? ? '' : 'small-margin'}")) - if !@champ.blank? - if dossier.blank? diff --git a/app/components/editable_champ/number_component/number_component.html.haml b/app/components/editable_champ/number_component/number_component.html.haml index 28c8ff6bd..4abd901a7 100644 --- a/app/components/editable_champ/number_component/number_component.html.haml +++ b/app/components/editable_champ/number_component/number_component.html.haml @@ -1 +1 @@ -= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, placeholder: @champ.libelle, required: @champ.required?, pattern: "-?[0-9]*", inputmode: :decimal)) += @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, required: @champ.required?, pattern: "-?[0-9]*", inputmode: :decimal)) diff --git a/app/components/editable_champ/rna_component/rna_component.en.yml b/app/components/editable_champ/rna_component/rna_component.en.yml deleted file mode 100644 index 464a41d85..000000000 --- a/app/components/editable_champ/rna_component/rna_component.en.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -en: - title: "The RNA number must begin with a capital W followed by 9 digits" diff --git a/app/components/editable_champ/rna_component/rna_component.fr.yml b/app/components/editable_champ/rna_component/rna_component.fr.yml deleted file mode 100644 index 96749b3de..000000000 --- a/app/components/editable_champ/rna_component/rna_component.fr.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -fr: - title: "Le numéro RNA doit commencer par un W majuscule suivi de 9 chiffres et lettres" diff --git a/app/components/editable_champ/rna_component/rna_component.html.haml b/app/components/editable_champ/rna_component/rna_component.html.haml index ee1a5eba2..0543591ad 100644 --- a/app/components/editable_champ/rna_component/rna_component.html.haml +++ b/app/components/editable_champ/rna_component/rna_component.html.haml @@ -1,4 +1,4 @@ -= @form.text_field(:value, input_opts( id: @champ.input_id, aria: { describedby: @champ.describedby_id }, data: { controller: 'turbo-input', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.data.blank?, turbo_input_url_value: champs_rna_path(@champ.id) }, required: @champ.required?, pattern: "W[0-9]{9}", title: t(".title"), class: "width-33-desktop", maxlength: 10)) += @form.text_field(:value, input_opts( id: @champ.input_id, aria: { describedby: @champ.describedby_id }, data: { controller: 'turbo-input', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.data.blank?, turbo_input_url_value: champs_rna_path(@champ.id) }, required: @champ.required?, pattern: "W[0-9]{9}", class: "width-33-desktop", maxlength: 10)) .rna-info{ id: dom_id(@champ, :rna_info) } = render 'shared/champs/rna/association', champ: @champ, error: nil diff --git a/app/components/editable_champ/siret_component/siret_component.en.yml b/app/components/editable_champ/siret_component/siret_component.en.yml deleted file mode 100644 index 7d0cdc092..000000000 --- a/app/components/editable_champ/siret_component/siret_component.en.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -en: - title: "The SIRET number must have exactly 14 digits" diff --git a/app/components/editable_champ/siret_component/siret_component.fr.yml b/app/components/editable_champ/siret_component/siret_component.fr.yml deleted file mode 100644 index 6231d97ad..000000000 --- a/app/components/editable_champ/siret_component/siret_component.fr.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -fr: - title: "Le numéro de SIRET doit comporter exactement 14 chiffres" diff --git a/app/components/editable_champ/siret_component/siret_component.html.haml b/app/components/editable_champ/siret_component/siret_component.html.haml index 4f052b2f1..ae999e84a 100644 --- a/app/components/editable_champ/siret_component/siret_component.html.haml +++ b/app/components/editable_champ/siret_component/siret_component.html.haml @@ -1,4 +1,4 @@ -= @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, data: { controller: 'turbo-input', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.etablissement.blank?, turbo_input_url_value: champs_siret_path(@champ.id) }, required: @champ.required?, pattern: "[0-9]{14}", title: t(".title"), class: "width-33-desktop", maxlength: 14)) += @form.text_field(:value, input_opts(id: @champ.input_id, aria: { describedby: @champ.describedby_id }, data: { controller: 'turbo-input', turbo_input_load_on_connect_value: @champ.prefilled? && @champ.value.present? && @champ.etablissement.blank?, turbo_input_url_value: champs_siret_path(@champ.id) }, required: @champ.required?, pattern: "[0-9]{14}", class: "width-33-desktop", maxlength: 14)) .siret-info{ id: dom_id(@champ, :siret_info) } - if @champ.etablissement.present? = render EditableChamp::EtablissementTitreComponent.new(etablissement: @champ.etablissement) diff --git a/config/locales/models/champs/dossier_link_champ/en.yml b/config/locales/models/champs/dossier_link_champ/en.yml new file mode 100644 index 000000000..c2968da61 --- /dev/null +++ b/config/locales/models/champs/dossier_link_champ/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/dossier_link_champ: + hints: + value: "File number" diff --git a/config/locales/models/champs/dossier_link_champ/fr.yml b/config/locales/models/champs/dossier_link_champ/fr.yml new file mode 100644 index 000000000..b757afa74 --- /dev/null +++ b/config/locales/models/champs/dossier_link_champ/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/dossier_link_champ: + hints: + value: "Numéro de dossier" diff --git a/spec/system/users/brouillon_spec.rb b/spec/system/users/brouillon_spec.rb index c21813ce4..c852f05a0 100644 --- a/spec/system/users/brouillon_spec.rb +++ b/spec/system/users/brouillon_spec.rb @@ -16,7 +16,7 @@ describe 'The user' do fill_in('date', with: '12-12-2012', match: :first) fill_in('datetime', with: Time.zone.parse('2023-01-06T07:05')) find("input[type=datetime-local]").send_keys(:arrow_up).send_keys(:arrow_down) # triggers onChange - fill_in('number', with: '42') + # fill_in('number', with: '42'), deadchamp, should be migrated to textchamp fill_in('decimal_number', with: '17') fill_in('integer_number', with: '12') scroll_to(find_field('checkbox'), align: :center) @@ -59,7 +59,7 @@ describe 'The user' do expect(champ_value_for('textarea')).to eq('super textarea') expect(champ_value_for('date')).to eq('2012-12-12') expect(champ_value_for('datetime')).to eq(Time.zone.parse('2023-01-06T07:05:00').iso8601) - expect(champ_value_for('number')).to eq('42') + # expect(champ_value_for('number')).to eq('42'), deadchamp, should be migrated to textchamp expect(champ_value_for('decimal_number')).to eq('17') expect(champ_value_for('integer_number')).to eq('12') expect(champ_value_for('checkbox')).to eq('true') @@ -84,7 +84,7 @@ describe 'The user' do expect(page).to have_field('textarea', with: 'super textarea') expect(page).to have_field('date', with: '2012-12-12') expect(page).to have_field('datetime', with: '2023-01-06T07:05') - expect(page).to have_field('number', with: '42') + # expect(page).to have_field('number', with: '42'), deadchamp, should be migrated to textchamp expect(page).to have_checked_field('checkbox') expect(page).to have_checked_field('Madame') expect(page).to have_field('email', with: 'loulou@yopmail.com')