highlight demande tab when groupe instructeur updated
This commit is contained in:
parent
924702699f
commit
50007b2aac
2 changed files with 9 additions and 1 deletions
|
@ -98,7 +98,8 @@ class Instructeur < ApplicationRecord
|
||||||
.find_by(instructeur: self, dossier: dossier)
|
.find_by(instructeur: self, dossier: dossier)
|
||||||
|
|
||||||
if follow.present?
|
if follow.present?
|
||||||
demande = follow.dossier.champs.updated_since?(follow.demande_seen_at).any?
|
demande = follow.dossier.champs.updated_since?(follow.demande_seen_at).any? || follow.dossier.groupe_instructeur_updated_at&.>(follow.demande_seen_at)
|
||||||
|
demande = false if demande.nil?
|
||||||
|
|
||||||
annotations_privees = follow.dossier.champs_private.updated_since?(follow.annotations_privees_seen_at).any?
|
annotations_privees = follow.dossier.champs_private.updated_since?(follow.annotations_privees_seen_at).any?
|
||||||
|
|
||||||
|
|
|
@ -223,6 +223,13 @@ describe Instructeur, type: :model do
|
||||||
it { is_expected.to match({ demande: true, annotations_privees: false, avis: false, messagerie: false }) }
|
it { is_expected.to match({ demande: true, annotations_privees: false, avis: false, messagerie: false }) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when there is a modification on groupe instructeur' do
|
||||||
|
let(:groupe_instructeur) { create(:groupe_instructeur, instructeurs: [instructeur], procedure: dossier.procedure) }
|
||||||
|
before { dossier.assign_to_groupe_instructeur(groupe_instructeur) }
|
||||||
|
|
||||||
|
it { is_expected.to match({ demande: true, annotations_privees: false, avis: false, messagerie: false }) }
|
||||||
|
end
|
||||||
|
|
||||||
context 'when there is a modification on private champs' do
|
context 'when there is a modification on private champs' do
|
||||||
before { dossier.champs_private.first.update_attribute('value', 'toto') }
|
before { dossier.champs_private.first.update_attribute('value', 'toto') }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue