feat(DossierAssignment): add warning when dossier is reaffected

This commit is contained in:
Eric Leroy-Terquem 2023-07-07 11:05:00 +02:00
parent 50e7090b9e
commit ca8a3732f5
3 changed files with 9 additions and 0 deletions

View file

@ -18,6 +18,8 @@
= render partial: "shared/champs/carte/show", locals: { champ: champ } = render partial: "shared/champs/carte/show", locals: { champ: champ }
- when TypeDeChamp.type_champs.fetch(:dossier_link) - when TypeDeChamp.type_champs.fetch(:dossier_link)
= render partial: "shared/champs/dossier_link/show", locals: { champ: champ } = render partial: "shared/champs/dossier_link/show", locals: { champ: champ }
- when TypeDeChamp.type_champs.fetch(:drop_down_list)
= render partial: "shared/champs/drop_down_list/show", locals: { champ: champ }
- when TypeDeChamp.type_champs.fetch(:multiple_drop_down_list) - when TypeDeChamp.type_champs.fetch(:multiple_drop_down_list)
= render partial: "shared/champs/multiple_drop_down_list/show", locals: { champ: champ } = render partial: "shared/champs/multiple_drop_down_list/show", locals: { champ: champ }
- when TypeDeChamp.type_champs.fetch(:piece_justificative), TypeDeChamp.type_champs.fetch(:titre_identite) - when TypeDeChamp.type_champs.fetch(:piece_justificative), TypeDeChamp.type_champs.fetch(:titre_identite)

View file

@ -84,6 +84,7 @@ class Champ < ApplicationRecord
delegate :to_typed_id, :to_typed_id_for_query, to: :type_de_champ, prefix: true delegate :to_typed_id, :to_typed_id_for_query, to: :type_de_champ, prefix: true
delegate :revision, to: :dossier, prefix: true delegate :revision, to: :dossier, prefix: true
delegate :used_by_routing_rules?, to: :type_de_champ
scope :updated_since?, -> (date) { where('champs.updated_at > ?', date) } scope :updated_since?, -> (date) { where('champs.updated_at > ?', date) }
scope :public_only, -> { where(private: false) } scope :public_only, -> { where(private: false) }

View file

@ -0,0 +1,6 @@
- if champ.used_by_routing_rules? && champ.dossier.forced_groupe_instructeur
%p
%span= champ.value
%span.fr-badge.fr-badge--warning.fr-badge--sm dossier réaffecté au groupe « #{champ.dossier.groupe_instructeur.label} »
- else
%p= champ.value