Add champ communes
This commit is contained in:
parent
22aa2d4ee0
commit
4bbd16576b
9 changed files with 26 additions and 0 deletions
|
@ -1012,6 +1012,11 @@ enum TypeDeChamp {
|
|||
"""
|
||||
civilite
|
||||
|
||||
"""
|
||||
Communes
|
||||
"""
|
||||
communes
|
||||
|
||||
"""
|
||||
Date
|
||||
"""
|
||||
|
|
2
app/models/champs/commune_champ.rb
Normal file
2
app/models/champs/commune_champ.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
class Champs::CommuneChamp < Champs::TextChamp
|
||||
end
|
|
@ -19,6 +19,7 @@ class TypeDeChamp < ApplicationRecord
|
|||
pays: 'pays',
|
||||
regions: 'regions',
|
||||
departements: 'departements',
|
||||
communes: 'communes',
|
||||
engagement: 'engagement',
|
||||
header_section: 'header_section',
|
||||
explication: 'explication',
|
||||
|
|
2
app/models/types_de_champ/commune_type_de_champ.rb
Normal file
2
app/models/types_de_champ/commune_type_de_champ.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
class TypesDeChamp::CommuneTypeDeChamp < TypesDeChamp::TypeDeChampBase
|
||||
end
|
|
@ -0,0 +1,4 @@
|
|||
= form.select :value, [champ.value].compact,
|
||||
{ include_blank: true },
|
||||
required: champ.mandatory?,
|
||||
class: 'select2 communes'
|
|
@ -24,6 +24,7 @@ fr:
|
|||
pays: 'Pays'
|
||||
regions: 'Régions'
|
||||
departements: 'Départements'
|
||||
communes: 'Communes'
|
||||
engagement: 'Engagement'
|
||||
header_section: 'Titre de section'
|
||||
explication: 'Explication'
|
||||
|
|
|
@ -124,6 +124,11 @@ FactoryBot.define do
|
|||
value { '971 - Guadeloupe' }
|
||||
end
|
||||
|
||||
factory :champ_communes, class: 'Champs::CommuneChamp' do
|
||||
type_de_champ { create(:type_de_champ_communes) }
|
||||
value { 'Paris' }
|
||||
end
|
||||
|
||||
factory :champ_engagement, class: 'Champs::EngagementChamp' do
|
||||
type_de_champ { create(:type_de_champ_engagement) }
|
||||
value { 'true' }
|
||||
|
|
|
@ -71,6 +71,9 @@ FactoryBot.define do
|
|||
factory :type_de_champ_departements do
|
||||
type_champ { TypeDeChamp.type_champs.fetch(:departements) }
|
||||
end
|
||||
factory :type_de_champ_communes do
|
||||
type_champ { TypeDeChamp.type_champs.fetch(:communes) }
|
||||
end
|
||||
factory :type_de_champ_engagement do
|
||||
type_champ { TypeDeChamp.type_champs.fetch(:engagement) }
|
||||
end
|
||||
|
|
|
@ -69,6 +69,7 @@ describe ProcedureExportService do
|
|||
"pays",
|
||||
"regions",
|
||||
"departements",
|
||||
"communes",
|
||||
"engagement",
|
||||
"dossier_link",
|
||||
"piece_justificative",
|
||||
|
@ -142,6 +143,7 @@ describe ProcedureExportService do
|
|||
"pays",
|
||||
"regions",
|
||||
"departements",
|
||||
"communes",
|
||||
"engagement",
|
||||
"dossier_link",
|
||||
"piece_justificative",
|
||||
|
@ -220,6 +222,7 @@ describe ProcedureExportService do
|
|||
"pays",
|
||||
"regions",
|
||||
"departements",
|
||||
"communes",
|
||||
"engagement",
|
||||
"dossier_link",
|
||||
"piece_justificative",
|
||||
|
|
Loading…
Reference in a new issue