Merge pull request #7773 from mfo/US/add-code-commune-to-geoarea-label

feat(export.xslx): add code commune to geo_area.label
This commit is contained in:
mfo 2022-09-19 10:19:51 +02:00 committed by GitHub
commit ce25f45b75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -73,7 +73,7 @@ class GeoArea < ApplicationRecord
def label def label
case source case source
when GeoArea.sources.fetch(:cadastre) when GeoArea.sources.fetch(:cadastre)
I18n.t("cadastre", scope: 'geo_area.label', numero: numero, prefixe: prefixe, section: section, surface: surface.round) I18n.t("cadastre", scope: 'geo_area.label', numero: numero, prefixe: prefixe, section: section, surface: surface.round, commune: commune)
when GeoArea.sources.fetch(:selection_utilisateur) when GeoArea.sources.fetch(:selection_utilisateur)
if polygon? if polygon?
if area > 0 if area > 0

View file

@ -8,7 +8,7 @@ en:
selection_utilisateur: User selection selection_utilisateur: User selection
geo_area: geo_area:
label: label:
cadastre: "Parcel n° %{numero} - Sheet %{prefixe} %{section} - %{surface} " cadastre: "Parcel n° %{numero} - Sheet %{prefixe} %{section} - %{surface}  - town %{commune}"
area: "An area of %{area} m²" area: "An area of %{area} m²"
area_unknown: "An area of unknown surface" area_unknown: "An area of unknown surface"
line: "A %{length} m long line" line: "A %{length} m long line"

View file

@ -8,7 +8,7 @@ fr:
selection_utilisateur: Sélection utilisateur selection_utilisateur: Sélection utilisateur
geo_area: geo_area:
label: label:
cadastre: "Parcelle n° %{numero} - Feuille %{prefixe} %{section} - %{surface} " cadastre: "Parcelle n° %{numero} - Feuille %{prefixe} %{section} - %{surface}  commune %{commune}"
area: "Une aire de surface %{area} m²" area: "Une aire de surface %{area} m²"
area_unknown: "Une aire de surface inconnue" area_unknown: "Une aire de surface inconnue"
line: "Une ligne longue de %{length} m" line: "Une ligne longue de %{length} m"

View file

@ -140,7 +140,7 @@ RSpec.describe GeoArea, type: :model do
context "when geo is a cadastre parcelle" do context "when geo is a cadastre parcelle" do
let(:geo_area) { build(:geo_area, :selection_utilisateur, :cadastre, champ: nil) } let(:geo_area) { build(:geo_area, :selection_utilisateur, :cadastre, champ: nil) }
it "should return the label" do it "should return the label" do
expect(geo_area.label).to eq("Parcelle n° 42 - Feuille 000 A11 - 123 ") expect(geo_area.label).to eq("Parcelle n° 42 - Feuille 000 A11 - 123  commune 75127")
end end
end end
end end