From 87cc8a72413c3a4533ab112ac9330e38c5a98bea Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 20 Aug 2024 15:52:30 +0200 Subject: [PATCH] fix(dossier): render PJ champ respects profile context --- .../champs_rows_show_component.html.haml | 2 +- app/views/shared/champs/piece_justificative/_show.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/dossiers/champs_rows_show_component/champs_rows_show_component.html.haml b/app/components/dossiers/champs_rows_show_component/champs_rows_show_component.html.haml index 2ff8db51a..4edba264e 100644 --- a/app/components/dossiers/champs_rows_show_component/champs_rows_show_component.html.haml +++ b/app/components/dossiers/champs_rows_show_component/champs_rows_show_component.html.haml @@ -23,7 +23,7 @@ - when TypeDeChamp.type_champs.fetch(:multiple_drop_down_list) = 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) - = render partial: "shared/champs/piece_justificative/show", locals: { champ: champ } + = render partial: "shared/champs/piece_justificative/show", locals: { champ: champ, profile: @profile } - when TypeDeChamp.type_champs.fetch(:siret) = render partial: "shared/champs/siret/show", locals: { champ: champ, profile: @profile } - when TypeDeChamp.type_champs.fetch(:iban) diff --git a/app/views/shared/champs/piece_justificative/_show.html.haml b/app/views/shared/champs/piece_justificative/_show.html.haml index 4ee1be3d4..ef216dc3a 100644 --- a/app/views/shared/champs/piece_justificative/_show.html.haml +++ b/app/views/shared/champs/piece_justificative/_show.html.haml @@ -1,5 +1,5 @@ .fr-downloads-group - - if instructeur_signed_in? && feature_enabled?(:gallery_demande) + - if profile == 'instructeur' && feature_enabled?(:gallery_demande) .gallery-items-list - champ.piece_justificative_file.attachments.with_all_variant_records.each do |attachment| .gallery-item