Use IGN plan v2 and add MNHN data sources

This commit is contained in:
Paul Chavard 2020-09-02 12:56:45 +02:00
parent f6c4158d9c
commit bbcdff0ccf
10 changed files with 130 additions and 65 deletions

View file

@ -57,6 +57,18 @@ class Champs::CarteChamp < Champ
type_de_champ&.parcelles_agricoles && type_de_champ.parcelles_agricoles != '0'
end
def mnhn?
type_de_champ&.mnhn && type_de_champ.mnhn != '0'
end
def render_options
{
ign: Flipper.enabled?(:carte_ign, procedure),
mnhn: mnhn?,
cadastres: cadastres?
}
end
def position
if dossier.present?
dossier.geo_position

View file

@ -56,7 +56,7 @@ class TypeDeChamp < ApplicationRecord
belongs_to :parent, class_name: 'TypeDeChamp', optional: true
has_many :types_de_champ, -> { ordered }, foreign_key: :parent_id, class_name: 'TypeDeChamp', inverse_of: :parent, dependent: :destroy
store_accessor :options, :cadastres, :quartiers_prioritaires, :parcelles_agricoles, :old_pj, :drop_down_options, :skip_pj_validation
store_accessor :options, :cadastres, :quartiers_prioritaires, :parcelles_agricoles, :mnhn, :old_pj, :drop_down_options, :skip_pj_validation
has_many :revision_types_de_champ, class_name: 'ProcedureRevisionTypeDeChamp', dependent: :destroy, inverse_of: :type_de_champ
delegate :tags_for_template, to: :dynamic_type
@ -286,12 +286,11 @@ class TypeDeChamp < ApplicationRecord
:updated_at
],
methods: [
:cadastres,
:drop_down_list_value,
:parcelles_agricoles,
:piece_justificative_template_filename,
:piece_justificative_template_url,
:quartiers_prioritaires
:cadastres,
:mnhn
]
}
TYPES_DE_CHAMP = TYPES_DE_CHAMP_BASE