diff --git a/app/components/attachment/gallery_item_component.rb b/app/components/attachment/gallery_item_component.rb index 5667074eb..bc2284efc 100644 --- a/app/components/attachment/gallery_item_component.rb +++ b/app/components/attachment/gallery_item_component.rb @@ -20,22 +20,6 @@ class Attachment::GalleryItemComponent < ApplicationComponent from_dossier? ? attachment.record.libelle : 'Pièce jointe au message' end - def from_dossier? - attachment.record.class.in?([Champs::PieceJustificativeChamp, Champs::TitreIdentiteChamp]) - end - - def from_messagerie? - attachment.record.is_a?(Commentaire) - end - - def from_messagerie_instructeur? - from_messagerie? && attachment.record.instructeur.present? - end - - def from_messagerie_usager? - from_messagerie? && attachment.record.instructeur.nil? - end - def origin case when from_dossier? @@ -81,4 +65,22 @@ class Attachment::GalleryItemComponent < ApplicationComponent "fr-badge--new" => seen_at.present? && updated_at&.>(seen_at) ) end + + private + + def from_dossier? + attachment.record.class.in?([Champs::PieceJustificativeChamp, Champs::TitreIdentiteChamp]) + end + + def from_messagerie? + attachment.record.is_a?(Commentaire) + end + + def from_messagerie_instructeur? + from_messagerie? && attachment.record.instructeur.present? + end + + def from_messagerie_usager? + from_messagerie? && attachment.record.instructeur.nil? + end end