refactor(columns): normalize (upcase first) address columns wording
This commit is contained in:
parent
985cf32752
commit
2e873254fe
5 changed files with 12 additions and 12 deletions
|
@ -6,10 +6,10 @@ module AddressableColumnConcern
|
||||||
included do
|
included do
|
||||||
def addressable_columns(procedure:, displayable: true, prefix: nil)
|
def addressable_columns(procedure:, displayable: true, prefix: nil)
|
||||||
[
|
[
|
||||||
["code postal (5 chiffres)", '$.postal_code', :text, []],
|
["Code postal (5 chiffres)", '$.postal_code', :text, []],
|
||||||
["commune", '$.city_name', :text, []],
|
["Commune", '$.city_name', :text, []],
|
||||||
["département", '$.departement_code', :enum, APIGeoService.departement_options],
|
["Département", '$.departement_code', :enum, APIGeoService.departement_options],
|
||||||
["region", '$.region_name', :enum, APIGeoService.region_options]
|
["Région", '$.region_name', :enum, APIGeoService.region_options]
|
||||||
].map do |(label, jsonpath, type, options_for_select)|
|
].map do |(label, jsonpath, type, options_for_select)|
|
||||||
Columns::JSONPathColumn.new(
|
Columns::JSONPathColumn.new(
|
||||||
procedure_id: procedure.id,
|
procedure_id: procedure.id,
|
||||||
|
|
|
@ -99,9 +99,9 @@ describe ColumnsConcern do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with rna' do
|
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) { [] }
|
let(:types_de_champ_private) { [] }
|
||||||
it { expect(subject.map(&:label)).to include('rna – commune') }
|
it { expect(subject.map(&:label)).to include('RNA – Commune') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with linked drop down list' do
|
context 'with linked drop down list' do
|
||||||
|
|
|
@ -572,7 +572,7 @@ describe DossierFilterService do
|
||||||
|
|
||||||
context "when searching by postal_code (text)" do
|
context "when searching by postal_code (text)" do
|
||||||
let(:value) { "60580" }
|
let(:value) { "60580" }
|
||||||
let(:filter) { ["rna – code postal (5 chiffres)", value] }
|
let(:filter) { ["rna – Code postal (5 chiffres)", value] }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "postal_code" => value })
|
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
|
context "when searching by departement_code (enum)" do
|
||||||
let(:value) { "99" }
|
let(:value) { "99" }
|
||||||
let(:filter) { ["rna – département", value] }
|
let(:filter) { ["rna – Département", value] }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "departement_code" => value })
|
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
|
context "when searching by region_name" do
|
||||||
let(:value) { "60" }
|
let(:value) { "60" }
|
||||||
let(:filter) { ["rna – region", value] }
|
let(:filter) { ["rna – Région", value] }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "region_name" => value })
|
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "region_name" => value })
|
||||||
|
|
|
@ -239,9 +239,9 @@ describe DossierProjectionService do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'for a json column' do
|
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(:dossier) { create(:dossier, procedure:) }
|
||||||
let(:label) { "siret – département" }
|
let(:label) { "SIRET – Département" }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
dossier.project_champs_public.first.update(value_json: { 'departement_code': '38' })
|
dossier.project_champs_public.first.update(value_json: { 'departement_code': '38' })
|
||||||
|
|
|
@ -154,7 +154,7 @@ describe "procedure filters" do
|
||||||
rna_champ.reload
|
rna_champ.reload
|
||||||
champ_select_value = "37 – Indre-et-Loire"
|
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)
|
expect(page).to have_link(new_unfollow_dossier.id.to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue