From 42027e9db909d0377eda9e8fba27c343cf74ef66 Mon Sep 17 00:00:00 2001 From: Eric Leroy-Terquem Date: Thu, 16 Nov 2023 15:09:38 +0100 Subject: [PATCH] feat(manager): add champs de routage in procedure show --- app/dashboards/procedure_dashboard.rb | 2 ++ app/models/procedure.rb | 4 ++++ config/locales/models/procedure/fr.yml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/app/dashboards/procedure_dashboard.rb b/app/dashboards/procedure_dashboard.rb index ae4b1661e..c70964c34 100644 --- a/app/dashboards/procedure_dashboard.rb +++ b/app/dashboards/procedure_dashboard.rb @@ -16,6 +16,7 @@ class ProcedureDashboard < Administrate::BaseDashboard administrateurs: Field::HasMany, instructeurs: Field::HasMany, groupe_instructeurs: Field::HasMany, + routing_champs: Field::String, id: Field::Number.with_options(searchable: true), libelle: Field::String, description: Field::String, @@ -74,6 +75,7 @@ class ProcedureDashboard < Administrate::BaseDashboard :administrateurs, :instructeurs, :groupe_instructeurs, + :routing_champs, :libelle, :description, :tags, diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 6f077f0dc..47ab405a8 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -700,6 +700,10 @@ class Procedure < ApplicationRecord groupe_instructeurs - [defaut_groupe_instructeur] end + def routing_champs + active_revision.types_de_champ_public.filter(&:used_by_routing_rules?).map(&:libelle) + end + def can_be_deleted_by_administrateur? brouillon? || dossiers.state_en_instruction.empty? end diff --git a/config/locales/models/procedure/fr.yml b/config/locales/models/procedure/fr.yml index 3b8a596c5..e88bb2fcc 100644 --- a/config/locales/models/procedure/fr.yml +++ b/config/locales/models/procedure/fr.yml @@ -74,3 +74,7 @@ fr: sva_svr: immutable: "La configuration SVA/SVR ne peut plus être modifiée" declarative_incompatible: "Le SVA/SVR est incompatible avec une démarche déclarative" + helpers: + label: + procedure: + routing_champs: Champ(s) de routage