refactor(columns): normalize (upcase first) address columns wording

This commit is contained in:
Colin Darie 2024-11-20 16:38:08 +01:00
parent 985cf32752
commit 2e873254fe
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
5 changed files with 12 additions and 12 deletions

View file

@ -6,10 +6,10 @@ module AddressableColumnConcern
included do
def addressable_columns(procedure:, displayable: true, prefix: nil)
[
["code postal (5 chiffres)", '$.postal_code', :text, []],
["commune", '$.city_name', :text, []],
["département", '$.departement_code', :enum, APIGeoService.departement_options],
["region", '$.region_name', :enum, APIGeoService.region_options]
["Code postal (5 chiffres)", '$.postal_code', :text, []],
["Commune", '$.city_name', :text, []],
["Département", '$.departement_code', :enum, APIGeoService.departement_options],
["gion", '$.region_name', :enum, APIGeoService.region_options]
].map do |(label, jsonpath, type, options_for_select)|
Columns::JSONPathColumn.new(
procedure_id: procedure.id,

View file

@ -99,9 +99,9 @@ describe ColumnsConcern do
end
context 'with rna' do
let(:types_de_champ_public) { [{ type: :rna, libelle: 'rna' }] }
let(:types_de_champ_public) { [{ type: :rna, libelle: 'RNA' }] }
let(:types_de_champ_private) { [] }
it { expect(subject.map(&:label)).to include('rna commune') }
it { expect(subject.map(&:label)).to include('RNA Commune') }
end
context 'with linked drop down list' do

View file

@ -572,7 +572,7 @@ describe DossierFilterService do
context "when searching by postal_code (text)" do
let(:value) { "60580" }
let(:filter) { ["rna code postal (5 chiffres)", value] }
let(:filter) { ["rna Code postal (5 chiffres)", value] }
before do
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "postal_code" => value })
@ -589,7 +589,7 @@ describe DossierFilterService do
context "when searching by departement_code (enum)" do
let(:value) { "99" }
let(:filter) { ["rna département", value] }
let(:filter) { ["rna Département", value] }
before do
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "departement_code" => value })
@ -606,7 +606,7 @@ describe DossierFilterService do
context "when searching by region_name" do
let(:value) { "60" }
let(:filter) { ["rna region", value] }
let(:filter) { ["rna gion", value] }
before do
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "region_name" => value })

View file

@ -239,9 +239,9 @@ describe DossierProjectionService do
end
context 'for a json column' do
let(:procedure) { create(:procedure, types_de_champ_public: [{ type: :siret, libelle: 'siret' }]) }
let(:procedure) { create(:procedure, types_de_champ_public: [{ type: :siret, libelle: 'SIRET' }]) }
let(:dossier) { create(:dossier, procedure:) }
let(:label) { "siret département" }
let(:label) { "SIRET Département" }
before do
dossier.project_champs_public.first.update(value_json: { 'departement_code': '38' })

View file

@ -154,7 +154,7 @@ describe "procedure filters" do
rna_champ.reload
champ_select_value = "37 Indre-et-Loire"
add_filter("#{rna_champ.libelle} département", champ_select_value, type: :enum)
add_filter("#{rna_champ.libelle} Département", champ_select_value, type: :enum)
expect(page).to have_link(new_unfollow_dossier.id.to_s)
end
end