From ab483a89597ab78c71f8a784ba6d29533fcf8e33 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Thu, 18 Jul 2024 14:15:29 +0200 Subject: [PATCH 1/9] simplifie tabs supprimes and reduce to one --- .../dossiers/batch_operation_component.rb | 4 ++-- .../instructeurs/procedures_controller.rb | 8 ++++---- app/controllers/users/dossiers_controller.rb | 17 +++++++---------- app/helpers/tabs_helper.rb | 4 ++-- app/models/dossier.rb | 2 +- app/models/export.rb | 2 +- app/models/instructeur.rb | 2 +- .../instructeurs/procedures/_list.html.haml | 6 +++--- .../instructeurs/procedures/_tabs.html.haml | 8 ++++---- .../procedures/deleted_dossiers.html.haml | 2 +- .../instructeurs/procedures/index.html.haml | 2 +- .../instructeurs/procedures/show.html.haml | 8 ++++---- .../users/dossiers/_dossiers_list.html.haml | 12 ++++++++---- app/views/users/dossiers/index.html.haml | 16 +++++----------- config/locales/en.yml | 5 ++--- config/locales/fr.yml | 10 +++++----- .../views/instructeurs/procedures/en.yml | 2 +- .../views/instructeurs/procedures/fr.yml | 2 +- ...mes_recemment_from_procedure_presentation.rb | 10 ++++++++++ db/schema.rb | 2 +- ...les-differentes-categories-de-dossiers.fr.md | 4 ++-- spec/models/dossier_spec.rb | 4 ++-- spec/models/export_spec.rb | 10 +++++----- .../procedures/_list.html.haml_spec.rb | 2 +- .../procedures/_tabs.html.haml_spec.rb | 2 +- .../users/dossiers/index.html.haml_spec.rb | 3 +-- 26 files changed, 76 insertions(+), 73 deletions(-) create mode 100644 db/migrate/20240718100430_rename_supprimes_recemment_from_procedure_presentation.rb diff --git a/app/components/dossiers/batch_operation_component.rb b/app/components/dossiers/batch_operation_component.rb index 7f090feaa..8d5a09405 100644 --- a/app/components/dossiers/batch_operation_component.rb +++ b/app/components/dossiers/batch_operation_component.rb @@ -7,7 +7,7 @@ class Dossiers::BatchOperationComponent < ApplicationComponent end def render? - ['a-suivre', 'traites', 'suivis', 'archives', 'supprimes_recemment', 'expirant'].include?(@statut) + ['a-suivre', 'traites', 'suivis', 'archives', 'supprimes', 'expirant'].include?(@statut) end def operations_for_dossier(dossier) @@ -81,7 +81,7 @@ class Dossiers::BatchOperationComponent < ApplicationComponent } ] } - when 'supprimes_recemment' then + when 'supprimes' then { options: [ diff --git a/app/controllers/instructeurs/procedures_controller.rb b/app/controllers/instructeurs/procedures_controller.rb index 2a37d7b5d..f8ba193a0 100644 --- a/app/controllers/instructeurs/procedures_controller.rb +++ b/app/controllers/instructeurs/procedures_controller.rb @@ -36,7 +36,7 @@ module Instructeurs @dossiers_archived_count_per_procedure = dossiers.by_statut('archives').group('groupe_instructeurs.procedure_id').count @dossiers_termines_count_per_procedure = dossiers.by_statut('traites').group('groupe_instructeurs.procedure_id').reorder(nil).count @dossiers_expirant_count_per_procedure = dossiers.by_statut('expirant').group('groupe_instructeurs.procedure_id').count - @dossiers_supprimes_recemment_count_per_procedure = dossiers.by_statut('supprimes_recemment').group('groupe_instructeurs.procedure_id').reorder(nil).count + @dossiers_supprimes_count_per_procedure = dossiers.by_statut('supprimes').group('groupe_instructeurs.procedure_id').reorder(nil).count groupe_ids = current_instructeur.groupe_instructeurs.pluck(:id) @followed_dossiers_count_per_procedure = current_instructeur @@ -56,7 +56,7 @@ module Instructeurs t('.all') => @dossiers_count_per_procedure.sum { |_, v| v }, t('.dossiers_close_to_expiration') => @dossiers_expirant_count_per_procedure.sum { |_, v| v }, t('.archived') => @dossiers_archived_count_per_procedure.sum { |_, v| v }, - t('.dossiers_supprimes_recemment') => @dossiers_supprimes_recemment_count_per_procedure.sum { |_, v| v } + t('.dossiers_supprimes') => @dossiers_supprimes_count_per_procedure.sum { |_, v| v } } @procedure_ids_en_cours_with_notifications = current_instructeur.procedure_ids_with_notifications(:en_cours) @@ -120,9 +120,9 @@ module Instructeurs .order(:dossier_id) .page params[:page] - @a_suivre_count, @suivis_count, @traites_count, @tous_count, @archives_count, @supprimes_recemment_count, @expirant_count = current_instructeur + @a_suivre_count, @suivis_count, @traites_count, @tous_count, @archives_count, @supprimes_count, @expirant_count = current_instructeur .dossiers_count_summary(groupe_instructeur_ids) - .fetch_values('a_suivre', 'suivis', 'traites', 'tous', 'archives', 'supprimes_recemment', 'expirant') + .fetch_values('a_suivre', 'suivis', 'traites', 'tous', 'archives', 'supprimes', 'expirant') @can_download_dossiers = (@tous_count + @archives_count) > 0 && !instructeur_as_manager? notifications = current_instructeur.notifications_for_groupe_instructeurs(groupe_instructeur_ids) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 709730e0f..c636d5344 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -57,12 +57,12 @@ module Users @user_dossiers = current_user.dossiers.state_not_termine.merge(@dossiers_visibles) @dossiers_traites = current_user.dossiers.state_termine.merge(@dossiers_visibles) @dossiers_invites = current_user.dossiers_invites.merge(@dossiers_visibles) - @dossiers_supprimes_recemment = (current_user.dossiers.hidden_by_user.or(current_user.dossiers.hidden_by_expired)).merge(ordered_dossiers) + @dossiers_supprimes = (current_user.dossiers.hidden_by_user.or(current_user.dossiers.hidden_by_expired)).merge(ordered_dossiers) @dossier_transferes = @dossiers_visibles.where(dossier_transfer_id: DossierTransfer.for_email(current_user.email)) @dossiers_close_to_expiration = current_user.dossiers.close_to_expiration.merge(@dossiers_visibles) - @dossiers_supprimes_definitivement = deleted_dossiers + @dossiers_historique = deleted_dossiers - @statut = statut(@user_dossiers, @dossiers_traites, @dossiers_invites, @dossiers_supprimes_recemment, @dossiers_supprimes_definitivement, @dossier_transferes, @dossiers_close_to_expiration, params[:statut]) + @statut = statut(@user_dossiers, @dossiers_traites, @dossiers_invites, @dossiers_supprimes, @dossier_transferes, @dossiers_close_to_expiration, params[:statut]) @dossiers = case @statut when 'en-cours' @@ -71,10 +71,8 @@ module Users @dossiers_traites when 'dossiers-invites' @dossiers_invites - when 'dossiers-supprimes-recemment' - @dossiers_supprimes_recemment - when 'dossiers-supprimes-definitivement' - @dossiers_supprimes_definitivement + when 'dossiers-supprimes' + @dossiers_supprimes when 'dossiers-transferes' @dossier_transferes when 'dossiers-expirant' @@ -436,13 +434,12 @@ module Users # if the status tab is filled, then this tab # else first filled tab # else en-cours - def statut(mes_dossiers, dossiers_traites, dossiers_invites, dossiers_supprimes_recemment, dossiers_supprimes_definitivement, dossier_transferes, dossiers_close_to_expiration, params_statut) + def statut(mes_dossiers, dossiers_traites, dossiers_invites, dossiers_supprimes, dossier_transferes, dossiers_close_to_expiration, params_statut) tabs = { 'en-cours' => mes_dossiers, 'traites' => dossiers_traites, 'dossiers-invites' => dossiers_invites, - 'dossiers-supprimes-recemment' => dossiers_supprimes_recemment, - 'dossiers-supprimes-definitivement' => dossiers_supprimes_definitivement, + 'dossiers-supprimes' => dossiers_supprimes, 'dossiers-transferes' => dossier_transferes, 'dossiers-expirant' => dossiers_close_to_expiration } diff --git a/app/helpers/tabs_helper.rb b/app/helpers/tabs_helper.rb index a40dbbb81..c7c32bc17 100644 --- a/app/helpers/tabs_helper.rb +++ b/app/helpers/tabs_helper.rb @@ -9,8 +9,8 @@ module TabsHelper 'pluralize.processed' when 'tous' 'views.instructeurs.dossiers.tab_steps.total' # i18n-tasks-use t('views.instructeurs.dossiers.tab_steps.total') - when 'supprimes_recemment' - 'pluralize.dossiers_supprimes_recemment' + when 'supprimes' + 'pluralize.dossiers_supprimes' when 'expirant' 'pluralize.dossiers_close_to_expiration' when 'archives' diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 63bbb2c59..0e353de03 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -416,7 +416,7 @@ class Dossier < ApplicationRecord visible_by_administration.termine when 'tous' visible_by_administration.all_state - when 'supprimes_recemment' + when 'supprimes' hidden_by_administration.state_termine.or(hidden_by_expired) when 'archives' visible_by_administration.archived diff --git a/app/models/export.rb b/app/models/export.rb index d9b29d409..0c44b72a9 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -22,7 +22,7 @@ class Export < ApplicationRecord suivis: 'suivis', traites: 'traites', tous: 'tous', - supprimes_recemment: 'supprimes_recemment', + supprimes: 'supprimes', archives: 'archives', expirant: 'expirant' } diff --git a/app/models/instructeur.rb b/app/models/instructeur.rb index bf600c0a6..5bfd34ec7 100644 --- a/app/models/instructeur.rb +++ b/app/models/instructeur.rb @@ -232,7 +232,7 @@ class Instructeur < ApplicationRecord COUNT(DISTINCT dossiers.id) FILTER (where dossiers.hidden_by_administration_at IS NULL AND dossiers.hidden_by_expired_at IS NULL AND not archived AND dossiers.state in ('accepte', 'refuse', 'sans_suite')) AS traites, COUNT(DISTINCT dossiers.id) FILTER (where dossiers.hidden_by_administration_at IS NULL AND dossiers.hidden_by_expired_at IS NULL AND not archived) AS tous, COUNT(DISTINCT dossiers.id) FILTER (where dossiers.hidden_by_administration_at IS NULL AND dossiers.hidden_by_expired_at IS NULL AND archived) AS archives, - COUNT(DISTINCT dossiers.id) FILTER (where dossiers.hidden_by_administration_at IS NOT NULL AND not archived OR dossiers.hidden_by_expired_at IS NOT NULL) AS supprimes_recemment, + COUNT(DISTINCT dossiers.id) FILTER (where dossiers.hidden_by_administration_at IS NOT NULL AND not archived OR dossiers.hidden_by_expired_at IS NOT NULL) AS supprimes, COUNT(DISTINCT dossiers.id) FILTER (where dossiers.hidden_by_administration_at IS NULL AND dossiers.hidden_by_expired_at IS NULL AND procedures.procedure_expires_when_termine_enabled AND ( dossiers.state in ('accepte', 'refuse', 'sans_suite') diff --git a/app/views/instructeurs/procedures/_list.html.haml b/app/views/instructeurs/procedures/_list.html.haml index ca839cb6d..20604c03a 100644 --- a/app/views/instructeurs/procedures/_list.html.haml +++ b/app/views/instructeurs/procedures/_list.html.haml @@ -50,12 +50,12 @@ %li %object - = link_to(instructeur_procedure_path(p, statut: 'supprimes_recemment')) do - - dossier_count = dossiers_supprimes_recemment_count_per_procedure[p.id] || 0 + = link_to(instructeur_procedure_path(p, statut: 'supprimes')) do + - dossier_count = dossiers_supprimes_count_per_procedure[p.id] || 0 .stats-number = number_with_html_delimiter(dossier_count) .stats-legend - = t('pluralize.dossiers_supprimes_recemment', count: dossier_count) + = t('pluralize.dossiers_supprimes', count: dossier_count) - if p.procedure_expires_when_termine_enabled %li diff --git a/app/views/instructeurs/procedures/_tabs.html.haml b/app/views/instructeurs/procedures/_tabs.html.haml index c9d6a2560..bfaa2760b 100644 --- a/app/views/instructeurs/procedures/_tabs.html.haml +++ b/app/views/instructeurs/procedures/_tabs.html.haml @@ -22,10 +22,10 @@ active: statut == 'tous', badge: number_with_html_delimiter(tous_count)) - = tab_item(t(tab_i18n_key_from_status('supprimes_recemment'), count: supprimes_recemment_count), - instructeur_procedure_path(procedure, statut: 'supprimes_recemment'), - active: statut == 'supprimes_recemment', - badge: number_with_html_delimiter(supprimes_recemment_count)) + = tab_item(t(tab_i18n_key_from_status('supprimes'), count: supprimes_count), + instructeur_procedure_path(procedure, statut: 'supprimes'), + active: statut == 'supprimes', + badge: number_with_html_delimiter(supprimes_count)) - if procedure.procedure_expires_when_termine_enabled = tab_item(t(tab_i18n_key_from_status('expirant'), count: expirant_count), diff --git a/app/views/instructeurs/procedures/deleted_dossiers.html.haml b/app/views/instructeurs/procedures/deleted_dossiers.html.haml index 7482f95f9..7a5b3ccbf 100644 --- a/app/views/instructeurs/procedures/deleted_dossiers.html.haml +++ b/app/views/instructeurs/procedures/deleted_dossiers.html.haml @@ -19,7 +19,7 @@ suivis_count: @suivis_count, traites_count: @traites_count, tous_count: @tous_count, - supprimes_recemment_count: @supprimes_recemment_count, + supprimes_count: @supprimes_count, archives_count: @archives_count, expirant_count: @expirant_count, has_en_cours_notifications: @has_en_cours_notifications, diff --git a/app/views/instructeurs/procedures/index.html.haml b/app/views/instructeurs/procedures/index.html.haml index bae861f5b..f18d64e94 100644 --- a/app/views/instructeurs/procedures/index.html.haml +++ b/app/views/instructeurs/procedures/index.html.haml @@ -41,7 +41,7 @@ dossiers_archived_count_per_procedure: @dossiers_archived_count_per_procedure, dossiers_termines_count_per_procedure: @dossiers_termines_count_per_procedure, dossiers_expirant_count_per_procedure: @dossiers_expirant_count_per_procedure, - dossiers_supprimes_recemment_count_per_procedure: @dossiers_supprimes_recemment_count_per_procedure, + dossiers_supprimes_count_per_procedure: @dossiers_supprimes_count_per_procedure, followed_dossiers_count_per_procedure: @followed_dossiers_count_per_procedure, procedure_ids_en_cours_with_notifications: @procedure_ids_en_cours_with_notifications, procedure_ids_termines_with_notifications: @procedure_ids_termines_with_notifications } diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 1330a2e3b..7a30d95ac 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -19,7 +19,7 @@ suivis_count: @counts[:suivis], traites_count: @counts[:traites], tous_count: @counts[:tous], - supprimes_recemment_count: @counts[:supprimes_recemment], + supprimes_count: @counts[:supprimes], archives_count: @counts[:archives], expirant_count: @counts[:expirant], has_en_cours_notifications: @has_en_cours_notifications, @@ -41,9 +41,9 @@ = t('views.instructeurs.dossiers.tab_explainations.tous_with_routing') - else = t('views.instructeurs.dossiers.tab_explainations.tous') - - if @statut == 'supprimes_recemment' + - if @statut == 'supprimes' %p - = t('views.instructeurs.dossiers.tab_explainations.supprimes_recemment').html_safe + = t('views.instructeurs.dossiers.tab_explainations.supprimes').html_safe - if @statut == 'archives' %p = t('views.instructeurs.dossiers.tab_explainations.archives') @@ -167,7 +167,7 @@ archived: p.archived, dossier_is_followed: @followed_dossiers_id.include?(p.dossier_id), close_to_expiration: @statut == 'expirant', - hidden_by_administration: @statut == 'supprimes_recemment', + hidden_by_administration: @statut == 'supprimes', hidden_by_expired: p.hidden_by_reason == 'expired', sva_svr: @procedure.sva_svr_enabled?, has_blocking_pending_correction: @procedure.feature_enabled?(:blocking_pending_correction) && p.pending_correction?, diff --git a/app/views/users/dossiers/_dossiers_list.html.haml b/app/views/users/dossiers/_dossiers_list.html.haml index 58a39cb6b..663d8e33b 100644 --- a/app/views/users/dossiers/_dossiers_list.html.haml +++ b/app/views/users/dossiers/_dossiers_list.html.haml @@ -7,7 +7,7 @@ .flex.justify-between %div %h3.card-title - - if ["dossiers-transferes", "dossiers-supprimes-recemment"].exclude?(@statut) + - if ["dossiers-transferes", "dossiers-supprimes"].exclude?(@statut) = link_to(url_for_dossier(dossier), class: 'cell-link') do = dossier.procedure.libelle - else @@ -43,7 +43,11 @@ = t('views.users.dossiers.dossiers_list.n_dossier') = number_with_html_delimiter(dossier.id) - = status_badge_user(dossier, 'fr-mb-1w') + - if @statut == "dossiers-supprimes" + %span.fr-badge.fr-badge--sm.fr-badge--warning + = t('views.users.dossiers.dossiers_list.deleted_badge') + - else + = status_badge_user(dossier, 'fr-mb-1w') - if dossier.pending_correction? %br @@ -96,11 +100,11 @@ = link_to t('views.users.dossiers.transfers.revoke'), transfer_path(dossier.transfer), class: 'fr-link', method: :delete - - if ["dossiers-transferes", "dossiers-supprimes-recemment"].exclude?(@statut) + - if ["dossiers-transferes", "dossiers-supprimes"].exclude?(@statut) .flex.justify-end = render partial: 'dossier_actions', locals: { dossier: dossier } - - if @statut == "dossiers-supprimes-recemment" + - if @statut == "dossiers-supprimes" .flex.justify-end - if dossier.hidden_by_reason != 'expired' = link_to restore_dossier_path(dossier.id), method: :patch, class: "fr-btn fr-btn--sm" do diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 9a50902c1..721679518 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -50,17 +50,11 @@ active: @statut == 'dossiers-expirant', badge: number_with_html_delimiter(@dossiers_close_to_expiration.count)) - - if @dossiers_supprimes_recemment.present? - = tab_item(t('pluralize.dossiers_supprimes_recemment', count: @dossiers_supprimes_recemment.count), - dossiers_path(statut: 'dossiers-supprimes-recemment', procedure_id: params[:procedure_id]), - active: @statut == 'dossiers-supprimes-recemment', - badge: number_with_html_delimiter(@dossiers_supprimes_recemment.count)) - - - if @dossiers_supprimes_definitivement.present? - = tab_item(t('pluralize.dossiers_supprimes_definitivement', count: @dossiers_supprimes_definitivement.count), - dossiers_path(statut: 'dossiers-supprimes-definitivement', procedure_id: params[:procedure_id]), - active: @statut == 'dossiers-supprimes-definitivement', - badge: number_with_html_delimiter(@dossiers_supprimes_definitivement.count)) + - if @dossiers_supprimes.present? + = tab_item(t('pluralize.dossiers_supprimes', count: @dossiers_supprimes.count), + dossiers_path(statut: 'dossiers-supprimes', procedure_id: params[:procedure_id]), + active: @statut == 'dossiers-supprimes', + badge: number_with_html_delimiter(@dossiers_supprimes.count)) - if @dossier_transferes.present? = tab_item(t('pluralize.dossiers_transferes', count: @dossier_transferes.count), diff --git a/config/locales/en.yml b/config/locales/en.yml index 50e1c8448..979d575f9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -150,7 +150,6 @@ en: subtitle_two: "Additional notes" content_html: "

The documentation pages are managed by a third-party tool. They are not fully accessible.

FAQ management was delegated to a third-party tool. It was reintegrated into the platform in May 2024 and has not yet been audited.

" - preparation: title: "Preparation of this accessibility declaration" intro: "This declaration was drawn up on 27 April 2022. It was updated on 14 June 2024." @@ -395,7 +394,7 @@ en: traites_html: "The files in this tab are finished: they have been accepted, refused or closed without follow-up. You can download the zip archives of finished files and their attachments." tous: All the files that have been submitted on this approach, included files to be follow and files followed by you or other instructors. tous_with_routing: All the files that have been submitted on this approach, and assigned to your instructors groups. - supprimes_recemment: All files not archive, completed and deleted by the instructors on this approach. + supprimes: All files not archive, completed and deleted by the instructors on this approach. archives: "The files in this tab are archived: you can no longer reply to them, and requesters can no longer modify them." expirant: Records will not expire prior to the data retention period. archived_dossier: "This file will be kept for an additional month" @@ -789,7 +788,7 @@ en: dossiers_invites: one: guest file other: guest files - dossiers_supprimes_recemment: + dossiers_supprimes: one: recently deleted file other: recently deleted files dossiers_supprimes_definitivement: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 7aba7889d..56b9cd648 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -395,7 +395,7 @@ fr: traites_html: "Les dossiers dans cet onglet sont terminés : ils ont été acceptés, refusés ou classés sans suite. Vous pouvez télécharger les archives au format zip des dossiers terminés et leurs pièces jointes." tous: Tous les dossiers déposés sur cette démarche, qu'ils soient à suivre, suivis par vous ou suivis par d'autres instructeurs. tous_with_routing: Tous les dossiers déposés sur cette démarche et attribués aux groupes d'instructeurs dont vous faites partie. - supprimes_recemment: Tous les dossiers non archivés, terminés et supprimés par les instructeurs sur cette démarche + supprimes: Tous les dossiers non archivés, terminés et supprimés par les instructeurs sur cette démarche archives: "Les dossiers de cet onglet sont archivés : vous ne pouvez plus y répondre, et les demandeurs ne peuvent plus les modifier." expirant: Les dossiers n’expireront pas avant la période de conservation des données. archived_dossier: "Le dossier sera conservé 1 mois supplémentaire" @@ -802,10 +802,10 @@ fr: dossiers_invites: one: dossier invité other: dossiers invités - dossiers_supprimes_recemment: - one: supprimé récemment - other: supprimés récemment - dossiers_supprimes_definitivement: + dossiers_supprimes: + one: supprimé + other: supprimés + dossiers_historique: one: supprimé définitivement other: supprimés définitivement dossiers_transferes: diff --git a/config/locales/views/instructeurs/procedures/en.yml b/config/locales/views/instructeurs/procedures/en.yml index 84a1a8c1f..bc3536ab4 100644 --- a/config/locales/views/instructeurs/procedures/en.yml +++ b/config/locales/views/instructeurs/procedures/en.yml @@ -11,7 +11,7 @@ en: all: files archived: archived dossiers_close_to_expiration: expiring - dossiers_supprimes_recemment: recently deleted + dossiers_supprimes: recently deleted copy_link_button: Copy the procedure link to clipboard email_usagers: contact_users: Contact users (draft) diff --git a/config/locales/views/instructeurs/procedures/fr.yml b/config/locales/views/instructeurs/procedures/fr.yml index b2e035019..08d0d2fd2 100644 --- a/config/locales/views/instructeurs/procedures/fr.yml +++ b/config/locales/views/instructeurs/procedures/fr.yml @@ -11,7 +11,7 @@ fr: all: dossiers archived: archivés dossiers_close_to_expiration: expirant - dossiers_supprimes_recemment: supprimés + dossiers_supprimes: supprimés copy_link_button: Copier le lien de la démarche dans le presse-papiers email_usagers: contact_users: Contacter les usagers (brouillon) diff --git a/db/migrate/20240718100430_rename_supprimes_recemment_from_procedure_presentation.rb b/db/migrate/20240718100430_rename_supprimes_recemment_from_procedure_presentation.rb new file mode 100644 index 000000000..fb8a63ded --- /dev/null +++ b/db/migrate/20240718100430_rename_supprimes_recemment_from_procedure_presentation.rb @@ -0,0 +1,10 @@ +class RenameSupprimesRecemmentFromProcedurePresentation < ActiveRecord::Migration[7.0] + def up + ProcedurePresentation.update_all(%Q(filters = filters || '{"supprimes": []}')) + change_column_default :procedure_presentations, :filters, { "tous" => [], "suivis" => [], "traites" => [], "a-suivre" => [], "archives" => [], "supprimes" => [], "expirant": [] } + end + + def down + change_column_default :procedure_presentations, :filters, { "tous" => [], "suivis" => [], "traites" => [], "a-suivre" => [], "archives" => [], "supprimes_recemment" => [], "expirant": [] } + end +end diff --git a/db/schema.rb b/db/schema.rb index 49687353a..90c1c10b2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -862,7 +862,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_07_29_160650) do t.integer "assign_to_id" t.datetime "created_at", precision: nil t.jsonb "displayed_fields", default: [{"label"=>"Demandeur", "table"=>"user", "column"=>"email"}], null: false - t.jsonb "filters", default: {"tous"=>[], "suivis"=>[], "traites"=>[], "a-suivre"=>[], "archives"=>[], "expirant"=>[], "supprimes_recemment"=>[]}, null: false + t.jsonb "filters", default: {"tous"=>[], "suivis"=>[], "traites"=>[], "a-suivre"=>[], "archives"=>[], "expirant"=>[], "supprimes"=>[]}, null: false t.jsonb "sort", default: {"order"=>"desc", "table"=>"notifications", "column"=>"notifications"}, null: false t.datetime "updated_at", precision: nil t.index ["assign_to_id"], name: "index_procedure_presentations_on_assign_to_id", unique: true diff --git a/doc/faqs/instructeur/a-quoi-correspondent-les-differentes-categories-de-dossiers.fr.md b/doc/faqs/instructeur/a-quoi-correspondent-les-differentes-categories-de-dossiers.fr.md index 78b251e7a..b990b1a15 100644 --- a/doc/faqs/instructeur/a-quoi-correspondent-les-differentes-categories-de-dossiers.fr.md +++ b/doc/faqs/instructeur/a-quoi-correspondent-les-differentes-categories-de-dossiers.fr.md @@ -3,7 +3,7 @@ category: "instructeur" subcategory: "instruction" slug: "a-quoi-correspondent-les-differentes-categories-de-dossiers" locale: "fr" -keywords: "catégories dossiers, à suivre, suivi, traités, supprimé récemment, archivés" +keywords: "catégories dossiers, à suivre, suivi, traités, supprimés, archivés" title: "À quoi correspondent les différentes catégories de dossiers ?" --- @@ -14,7 +14,7 @@ Pour chaque démarche, les dossiers sont répartis dans plusieurs onglets : - **À suivre** : regroupe l’ensemble des dossiers qui ne sont suivis par aucun instructeur. - **Suivis** : n’affiche que les dossiers que *vous* suivez. Elle ne prend donc pas en compte les dossiers suivis par les autres instructeurs de la démarche. - **Traités** : regroupe les dossiers dont le statut est *accepté*, *refusé* ou *classé sans suite* et qui n’ont pas été archivés. -- **Supprimé récemment** : regroupe l’ensemble des dossiers non archivés, terminés et supprimés par les instructeurs de la démarche. +- **Supprimés** : regroupe l’ensemble des dossiers non archivés, terminés et supprimés par les instructeurs de la démarche. - **Expirant** : les dossiers *en construction* ou *traités*, (archivés ou non), dont le délai d’expiration approche (moins d’un mois). À l’issue de ce délai, le dossier sera supprimé de la plateforme. - **Archivés** : regroupe l’ensemble des dossiers archivés. Les instructeurs ne peuvent plus y répondre, et les demandeurs ne peuvent plus les modifier. La messagerie est désactivée. Ces dossiers seront supprimés lorsque leur délai de conservation sur %{application_name} sera expiré. diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index b1bf110fc..096283270 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -48,9 +48,9 @@ describe Dossier, type: :model do end end - context 'supprimes_recemment' do + context 'supprimes' do it do - expect(procedure.dossiers.by_statut('supprimes_recemment')).to match_array([dossier_accepte_deleted, dossier_accepte_archive_deleted]) + expect(procedure.dossiers.by_statut('supprimes')).to match_array([dossier_accepte_deleted, dossier_accepte_archive_deleted]) end end diff --git a/spec/models/export_spec.rb b/spec/models/export_spec.rb index bd950bc36..ae9a077a2 100644 --- a/spec/models/export_spec.rb +++ b/spec/models/export_spec.rb @@ -177,17 +177,17 @@ RSpec.describe Export, type: :model do end end - context 'with procedure_presentation and statut supprimes_recemment' do - let(:statut) { 'supprimes_recemment' } + context 'with procedure_presentation and statut supprimes' do + let(:statut) { 'supprimes' } let(:procedure_presentation) do create(:procedure_presentation, procedure: procedure, assign_to: procedure.groupe_instructeurs.first.assign_tos.first) end - let!(:dossier_recemment_supprime) { create(:dossier, :accepte, procedure: procedure, hidden_by_administration_at: 2.days.ago) } + let!(:dossier_supprime) { create(:dossier, :accepte, procedure: procedure, hidden_by_administration_at: 2.days.ago) } - it 'includes supprimes_recemment' do - expect(export.send(:dossiers_for_export)).to include(dossier_recemment_supprime) + it 'includes supprimes' do + expect(export.send(:dossiers_for_export)).to include(dossier_supprime) end end end diff --git a/spec/views/instructeur/procedures/_list.html.haml_spec.rb b/spec/views/instructeur/procedures/_list.html.haml_spec.rb index fb37e6c3e..a42070ee9 100644 --- a/spec/views/instructeur/procedures/_list.html.haml_spec.rb +++ b/spec/views/instructeur/procedures/_list.html.haml_spec.rb @@ -8,7 +8,7 @@ describe 'instructeurs/procedures/_list', type: :view do dossiers_a_suivre_count_per_procedure: 2, dossiers_archived_count_per_procedure: 1, dossiers_termines_count_per_procedure: 1, - dossiers_supprimes_recemment_count_per_procedure: 0, + dossiers_supprimes_count_per_procedure: 0, dossiers_expirant_count_per_procedure: 0, followed_dossiers_count_per_procedure: 0, procedure_ids_en_cours_with_notifications: [], diff --git a/spec/views/instructeur/procedures/_tabs.html.haml_spec.rb b/spec/views/instructeur/procedures/_tabs.html.haml_spec.rb index 5cf3471e4..bdee55e97 100644 --- a/spec/views/instructeur/procedures/_tabs.html.haml_spec.rb +++ b/spec/views/instructeur/procedures/_tabs.html.haml_spec.rb @@ -11,7 +11,7 @@ describe 'instructeurs/procedures/_tabs', type: :view do suivis_count: 0, traites_count: 0, tous_count: 0, - supprimes_recemment_count: 0, + supprimes_count: 0, archives_count: 0, expirant_count: 0, has_en_cours_notifications: false, diff --git a/spec/views/users/dossiers/index.html.haml_spec.rb b/spec/views/users/dossiers/index.html.haml_spec.rb index d74726330..41bbf7506 100644 --- a/spec/views/users/dossiers/index.html.haml_spec.rb +++ b/spec/views/users/dossiers/index.html.haml_spec.rb @@ -16,8 +16,7 @@ describe 'users/dossiers/index', type: :view do allow(controller).to receive(:current_user) { user } assign(:user_dossiers, user_dossiers) assign(:dossiers_invites, Kaminari.paginate_array(dossiers_invites).page(1)) - assign(:dossiers_supprimes_recemment, Kaminari.paginate_array(user_dossiers).page(1)) - assign(:dossiers_supprimes_definitivement, Kaminari.paginate_array(user_dossiers).page(1)) + assign(:dossiers_supprimes, Kaminari.paginate_array(user_dossiers).page(1)) assign(:dossiers_traites, Kaminari.paginate_array(user_dossiers).page(1)) assign(:dossier_transferes, Kaminari.paginate_array([]).page(1)) assign(:dossiers_close_to_expiration, Kaminari.paginate_array([]).page(1)) From 30df5aa89aa4ebfe9b765a0b14a3b27391e8f30e Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Mon, 22 Jul 2024 11:12:38 +0200 Subject: [PATCH 2/9] add page link and page to access deleted dossier historique --- app/controllers/users/dossiers_controller.rb | 8 +++- .../dossiers/_deleted_dossiers_list.html.haml | 30 -------------- .../users/dossiers/deleted_dossiers.html.haml | 41 +++++++++++++++++++ app/views/users/dossiers/index.html.haml | 13 +++--- config/routes.rb | 1 + 5 files changed, 54 insertions(+), 39 deletions(-) delete mode 100644 app/views/users/dossiers/_deleted_dossiers_list.html.haml create mode 100644 app/views/users/dossiers/deleted_dossiers.html.haml diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index c636d5344..31d0f67fb 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -6,7 +6,7 @@ module Users layout 'procedure_context', only: [:identite, :update_identite, :siret, :update_siret] - ACTIONS_ALLOWED_TO_ANY_USER = [:index, :new, :transferer_all] + ACTIONS_ALLOWED_TO_ANY_USER = [:index, :new, :transferer_all, :deleted_dossiers] ACTIONS_ALLOWED_TO_OWNER_OR_INVITE = [:show, :destroy, :demande, :messagerie, :brouillon, :submit_brouillon, :submit_en_construction, :modifier, :modifier_legacy, :update, :create_commentaire, :papertrail, :restore, :champ] before_action :ensure_ownership!, except: ACTIONS_ALLOWED_TO_ANY_USER + ACTIONS_ALLOWED_TO_OWNER_OR_INVITE @@ -60,7 +60,7 @@ module Users @dossiers_supprimes = (current_user.dossiers.hidden_by_user.or(current_user.dossiers.hidden_by_expired)).merge(ordered_dossiers) @dossier_transferes = @dossiers_visibles.where(dossier_transfer_id: DossierTransfer.for_email(current_user.email)) @dossiers_close_to_expiration = current_user.dossiers.close_to_expiration.merge(@dossiers_visibles) - @dossiers_historique = deleted_dossiers + @dossiers_supprimes_historique = deleted_dossiers @statut = statut(@user_dossiers, @dossiers_traites, @dossiers_invites, @dossiers_supprimes, @dossier_transferes, @dossiers_close_to_expiration, params[:statut]) @@ -429,6 +429,10 @@ module Users redirect_to dossier_path(@dossier) end + def deleted_dossiers + @deleted_dossiers = current_user.deleted_dossiers.includes(:procedure).order_by_updated_at.page(page) + end + private # if the status tab is filled, then this tab diff --git a/app/views/users/dossiers/_deleted_dossiers_list.html.haml b/app/views/users/dossiers/_deleted_dossiers_list.html.haml deleted file mode 100644 index 55846eba4..000000000 --- a/app/views/users/dossiers/_deleted_dossiers_list.html.haml +++ /dev/null @@ -1,30 +0,0 @@ -- if deleted_dossiers.present? - %h2.fr-h6.fr-mb-2w - = page_entries_info deleted_dossiers - - - deleted_dossiers.each do |dossier| - .card - .flex.justify-between - %div - %h3.card-title - = dossier.procedure.libelle - - %p.fr-icon--sm.fr-icon-delete-line.fr-mb-0 - = t('views.users.dossiers.dossiers_list.deleted', date: l(dossier.updated_at.to_date)) - = "-" - = t("activerecord.attributes.deleted_dossier.reason.#{dossier.reason}") - - .text-right - %p.fr-mb-0 - = t('views.users.dossiers.dossiers_list.n_dossier') - = dossier.dossier_id - - = status_badge(dossier.state, 'fr-mb-1w') - - = paginate deleted_dossiers, views_prefix: 'shared' - -- else - .blank-tab - %h2.empty-text= t('views.users.dossiers.dossiers_list.no_result_title') - %p.empty-text-details - = t('views.users.dossiers.dossiers_list.no_result_text_html', app_base: Current.application_base_url) diff --git a/app/views/users/dossiers/deleted_dossiers.html.haml b/app/views/users/dossiers/deleted_dossiers.html.haml new file mode 100644 index 000000000..9d30962cf --- /dev/null +++ b/app/views/users/dossiers/deleted_dossiers.html.haml @@ -0,0 +1,41 @@ +- content_for(:title, "Historique des dossiers supprimés") + += render partial: 'administrateurs/breadcrumbs', + locals: { steps: [['Historique des dossiers supprimés']] } + + +.fr-container + .fr-mb-3w + = link_to "Retour à la liste des dossiers", dossiers_path(), class: "fr-link fr-icon-arrow-left-line fr-link--icon-left" + %h1.fr-h2 + Historique des dossiers supprimés + +.fr-container + - if @deleted_dossiers.present? + %h2.fr-h6.fr-mb-2w + = page_entries_info @deleted_dossiers + + - @deleted_dossiers.each do |dossier| + .card + .flex.justify-between + %div + %h3.card-title + = dossier.procedure.libelle + + %p.fr-icon--sm.fr-icon-delete-line.fr-mb-0 + = t('views.users.dossiers.dossiers_list.deleted', date: l(dossier.updated_at.to_date)) + = "-" + = t("activerecord.attributes.deleted_dossier.reason.#{dossier.reason}") + + .text-right + %p.fr-mb-0 + = t('views.users.dossiers.dossiers_list.n_dossier') + = dossier.dossier_id + + = paginate @deleted_dossiers, views_prefix: 'shared' + + - else + .blank-tab + %h2.empty-text= t('views.users.dossiers.dossiers_list.no_result_title') + %p.empty-text-details + = t('views.users.dossiers.dossiers_list.no_result_text_html', app_base: Current.application_base_url) diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 721679518..b2ce5dcb9 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -5,7 +5,11 @@ .dossiers-headers.sub-header .fr-container - %h1.page-title.fr-h2= t('views.users.dossiers.index.dossiers') + .flex.align-center + %h1.page-title.fr-h2= t('views.users.dossiers.index.dossiers') + - if @dossiers_supprimes_historique.present? + %p.ml-auto + = link_to('Historique des dossiers supprimés', deleted_dossiers_path(), class: 'fr-link') .fr-grid-row.fr-grid-row--gutters - if current_user.dossiers.count > 2 || current_user.dossiers_invites.count > 2 @@ -82,9 +86,4 @@ - else = render Dossiers::UserFilterComponent.new(statut: @statut, filter: @filter, procedure_id: @procedure_id ) - - - if @statut == "dossiers-supprimes-definitivement" - -# /!\ in this context, @dossiers is a collection of DeletedDossier not Dossier - = render partial: "deleted_dossiers_list", locals: { deleted_dossiers: @dossiers } - - else - = render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut, search: false } + = render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut, search: false } diff --git a/config/routes.rb b/config/routes.rb index 1fddada7d..76c043c26 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -389,6 +389,7 @@ Rails.application.routes.draw do resource :feedback, only: [:create] get 'demarches' => 'demarches#index' + get 'deleted_dossiers' => 'dossiers#deleted_dossiers' get 'profil' => 'profil#show' patch 'update_email' => 'profil#update_email' From a0a9270a6159f9d4c39cb78b0c12370ba855017e Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Mon, 22 Jul 2024 11:35:59 +0200 Subject: [PATCH 3/9] remove deleted dossier from filter and search --- app/controllers/users/dossiers_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 31d0f67fb..5cd5823d1 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -26,15 +26,13 @@ module Users def index ordered_dossiers = Dossier.includes(:procedure).order_by_updated_at - deleted_dossiers = current_user.deleted_dossiers.includes(:procedure).order_by_updated_at + @dossiers_supprimes_historique = current_user.deleted_dossiers.includes(:procedure).order_by_updated_at user_revisions = ProcedureRevision.where(dossiers: current_user.dossiers.visible_by_user) invite_revisions = ProcedureRevision.where(dossiers: current_user.dossiers_invites.visible_by_user) - deleted_dossier_procedures = Procedure.where(id: deleted_dossiers.pluck(:procedure_id)) all_dossier_procedures = Procedure.where(revisions: user_revisions.or(invite_revisions)) @procedures_for_select = all_dossier_procedures - .or(deleted_dossier_procedures) .distinct(:procedure_id) .order(:libelle) .pluck(:libelle, :id) @@ -42,14 +40,12 @@ module Users @procedure_id = params[:procedure_id] if @procedure_id.present? ordered_dossiers = ordered_dossiers.where(procedures: { id: @procedure_id }) - deleted_dossiers = deleted_dossiers.where(procedures: { id: @procedure_id }) end @search_terms = params[:q] if @search_terms.present? dossiers_filter_by_search = DossierSearchService.matching_dossiers_for_user(@search_terms, current_user).page ordered_dossiers = ordered_dossiers.merge(dossiers_filter_by_search) - deleted_dossiers = nil end @dossiers_visibles = ordered_dossiers.visible_by_user.preload(:etablissement, :individual, :invites) From 95a8f1458b5e729957019203fd08f96fb61b9d93 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Mon, 22 Jul 2024 12:15:55 +0200 Subject: [PATCH 4/9] fix specs --- config/locales/en.yml | 3 --- spec/views/users/dossiers/index.html.haml_spec.rb | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 979d575f9..4a7264a67 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -791,9 +791,6 @@ en: dossiers_supprimes: one: recently deleted file other: recently deleted files - dossiers_supprimes_definitivement: - one: permanently deleted file - other: permanently deleted files dossiers_transferes: one: transfer request other: transfer requests diff --git a/spec/views/users/dossiers/index.html.haml_spec.rb b/spec/views/users/dossiers/index.html.haml_spec.rb index 41bbf7506..73e29057c 100644 --- a/spec/views/users/dossiers/index.html.haml_spec.rb +++ b/spec/views/users/dossiers/index.html.haml_spec.rb @@ -96,7 +96,7 @@ describe 'users/dossiers/index', type: :view do it 'affiche la barre d’onglets' do expect(rendered).to have_selector('nav.fr-tabs') - expect(rendered).to have_selector('nav.fr-tabs li', count: 5) + expect(rendered).to have_selector('nav.fr-tabs li', count: 4) expect(rendered).to have_selector('nav.fr-tabs li.active', count: 1) end end From 066a2bea854623c3cb8108ea4d2bcea041f63d5c Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Mon, 22 Jul 2024 15:02:55 +0200 Subject: [PATCH 5/9] use main navigation to display deleted dossier for user --- app/controllers/users/dossiers_controller.rb | 2 -- app/views/users/_main_navigation.html.haml | 6 +++++- app/views/users/dossiers/deleted_dossiers.html.haml | 2 -- app/views/users/dossiers/index.html.haml | 6 +----- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 5cd5823d1..9ff659759 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -26,7 +26,6 @@ module Users def index ordered_dossiers = Dossier.includes(:procedure).order_by_updated_at - @dossiers_supprimes_historique = current_user.deleted_dossiers.includes(:procedure).order_by_updated_at user_revisions = ProcedureRevision.where(dossiers: current_user.dossiers.visible_by_user) invite_revisions = ProcedureRevision.where(dossiers: current_user.dossiers_invites.visible_by_user) @@ -56,7 +55,6 @@ module Users @dossiers_supprimes = (current_user.dossiers.hidden_by_user.or(current_user.dossiers.hidden_by_expired)).merge(ordered_dossiers) @dossier_transferes = @dossiers_visibles.where(dossier_transfer_id: DossierTransfer.for_email(current_user.email)) @dossiers_close_to_expiration = current_user.dossiers.close_to_expiration.merge(@dossiers_visibles) - @dossiers_supprimes_historique = deleted_dossiers @statut = statut(@user_dossiers, @dossiers_traites, @dossiers_invites, @dossiers_supprimes, @dossier_transferes, @dossiers_close_to_expiration, params[:statut]) diff --git a/app/views/users/_main_navigation.html.haml b/app/views/users/_main_navigation.html.haml index 42aeb669b..ff77a42d0 100644 --- a/app/views/users/_main_navigation.html.haml +++ b/app/views/users/_main_navigation.html.haml @@ -5,4 +5,8 @@ = link_to t('back', scope: [:layouts, :header]), url_for(:back), title: t('back_title', scope: [:layouts, :header]), class: 'fr-nav__link', "aria-controls" => "modal-header__menu" %li.fr-nav__item - = link_to t('files', scope: [:layouts, :header]), dossiers_path, class: 'fr-nav__link', aria: { current: controller_name == 'dossiers' ? 'true' : nil, controls: "modal-header__menu" } + = link_to t('files', scope: [:layouts, :header]), dossiers_path, class: 'fr-nav__link', aria: { current: (controller_name == 'dossiers' && action_name != 'deleted_dossiers') ? 'true' : nil, controls: "modal-header__menu" } + + - if current_user.deleted_dossiers.present? + %li.fr-nav__item + = link_to 'Historique des dossiers supprimés', deleted_dossiers_path(), class: 'fr-nav__link', aria: { current: action_name == 'deleted_dossiers' ? 'true' : nil, controls: "modal-header__menu" } diff --git a/app/views/users/dossiers/deleted_dossiers.html.haml b/app/views/users/dossiers/deleted_dossiers.html.haml index 9d30962cf..77dc10568 100644 --- a/app/views/users/dossiers/deleted_dossiers.html.haml +++ b/app/views/users/dossiers/deleted_dossiers.html.haml @@ -5,8 +5,6 @@ .fr-container - .fr-mb-3w - = link_to "Retour à la liste des dossiers", dossiers_path(), class: "fr-link fr-icon-arrow-left-line fr-link--icon-left" %h1.fr-h2 Historique des dossiers supprimés diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index b2ce5dcb9..fe0090150 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -5,11 +5,7 @@ .dossiers-headers.sub-header .fr-container - .flex.align-center - %h1.page-title.fr-h2= t('views.users.dossiers.index.dossiers') - - if @dossiers_supprimes_historique.present? - %p.ml-auto - = link_to('Historique des dossiers supprimés', deleted_dossiers_path(), class: 'fr-link') + %h1.page-title.fr-h2= t('views.users.dossiers.index.dossiers') .fr-grid-row.fr-grid-row--gutters - if current_user.dossiers.count > 2 || current_user.dossiers_invites.count > 2 From 5281ab966aef278420e258879d7762f130be8667 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Wed, 24 Jul 2024 14:39:55 +0200 Subject: [PATCH 6/9] add deleted dossiers in menu for instructeurs --- app/helpers/dossier_helper.rb | 2 +- .../instructeurs/procedures/_header.html.haml | 4 ++ .../procedures/deleted_dossiers.html.haml | 56 +++++++------------ .../instructeurs/procedures/show.html.haml | 5 -- config/locales/fr.yml | 2 +- .../locales/views/instructeurs/header/fr.yml | 10 ++-- spec/system/instructeurs/instruction_spec.rb | 2 +- 7 files changed, 32 insertions(+), 49 deletions(-) diff --git a/app/helpers/dossier_helper.rb b/app/helpers/dossier_helper.rb index 7394a71e6..a68a0b43c 100644 --- a/app/helpers/dossier_helper.rb +++ b/app/helpers/dossier_helper.rb @@ -105,7 +105,7 @@ module DossierHelper status_class = 'unknown' end - tag.span(status_text, class: "label #{status_class} ") + tag.span(status_text, class: "fr-badge #{status_class} ") end def pending_correction_badge(for_profile, html_class: nil) diff --git a/app/views/instructeurs/procedures/_header.html.haml b/app/views/instructeurs/procedures/_header.html.haml index 6714ec668..99ee79e51 100644 --- a/app/views/instructeurs/procedures/_header.html.haml +++ b/app/views/instructeurs/procedures/_header.html.haml @@ -24,9 +24,13 @@ | = link_to t('instructeurs.dossiers.header.banner.administrators_list'), administrateurs_instructeur_procedure_path(procedure), class: 'header-link' | + = link_to t('views.instructeurs.dossiers.show_deleted_dossiers'), deleted_dossiers_instructeur_procedure_path(@procedure), class: "header-link" + | = link_to t('instructeurs.dossiers.header.banner.exports_list'), exports_instructeur_procedure_path(procedure), class: 'header-link' - if @has_export_notification %span.notifications{ 'aria-label': t('instructeurs.dossiers.header.banner.exports_notification_label') } + + #last-export-alert = render partial: "last_export_alert", locals: { export: @last_export, statut: @statut } diff --git a/app/views/instructeurs/procedures/deleted_dossiers.html.haml b/app/views/instructeurs/procedures/deleted_dossiers.html.haml index 7a5b3ccbf..6aa4757a4 100644 --- a/app/views/instructeurs/procedures/deleted_dossiers.html.haml +++ b/app/views/instructeurs/procedures/deleted_dossiers.html.haml @@ -1,41 +1,25 @@ - content_for(:title, "#{@procedure.libelle}") -#procedure-show - .sub-header - .fr-container.flex += render partial: 'administrateurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], + ['Historique des dossiers supprimés']] } - .procedure-logo{ style: "background-image: url(#{@procedure.logo_url})", - role: 'img', 'aria-label': "logo de la démarche #{@procedure.libelle}" } +.fr-container + .fr-mb-3w + = link_to "Retour à la démarche", instructeur_procedure_path(@procedure), class: "fr-link fr-icon-arrow-left-line fr-link--icon-left" + %h1.titre-dossiers Historique des dossiers supprimés - = render partial: 'header', locals: { procedure: @procedure, statut: @statut } - - .procedure-actions - - if @can_download_dossiers - = render Dossiers::ExportDropdownComponent.new(procedure: @procedure, export_templates: current_instructeur.export_templates_for(@procedure), export_url: method(:download_export_instructeur_procedure_path)) - - .fr-container.flex= render partial: "tabs", locals: { procedure: @procedure, - statut: @statut, - a_suivre_count: @a_suivre_count, - suivis_count: @suivis_count, - traites_count: @traites_count, - tous_count: @tous_count, - supprimes_count: @supprimes_count, - archives_count: @archives_count, - expirant_count: @expirant_count, - has_en_cours_notifications: @has_en_cours_notifications, - has_termine_notifications: @has_termine_notifications } - - .fr-container - %h1.titre-dossiers Dossiers supprimés - %details - %summary Les dossiers ont été supprimés. Vous ne pouvez plus les récupérer depuis Démarches Simplifiées. - Ceci s'explique pour les raisons suivantes : - %ul - %li L’utilisateur a intentionnellement supprimé son dossier. - %li Le délai de conservation maximal de #{@procedure.duree_conservation_dossiers_dans_ds} mois a expiré. Conformément au règlement RGPD, DS ne peut continuer à les héberger. - - if @deleted_dossiers.any? + - if @deleted_dossiers.any? + = render Dsfr::CalloutComponent.new(title: nil) do |c| + - c.with_body do + %p Les dossiers ont été supprimés. Vous ne pouvez plus les récupérer depuis Démarches Simplifiées. + Ceci s'explique pour les raisons suivantes : + %ul + %li L’utilisateur a intentionnellement supprimé son dossier. + %li Le délai de conservation maximal de #{@procedure.duree_conservation_dossiers_dans_ds} mois a expiré. Conformément au règlement RGPD, DS ne peut continuer à les héberger. = paginate @deleted_dossiers, views_prefix: 'shared' - %table.table.dossiers-table.hoverable + .fr-table.fr-table--layout-fixed.fr-mt-3w + %table %thead %tr %th.number-col N° dossier @@ -50,6 +34,6 @@ = deletion_reason_badge(deleted_dossier.reason) %td.deleted-cell = l(deleted_dossier.deleted_at, format: '%d/%m/%y') - = paginate @deleted_dossiers, views_prefix: 'shared' - - else - Aucun dossier supprimé + = paginate @deleted_dossiers, views_prefix: 'shared' + - else + Aucun dossier supprimé diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 7a30d95ac..92b423f6b 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -65,11 +65,6 @@ = render Dossiers::NotifiedToggleComponent.new(procedure: @procedure, procedure_presentation: @procedure_presentation) if @statut != 'a-suivre' .fr-ml-auto - - - if @statut == 'archives' - = link_to deleted_dossiers_instructeur_procedure_path(@procedure), class: "fr-link fr-icon-delete-line fr-link--icon-left fr-mr-2w" do - = t('views.instructeurs.dossiers.show_deleted_dossiers') - - if @dossiers_count > 0 %span.dossiers-export = render Dossiers::ExportDropdownComponent.new(procedure: @procedure, export_templates: current_instructeur.export_templates_for(@procedure), statut: @statut, count: @dossiers_count, class_btn: 'fr-btn--tertiary', export_url: method(:download_export_instructeur_procedure_path)) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 56b9cd648..257b9d9d5 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -413,7 +413,7 @@ fr: batch_operation: enabled: "Ajouter le dossier %{dossier_id} à la sélection pour un traitement de masse" disabled: "Impossible d'ajouter le dossier %{dossier_id} à la selection car il est déjà dans un traitement de masse" - show_deleted_dossiers: Afficher les dossiers supprimés + show_deleted_dossiers: Historique des dossiers supprimés personalize: Personnaliser passer_en_instruction: Passer en instruction repasser_en_construction: Repasser en construction diff --git a/config/locales/views/instructeurs/header/fr.yml b/config/locales/views/instructeurs/header/fr.yml index aad1fe4aa..c13a4ded0 100644 --- a/config/locales/views/instructeurs/header/fr.yml +++ b/config/locales/views/instructeurs/header/fr.yml @@ -11,10 +11,10 @@ fr: en_construction: Ce dossier est en attente de prise en charge. Vous pouvez toutefois étendre cette durée d’un mois en cliquant sur le bouton suivant. termine: Le traitement de ce dossier est terminé, mais il va bientôt être supprimé. Si vous souhaitez en conserver une trace, vous pouvez le télécharger au format PDF. button_delay_expiration: "Conserver un mois de plus" - notification_management: gestion des notifications - administrators_list: voir les administrateurs - exports_list: voir les exports + notification_management: Gestion des notifications + administrators_list: Voir les administrateurs + exports_list: Voir les exports exports_notification_label: Un nouvel export est prêt à être téléchargé - statistics: statistiques + statistics: Statistiques instructeurs: instructeurs - contact_users: contacter les usagers (brouillon) + contact_users: Contacter les usagers (brouillon) diff --git a/spec/system/instructeurs/instruction_spec.rb b/spec/system/instructeurs/instruction_spec.rb index f36b15f5f..2b81184df 100644 --- a/spec/system/instructeurs/instruction_spec.rb +++ b/spec/system/instructeurs/instruction_spec.rb @@ -135,7 +135,7 @@ describe 'Instructing a dossier:', js: true do expect(page).to have_text('Nous générons cet export.') - click_on "voir les exports" + click_on "Voir les exports" expect(page).to have_text("Export .csv d’un dossier « à suivre » demandé il y a moins d'une minute") expect(page).to have_text("En préparation") From 286758e933a8a1d442f5279f3e4b90dd8fde315b Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Wed, 24 Jul 2024 16:36:47 +0200 Subject: [PATCH 7/9] create component to display deleted dossiers --- .../dossiers/deleted_dossiers_component.rb | 11 +++++ .../deleted_dossiers_component.en.yml | 7 +++ .../deleted_dossiers_component.fr.yml | 7 +++ .../deleted_dossiers_component.html.haml | 47 +++++++++++++++++++ .../procedures/deleted_dossiers.html.haml | 30 +----------- .../users/dossiers/deleted_dossiers.html.haml | 35 +------------- 6 files changed, 74 insertions(+), 63 deletions(-) create mode 100644 app/components/dossiers/deleted_dossiers_component.rb create mode 100644 app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.en.yml create mode 100644 app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.fr.yml create mode 100644 app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.html.haml diff --git a/app/components/dossiers/deleted_dossiers_component.rb b/app/components/dossiers/deleted_dossiers_component.rb new file mode 100644 index 000000000..ab1d2f9c5 --- /dev/null +++ b/app/components/dossiers/deleted_dossiers_component.rb @@ -0,0 +1,11 @@ +class Dossiers::DeletedDossiersComponent < ApplicationComponent + include DossierHelper + + def initialize(deleted_dossiers:) + @deleted_dossiers = deleted_dossiers + end + + def role + controller.try(:nav_bar_profile) + end +end diff --git a/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.en.yml b/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.en.yml new file mode 100644 index 000000000..a3b9fdb95 --- /dev/null +++ b/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.en.yml @@ -0,0 +1,7 @@ +en: + deleted_explanation: "The folders have been deleted. You can no longer recover them for the following reasons:" + deleted_explanation_first_instructor: The user intentionally deleted their folder. + deleted_explanation_second_instructor: The maximum retention period has expired. In accordance with GDPR regulations, the application cannot continue to host them. + deleted_explanation_first_user: You have deleted your folder. + deleted_explanation_second_user: The maximum retention period has expired. In accordance with GDPR regulations, the application cannot continue to host them. + no_deleted_folders: You have no permanently deleted folders. diff --git a/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.fr.yml b/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.fr.yml new file mode 100644 index 000000000..d29d35120 --- /dev/null +++ b/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.fr.yml @@ -0,0 +1,7 @@ +fr: + deleted_explanation: "Les dossiers ont été supprimés. Vous ne pouvez plus les récupérer pour les raisons suivantes :" + deleted_explanation_first_instructeur: L’utilisateur a intentionnellement supprimé son dossier. + deleted_explanation_second_instructeur: Le délai de conservation maximal a expiré. Conformément au règlement RGPD, l'application ne peut continuer à les héberger. + deleted_explanation_first_user: Vous avez supprimé votre dossier. + deleted_explanation_second_user: Le délai de conservation maximal a expiré. Conformément au règlement RGPD, l'application ne peut continuer à les héberger. + no_deleted_dossiers: Vous n'avez pas de dossiers supprimés définitivement. diff --git a/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.html.haml b/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.html.haml new file mode 100644 index 000000000..1fc51132a --- /dev/null +++ b/app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.html.haml @@ -0,0 +1,47 @@ + +.fr-container + %h1.fr-h2 + Historique des dossiers supprimés + +.fr-container + - if @deleted_dossiers.present? + = render Dsfr::CalloutComponent.new(title: nil) do |c| + - c.with_body do + %p + = t('.deleted_explanation') + + %ul + %li + = t(".deleted_explanation_first_#{role}") + %li + = t(".deleted_explanation_second_#{role}") + + .fr-table.fr-table--layout-fixed.fr-mt-3w + %table + %thead + %tr + %th.number-col N° dossier + %th Libellé de la démarche + %th Raison de suppression + %th Date de suppression + %tbody + - @deleted_dossiers.each do |deleted_dossier| + %tr + %td.number-col + = deleted_dossier.dossier_id + + %td.number-col + = deleted_dossier.procedure.libelle.truncate_words(10) + + %td + = deletion_reason_badge(deleted_dossier.reason) + -# .fr-badge + -# = t("activerecord.attributes.deleted_dossier.reason.#{deleted_dossier.reason}") + %td.deleted-cell + = l(deleted_dossier.deleted_at, format: '%d/%m/%y') + + = paginate @deleted_dossiers, views_prefix: 'shared' + + - else + %p + = t('.no_deleted_dossiers') diff --git a/app/views/instructeurs/procedures/deleted_dossiers.html.haml b/app/views/instructeurs/procedures/deleted_dossiers.html.haml index 6aa4757a4..3b7bb170a 100644 --- a/app/views/instructeurs/procedures/deleted_dossiers.html.haml +++ b/app/views/instructeurs/procedures/deleted_dossiers.html.haml @@ -7,33 +7,5 @@ .fr-container .fr-mb-3w = link_to "Retour à la démarche", instructeur_procedure_path(@procedure), class: "fr-link fr-icon-arrow-left-line fr-link--icon-left" - %h1.titre-dossiers Historique des dossiers supprimés - - if @deleted_dossiers.any? - = render Dsfr::CalloutComponent.new(title: nil) do |c| - - c.with_body do - %p Les dossiers ont été supprimés. Vous ne pouvez plus les récupérer depuis Démarches Simplifiées. - Ceci s'explique pour les raisons suivantes : - %ul - %li L’utilisateur a intentionnellement supprimé son dossier. - %li Le délai de conservation maximal de #{@procedure.duree_conservation_dossiers_dans_ds} mois a expiré. Conformément au règlement RGPD, DS ne peut continuer à les héberger. - = paginate @deleted_dossiers, views_prefix: 'shared' - .fr-table.fr-table--layout-fixed.fr-mt-3w - %table - %thead - %tr - %th.number-col N° dossier - %th Raison de suppression - %th Date de suppression - %tbody - - @deleted_dossiers.each do |deleted_dossier| - %tr - %td.number-col - = deleted_dossier.dossier_id - %td - = deletion_reason_badge(deleted_dossier.reason) - %td.deleted-cell - = l(deleted_dossier.deleted_at, format: '%d/%m/%y') - = paginate @deleted_dossiers, views_prefix: 'shared' - - else - Aucun dossier supprimé += render Dossiers::DeletedDossiersComponent.new(deleted_dossiers: @deleted_dossiers) diff --git a/app/views/users/dossiers/deleted_dossiers.html.haml b/app/views/users/dossiers/deleted_dossiers.html.haml index 77dc10568..938f00cc3 100644 --- a/app/views/users/dossiers/deleted_dossiers.html.haml +++ b/app/views/users/dossiers/deleted_dossiers.html.haml @@ -3,37 +3,4 @@ = render partial: 'administrateurs/breadcrumbs', locals: { steps: [['Historique des dossiers supprimés']] } - -.fr-container - %h1.fr-h2 - Historique des dossiers supprimés - -.fr-container - - if @deleted_dossiers.present? - %h2.fr-h6.fr-mb-2w - = page_entries_info @deleted_dossiers - - - @deleted_dossiers.each do |dossier| - .card - .flex.justify-between - %div - %h3.card-title - = dossier.procedure.libelle - - %p.fr-icon--sm.fr-icon-delete-line.fr-mb-0 - = t('views.users.dossiers.dossiers_list.deleted', date: l(dossier.updated_at.to_date)) - = "-" - = t("activerecord.attributes.deleted_dossier.reason.#{dossier.reason}") - - .text-right - %p.fr-mb-0 - = t('views.users.dossiers.dossiers_list.n_dossier') - = dossier.dossier_id - - = paginate @deleted_dossiers, views_prefix: 'shared' - - - else - .blank-tab - %h2.empty-text= t('views.users.dossiers.dossiers_list.no_result_title') - %p.empty-text-details - = t('views.users.dossiers.dossiers_list.no_result_text_html', app_base: Current.application_base_url) += render Dossiers::DeletedDossiersComponent.new(deleted_dossiers: @deleted_dossiers) From 686000d6cbd043b54aebd0949901c8337db0597d Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 30 Jul 2024 11:28:54 +0200 Subject: [PATCH 8/9] fix spec --- spec/models/instructeur_spec.rb | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/spec/models/instructeur_spec.rb b/spec/models/instructeur_spec.rb index 1b12cfddb..5ed797ff8 100644 --- a/spec/models/instructeur_spec.rb +++ b/spec/models/instructeur_spec.rb @@ -719,13 +719,15 @@ describe Instructeur, type: :model do context 'with an archives dossier' do let!(:archives_dossier) { create(:dossier, :en_instruction, procedure: procedure, archived: true) } - it { expect(subject['a_suivre']).to eq(0) } - it { expect(subject['suivis']).to eq(0) } - it { expect(subject['traites']).to eq(0) } - it { expect(subject['tous']).to eq(0) } - it { expect(subject['archives']).to eq(1) } - it { expect(subject['supprimes_recemment']).to eq(0) } - it { expect(subject['expirant']).to eq(0) } + it do + expect(subject['a_suivre']).to eq(0) + expect(subject['suivis']).to eq(0) + expect(subject['traites']).to eq(0) + expect(subject['tous']).to eq(0) + expect(subject['archives']).to eq(1) + expect(subject['supprimes']).to eq(0) + expect(subject['expirant']).to eq(0) + end context 'and terminer dossiers on each of the others groups' do let!(:archives_dossier_on_gi_2) { create(:dossier, :en_instruction, groupe_instructeur: gi_2, archived: true) } @@ -742,13 +744,15 @@ describe Instructeur, type: :model do let!(:expiring_dossier_en_construction) { create(:dossier, :en_construction, en_construction_at: 175.days.ago, procedure: procedure) } before { subject } - it { expect(subject['a_suivre']).to eq(1) } - it { expect(subject['suivis']).to eq(0) } - it { expect(subject['traites']).to eq(1) } - it { expect(subject['tous']).to eq(2) } - it { expect(subject['archives']).to eq(0) } - it { expect(subject['supprimes_recemment']).to eq(2) } - it { expect(subject['expirant']).to eq(2) } + it do + expect(subject['a_suivre']).to eq(1) + expect(subject['suivis']).to eq(0) + expect(subject['traites']).to eq(1) + expect(subject['tous']).to eq(2) + expect(subject['archives']).to eq(0) + expect(subject['supprimes']).to eq(2) + expect(subject['expirant']).to eq(2) + end end end end From 16864cc868cfb228454d61d81eac559c20f1b9c3 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Tue, 20 Aug 2024 14:58:00 +0200 Subject: [PATCH 9/9] fix test --- app/views/users/dossiers/_dossiers_list.html.haml | 6 +----- config/locales/en.yml | 3 ++- config/locales/fr.yml | 1 - spec/system/users/list_dossiers_spec.rb | 12 ++++++------ 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/views/users/dossiers/_dossiers_list.html.haml b/app/views/users/dossiers/_dossiers_list.html.haml index 663d8e33b..da58f4be2 100644 --- a/app/views/users/dossiers/_dossiers_list.html.haml +++ b/app/views/users/dossiers/_dossiers_list.html.haml @@ -43,11 +43,7 @@ = t('views.users.dossiers.dossiers_list.n_dossier') = number_with_html_delimiter(dossier.id) - - if @statut == "dossiers-supprimes" - %span.fr-badge.fr-badge--sm.fr-badge--warning - = t('views.users.dossiers.dossiers_list.deleted_badge') - - else - = status_badge_user(dossier, 'fr-mb-1w') + = status_badge_user(dossier, 'fr-mb-1w') - if dossier.pending_correction? %br diff --git a/config/locales/en.yml b/config/locales/en.yml index 4a7264a67..d3570abaf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -513,7 +513,8 @@ en: created_at: Created at %{date} updated_at: updated at %{date} shared_with: File shared by %{owner} with - deleted: Deleted at %{date} + deleted_by_user: Deleted on %{date} by user + deleted_by_automatic: Deleted on %{date} automatically due to expiration date procedure_closed: brouillon: internal_procedure_html: This procedure is closed. You cannot submit this file. We invite you to submit a new one on the %{link} which replaces it. diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 257b9d9d5..a6e214613 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -533,7 +533,6 @@ fr: created_at: Créé le %{date} updated_at: modifié le %{date} shared_with: Dossier partagé par %{owner} avec - deleted: Supprimé le %{date} deleted_by_user: Supprimé le %{date} par l'usager deleted_by_automatic: Supprimé le %{date} automatiquement du à la date d'expiration dossier_action: diff --git a/spec/system/users/list_dossiers_spec.rb b/spec/system/users/list_dossiers_spec.rb index dd514b931..67372dd6b 100644 --- a/spec/system/users/list_dossiers_spec.rb +++ b/spec/system/users/list_dossiers_spec.rb @@ -219,7 +219,7 @@ describe 'user access to the list of their dossiers', js: true do describe 'restore' do it 'should have links to restore dossiers' do - click_on "3 supprimés récemment" + click_on "3 supprimés" expect(page).to have_link('Restaurer', href: restore_dossier_path(dossier_en_construction_supprime)) expect(page).to have_button('Restaurer et étendre la conservation') expect(page).to have_link('Télécharger mon dossier', href: dossier_path("#{dossier_traite_expire.id}.pdf")) @@ -227,29 +227,29 @@ describe 'user access to the list of their dossiers', js: true do context 'when user clicks on restore button', js: true do scenario 'the dossier is restored' do - click_on "3 supprimés récemment" + click_on "3 supprimés" expect(page).to have_content(dossier_en_construction_supprime.procedure.libelle) click_on 'Restaurer' expect(page).to have_content('Votre dossier a bien été restauré') - expect(page).to have_content('2 supprimés récemment') + expect(page).to have_content('2 supprimés') end end context 'when user clicks on restore and extend button', js: true do scenario 'the dossier is restored and extended' do - click_on "3 supprimés récemment" + click_on "3 supprimés" expect(page).to have_content(dossier_en_construction_expire.procedure.libelle) click_on 'Restaurer et étendre la conservation' expect(page).to have_content('Votre dossier sera conservé 3 mois supplémentaire') - expect(page).to have_content('2 supprimés récemment') + expect(page).to have_content('2 supprimés') end end context 'when user download PDF of expired' do scenario "generate PDF" do - click_on "3 supprimés récemment" + click_on "3 supprimés" click_on 'Télécharger mon dossier', match: :first # Test fails when an error happens during PDF generation end