Merge pull request #9724 from demarches-simplifiees/update-manager-with-routing-infos
ETQ superadmin je veux avoir des informations sur le routage d'une procédure
This commit is contained in:
commit
4f1fb91abf
6 changed files with 17 additions and 0 deletions
|
@ -12,6 +12,7 @@ class GroupeInstructeurDashboard < Administrate::BaseDashboard
|
||||||
label: Field::String,
|
label: Field::String,
|
||||||
closed: Field::Boolean,
|
closed: Field::Boolean,
|
||||||
instructeurs: Field::HasMany,
|
instructeurs: Field::HasMany,
|
||||||
|
humanized_routing_rule: Field::String,
|
||||||
created_at: Field::DateTime,
|
created_at: Field::DateTime,
|
||||||
updated_at: Field::DateTime
|
updated_at: Field::DateTime
|
||||||
}.freeze
|
}.freeze
|
||||||
|
@ -32,6 +33,7 @@ class GroupeInstructeurDashboard < Administrate::BaseDashboard
|
||||||
:label,
|
:label,
|
||||||
:closed,
|
:closed,
|
||||||
:instructeurs,
|
:instructeurs,
|
||||||
|
:humanized_routing_rule,
|
||||||
:created_at,
|
:created_at,
|
||||||
:updated_at
|
:updated_at
|
||||||
].freeze
|
].freeze
|
||||||
|
|
|
@ -16,6 +16,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
||||||
administrateurs: Field::HasMany,
|
administrateurs: Field::HasMany,
|
||||||
instructeurs: Field::HasMany,
|
instructeurs: Field::HasMany,
|
||||||
groupe_instructeurs: Field::HasMany,
|
groupe_instructeurs: Field::HasMany,
|
||||||
|
routing_champs: Field::String,
|
||||||
id: Field::Number.with_options(searchable: true),
|
id: Field::Number.with_options(searchable: true),
|
||||||
libelle: Field::String,
|
libelle: Field::String,
|
||||||
description: Field::String,
|
description: Field::String,
|
||||||
|
@ -74,6 +75,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
||||||
:administrateurs,
|
:administrateurs,
|
||||||
:instructeurs,
|
:instructeurs,
|
||||||
:groupe_instructeurs,
|
:groupe_instructeurs,
|
||||||
|
:routing_champs,
|
||||||
:libelle,
|
:libelle,
|
||||||
:description,
|
:description,
|
||||||
:tags,
|
:tags,
|
||||||
|
|
|
@ -113,6 +113,10 @@ class GroupeInstructeur < ApplicationRecord
|
||||||
procedure.groupe_instructeurs - [self]
|
procedure.groupe_instructeurs - [self]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def humanized_routing_rule
|
||||||
|
routing_rule&.to_s(procedure.active_revision.types_de_champ)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def routing_rule_matches_tdc?(rule)
|
def routing_rule_matches_tdc?(rule)
|
||||||
|
|
|
@ -700,6 +700,10 @@ class Procedure < ApplicationRecord
|
||||||
groupe_instructeurs - [defaut_groupe_instructeur]
|
groupe_instructeurs - [defaut_groupe_instructeur]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def routing_champs
|
||||||
|
active_revision.types_de_champ_public.filter(&:used_by_routing_rules?).map(&:libelle)
|
||||||
|
end
|
||||||
|
|
||||||
def can_be_deleted_by_administrateur?
|
def can_be_deleted_by_administrateur?
|
||||||
brouillon? || dossiers.state_en_instruction.empty?
|
brouillon? || dossiers.state_en_instruction.empty?
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,7 @@ fr:
|
||||||
attributes:
|
attributes:
|
||||||
groupe_instructeur:
|
groupe_instructeur:
|
||||||
label: Libellé
|
label: Libellé
|
||||||
|
humanized_routing_rule: Règle de routage
|
||||||
errors:
|
errors:
|
||||||
models:
|
models:
|
||||||
groupe_instructeur:
|
groupe_instructeur:
|
||||||
|
|
|
@ -74,3 +74,7 @@ fr:
|
||||||
sva_svr:
|
sva_svr:
|
||||||
immutable: "La configuration SVA/SVR ne peut plus être modifiée"
|
immutable: "La configuration SVA/SVR ne peut plus être modifiée"
|
||||||
declarative_incompatible: "Le SVA/SVR est incompatible avec une démarche déclarative"
|
declarative_incompatible: "Le SVA/SVR est incompatible avec une démarche déclarative"
|
||||||
|
helpers:
|
||||||
|
label:
|
||||||
|
procedure:
|
||||||
|
routing_champs: Champ(s) de routage
|
||||||
|
|
Loading…
Add table
Reference in a new issue