Merge pull request #3297 from pengfeidong/fix_1238_previsualization_attestation
[fix #1238] add previsualization attestation for gestionnaire
This commit is contained in:
commit
1d84ec7496
4 changed files with 32 additions and 0 deletions
|
@ -13,6 +13,10 @@ module NewGestionnaire
|
|||
send_data(dossier.attestation.pdf.read, filename: 'attestation.pdf', type: 'application/pdf')
|
||||
end
|
||||
|
||||
def apercu_attestation
|
||||
send_data(dossier.build_attestation.pdf.read, filename: 'apercu_attestation.pdf', disposition: 'inline', type: 'application/pdf')
|
||||
end
|
||||
|
||||
def show
|
||||
@demande_seen_at = current_gestionnaire.follows.find_by(dossier: dossier)&.demande_seen_at
|
||||
end
|
||||
|
|
|
@ -29,5 +29,7 @@
|
|||
- else
|
||||
= text_area :dossier, :motivation, class: 'motivation-text-area', placeholder: placeholder, required: true
|
||||
.text-right
|
||||
- if title == 'Accepter' && dossier.procedure.attestation_template&.activated?
|
||||
= link_to "Voir l'attestation", apercu_attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button', title: "Voir l'attestation qui sera envoyée au demandeur"
|
||||
%span.button{ onclick: 'DS.motivationCancel();' } Annuler
|
||||
= button_tag 'Valider la décision', name: :process_action, value: process_action, class: 'button primary', title: title, data: { confirm: confirm }
|
||||
|
|
|
@ -316,6 +316,7 @@ Rails.application.routes.draw do
|
|||
resources :dossiers, only: [:show], param: :dossier_id do
|
||||
member do
|
||||
get 'attestation'
|
||||
get 'apercu_attestation'
|
||||
get 'messagerie'
|
||||
get 'annotations-privees' => 'dossiers#annotations_privees'
|
||||
get 'avis'
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
describe 'new_gestionnaire/dossiers/state_button_motivation.html.haml', type: :view do
|
||||
let(:dossier) { create(:dossier, :en_instruction) }
|
||||
|
||||
subject! do
|
||||
render(
|
||||
'new_gestionnaire/dossiers/state_button_motivation.html.haml',
|
||||
dossier: dossier,
|
||||
popup_title: 'Accepter le dossier',
|
||||
placeholder: 'Expliquez au demandeur pourquoi ce dossier est accepté (facultatif)',
|
||||
popup_class: 'accept',
|
||||
process_action: 'accepter',
|
||||
title: 'Accepter',
|
||||
confirm: "Confirmez-vous l'acceptation ce dossier ?"
|
||||
)
|
||||
end
|
||||
|
||||
context 'with an attestation preview' do
|
||||
let(:dossier) { create :dossier, :accepte, :with_attestation }
|
||||
it { expect(rendered).to have_text("Voir l'attestation") }
|
||||
end
|
||||
|
||||
context 'without an attestation preview' do
|
||||
it { expect(rendered).not_to have_text("Voir l'attestation") }
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue