From 76947a5ccf1949f901a271c6e3f068e40840e308 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Thu, 23 Feb 2023 15:00:59 +0100 Subject: [PATCH] add mention if user_deleted and move dossier info back to info_generales --- .../dossiers/_expiration_banner.html.haml | 3 +-- .../instructeurs/dossiers/_header.html.haml | 24 ++----------------- .../dossiers/_infos_generales.html.haml | 14 +++++++++++ .../dossiers/_expiration_banner.html.haml | 2 +- .../dossiers/show.html.haml_spec.rb | 2 +- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/app/views/instructeurs/dossiers/_expiration_banner.html.haml b/app/views/instructeurs/dossiers/_expiration_banner.html.haml index 3c18a69bf..1e5c918cf 100644 --- a/app/views/instructeurs/dossiers/_expiration_banner.html.haml +++ b/app/views/instructeurs/dossiers/_expiration_banner.html.haml @@ -1,7 +1,6 @@ -# small expires mention - if dossier.expirable? - %p.expires_at.fr-mb-1w - + %p.expires_at %small = t("shared.dossiers.header.expires_at.#{dossier.state}", date: safe_expiration_date(dossier), duree_conservation_totale: dossier.duree_totale_conservation_in_months) - if dossier.conservation_extension.positive? diff --git a/app/views/instructeurs/dossiers/_header.html.haml b/app/views/instructeurs/dossiers/_header.html.haml index aeb8eb750..91490ecc9 100644 --- a/app/views/instructeurs/dossiers/_header.html.haml +++ b/app/views/instructeurs/dossiers/_header.html.haml @@ -20,31 +20,11 @@ = render partial: 'instructeurs/dossiers/header_actions', locals: { dossier: dossier } = render(partial: 'instructeurs/dossiers/print_and_export_actions', locals: {dossier: dossier}) - = render(partial: 'instructeurs/dossiers/expiration_banner', locals: {dossier: dossier}) - - if dossier.motivation.present? + - if dossier.user_deleted? %p.fr-mb-1w - %small - %strong - Motivation : - « #{dossier.motivation} » - - - if dossier.justificatif_motivation.attached? - %p.fr-mb-0 - %small - %strong - Justificatif : - Ce justificatif joint par l’instructeur a été envoyé au demandeur. - = render partial: 'users/dossiers/show/download_justificatif', locals: { dossier: dossier } - - - if dossier.attestation.present? - %p.fr-mb-0 - %small - %strong - Cette attestation a été envoyée automatiquement au demandeur. - = link_to('Voir l’attestation', attestation_instructeur_dossier_path(dossier.procedure, dossier), target: '_blank', rel: 'noopener') - + %small L’usager a supprimé son compte. Vous pouvez archiver puis supprimer le dossier. %nav.tabs %ul diff --git a/app/views/shared/dossiers/_infos_generales.html.haml b/app/views/shared/dossiers/_infos_generales.html.haml index 5896b9427..4eae901fa 100644 --- a/app/views/shared/dossiers/_infos_generales.html.haml +++ b/app/views/shared/dossiers/_infos_generales.html.haml @@ -10,3 +10,17 @@ %td .action = render Attachment::ShowComponent.new(attachment: dossier.justificatif_motivation.attachment) + + - if dossier.motivation.present? + %tr + %td.libelle Motivation : + %td + .action + = dossier.motivation + + - if dossier.attestation.present? + %tr + %td.libelle Attestation : + %td + .action + = link_to('Voir l’attestation', attestation_instructeur_dossier_path(dossier.procedure, dossier), target: '_blank', rel: 'noopener') diff --git a/app/views/users/dossiers/_expiration_banner.html.haml b/app/views/users/dossiers/_expiration_banner.html.haml index 8f9e9f529..509d1eb81 100644 --- a/app/views/users/dossiers/_expiration_banner.html.haml +++ b/app/views/users/dossiers/_expiration_banner.html.haml @@ -1,6 +1,6 @@ -# small expires mention - if dossier.expirable? - %p.expires_at.fr-mb-1w + %p.expires_at %small= t("shared.dossiers.header.expires_at.#{dossier.state}", date: safe_expiration_date(dossier), duree_conservation_totale: dossier.duree_totale_conservation_in_months) - if dossier.close_to_expiration? diff --git a/spec/views/instructeur/dossiers/show.html.haml_spec.rb b/spec/views/instructeur/dossiers/show.html.haml_spec.rb index 726bb7b6f..2063fc24e 100644 --- a/spec/views/instructeur/dossiers/show.html.haml_spec.rb +++ b/spec/views/instructeur/dossiers/show.html.haml_spec.rb @@ -35,7 +35,7 @@ describe 'instructeurs/dossiers/show.html.haml', type: :view do let(:dossier) { create :dossier, :accepte, :with_attestation } it 'provides a link to the attestation' do - expect(subject).to have_text('Cette attestation a été envoyée automatiquement au demandeur.') + expect(subject).to have_text('Attestation') expect(subject).to have_link(href: attestation_instructeur_dossier_path(dossier.procedure, dossier)) end end