fix(epci): do not show let select departements with no epci
This commit is contained in:
parent
a6842e8484
commit
045b4942d9
7 changed files with 16 additions and 3 deletions
|
@ -8,7 +8,7 @@ class EditableChamp::EpciComponent < EditableChamp::EditableChampBaseComponent
|
|||
private
|
||||
|
||||
def departement_options
|
||||
APIGeoService.departements.filter { _1[:code] != '99' }.map { ["#{_1[:code]} – #{_1[:name]}", _1[:code]] }
|
||||
APIGeoService.departements.filter(&method(:departement_with_epci?)).map { ["#{_1[:code]} – #{_1[:name]}", _1[:code]] }
|
||||
end
|
||||
|
||||
def epci_options
|
||||
|
@ -26,4 +26,9 @@ class EditableChamp::EpciComponent < EditableChamp::EditableChampBaseComponent
|
|||
def epci_select_options
|
||||
{ selected: @champ.code }.merge(@champ.mandatory? ? { prompt: '' } : { include_blank: '' })
|
||||
end
|
||||
|
||||
def departement_with_epci?(departement)
|
||||
code = departement[:code]
|
||||
!code.start_with?('98') && !code.in?(['99', '975', '977', '978'])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue