From 60e5abd26635845c51fba8a3d5ab7d1f7e7ac409 Mon Sep 17 00:00:00 2001 From: Eric Leroy-Terquem Date: Mon, 11 Sep 2023 18:12:11 +0200 Subject: [PATCH] feat(routing): add departements options to value tag if routing by epci --- app/components/procedure/one_groupe_management_component.rb | 2 +- app/models/groupe_instructeur.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/procedure/one_groupe_management_component.rb b/app/components/procedure/one_groupe_management_component.rb index 639e6edb2..17cf69c17 100644 --- a/app/components/procedure/one_groupe_management_component.rb +++ b/app/components/procedure/one_groupe_management_component.rb @@ -79,7 +79,7 @@ class Procedure::OneGroupeManagementComponent < ApplicationComponent return [] if targeted_champ.is_a?(Logic::Empty) case @revision.types_de_champ_public.find_by(stable_id: targeted_champ.stable_id).type_champ - when TypeDeChamp.type_champs.fetch(:communes), TypeDeChamp.type_champs.fetch(:departements) + when TypeDeChamp.type_champs.fetch(:communes), TypeDeChamp.type_champs.fetch(:departements), TypeDeChamp.type_champs.fetch(:epci) departements_for_select when TypeDeChamp.type_champs.fetch(:regions) regions_for_select diff --git a/app/models/groupe_instructeur.rb b/app/models/groupe_instructeur.rb index a45158c4d..1d0af0c7b 100644 --- a/app/models/groupe_instructeur.rb +++ b/app/models/groupe_instructeur.rb @@ -105,7 +105,7 @@ class GroupeInstructeur < ApplicationRecord routing_tdc = procedure.active_revision.types_de_champ.find_by(stable_id: routing_rule.left.stable_id) options = case routing_tdc.type_champ - when TypeDeChamp.type_champs.fetch(:communes), TypeDeChamp.type_champs.fetch(:departements) + when TypeDeChamp.type_champs.fetch(:communes), TypeDeChamp.type_champs.fetch(:departements), TypeDeChamp.type_champs.fetch(:epci) APIGeoService.departements.map { _1[:code] } when TypeDeChamp.type_champs.fetch(:regions) APIGeoService.regions.map { _1[:code] }