Merge pull request #10627 from demarches-simplifiees/simplify-tabs-supprimes-ldu
[UX] Simplifier l'interface avec un onglet unique pour les dossiers supprimés
This commit is contained in:
commit
49e9d4a683
40 changed files with 205 additions and 204 deletions
|
@ -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:
|
||||
[
|
||||
|
|
11
app/components/dossiers/deleted_dossiers_component.rb
Normal file
11
app/components/dossiers/deleted_dossiers_component.rb
Normal file
|
@ -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
|
|
@ -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.
|
|
@ -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.
|
|
@ -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')
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
@ -26,15 +26,12 @@ 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
|
||||
|
||||
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 +39,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)
|
||||
|
@ -57,12 +52,11 @@ 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
|
||||
|
||||
@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 +65,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'
|
||||
|
@ -431,18 +423,21 @@ 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
|
||||
# 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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,7 +22,7 @@ class Export < ApplicationRecord
|
|||
suivis: 'suivis',
|
||||
traites: 'traites',
|
||||
tous: 'tous',
|
||||
supprimes_recemment: 'supprimes_recemment',
|
||||
supprimes: 'supprimes',
|
||||
archives: 'archives',
|
||||
expirant: 'expirant'
|
||||
}
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -1,55 +1,11 @@
|
|||
- 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"
|
||||
|
||||
= 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_recemment_count: @supprimes_recemment_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?
|
||||
= paginate @deleted_dossiers, views_prefix: 'shared'
|
||||
%table.table.dossiers-table.hoverable
|
||||
%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)
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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')
|
||||
|
@ -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))
|
||||
|
@ -167,7 +162,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?,
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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)
|
|
@ -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
|
||||
|
@ -96,11 +96,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
|
||||
|
|
6
app/views/users/dossiers/deleted_dossiers.html.haml
Normal file
6
app/views/users/dossiers/deleted_dossiers.html.haml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- content_for(:title, "Historique des dossiers supprimés")
|
||||
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [['Historique des dossiers supprimés']] }
|
||||
|
||||
= render Dossiers::DeletedDossiersComponent.new(deleted_dossiers: @deleted_dossiers)
|
|
@ -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),
|
||||
|
@ -88,9 +82,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 }
|
||||
|
|
|
@ -150,7 +150,6 @@ en:
|
|||
subtitle_two: "Additional notes"
|
||||
content_html: "<p class=\"fr-mb-2w\">The documentation pages are managed by a third-party tool. They are not fully accessible.</p>
|
||||
<p class=\"fr-mb-2w\">FAQ management was delegated to a third-party tool. It was reintegrated into the platform in May 2024 and has not yet been audited.</p>"
|
||||
|
||||
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 <a href=%{archives_path}>download</a> 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 <strong>archive</strong>, <strong>completed</strong> and <strong>deleted by the instructors</strong> on this approach.
|
||||
supprimes: All files not <strong>archive</strong>, <strong>completed</strong> and <strong>deleted by the instructors</strong> 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"
|
||||
|
@ -514,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.
|
||||
|
@ -789,12 +789,9 @@ 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:
|
||||
one: permanently deleted file
|
||||
other: permanently deleted files
|
||||
dossiers_transferes:
|
||||
one: transfer request
|
||||
other: transfer requests
|
||||
|
|
|
@ -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 <a href=%{archives_path}>télécharger</a> 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 <strong>non archivés</strong>, <strong>terminés</strong> et <strong>supprimés par les instructeurs</strong> sur cette démarche
|
||||
supprimes: Tous les dossiers <strong>non archivés</strong>, <strong>terminés</strong> et <strong>supprimés par les instructeurs</strong> 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"
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -802,10 +801,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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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é.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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: [],
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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))
|
||||
|
@ -97,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
|
||||
|
|
Loading…
Reference in a new issue