views: add a link to the deposit receipt

This commit is contained in:
Pierre de La Morinerie 2022-05-04 08:48:57 +00:00
parent 9bc5364ca2
commit 7109e2d4e6
4 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,4 @@
.papertrail.mb-2
= link_to papertrail_dossier_url(dossier, format: :pdf), class: "button", download: t('.filename'), target: "_blank" do
%span.icon.justificatif
= t('.get_papertrail')

View file

@ -453,6 +453,10 @@ en:
identity_saved: "Identity data is registred"
attestation:
no_longer_available: "The certificate is no longer available on this file."
show:
papertrail:
get_papertrail: "Get a deposit receipt"
filename: "deposit-receipt.pdf"
papertrail:
receipt: "Deposit receipt"
description: "This document attests that on the %{date}, %{user_name} submitted a file on the procedure “%{procedure}”."

View file

@ -475,6 +475,10 @@ fr:
administrative_service: "Service administratif"
generated_at: "Fait le %{date},"
signature: "La direction de %{app_name}"
show:
papertrail:
get_papertrail: "Obtenir une attestation de dépôt de dossier"
filename: "attestation-de-depot.pdf"
instructeurs:
dossiers:
deleted_by_instructeur: "Le dossier a bien été supprimé de votre interface"

View file

@ -16,6 +16,16 @@ describe 'Dossier details:' do
expect(page).to have_text(dossier.commentaires.last.body)
end
context 'when the deposit receipt feature is enabled' do
before { Flipper.enable(:procedure_dossier_papertrail, procedure) }
after { Flipper.disable(:procedure_dossier_papertrail, procedure) }
it 'displays a link to download a deposit receipt' do
visit dossier_path(dossier)
expect(page).to have_link("Obtenir une attestation de dépôt de dossier", href: %r{dossiers/#{dossier.id}/papertrail.pdf})
end
end
describe "the user can see the mean time they are expected to wait" do
let(:other_dossier) { create(:dossier, :accepte, :with_individual, procedure: procedure, depose_at: 10.days.ago, en_instruction_at: 9.days.ago, processed_at: Time.zone.now) }