Merge pull request #4929 from betagouv/4907-afficher-les-deleted-dossiers
instructeur: affiche les dossiers supprimés pour une procédure
This commit is contained in:
commit
4e6571512a
13 changed files with 140 additions and 17 deletions
|
@ -32,6 +32,10 @@
|
|||
display: block;
|
||||
}
|
||||
|
||||
.deleted-cell {
|
||||
padding: (2 * $default-spacer) $default-spacer;
|
||||
}
|
||||
|
||||
.icon.folder {
|
||||
position: relative;
|
||||
|
||||
|
|
|
@ -17,21 +17,41 @@
|
|||
border: 1px solid $blue;
|
||||
}
|
||||
|
||||
&.en-instruction {
|
||||
@extend .instruction;
|
||||
}
|
||||
|
||||
&.construction {
|
||||
background-color: #FFFFFF;
|
||||
color: $black;
|
||||
border: 1px solid $black;
|
||||
}
|
||||
|
||||
&.en-construction {
|
||||
@extend .construction;
|
||||
}
|
||||
|
||||
&.accepted {
|
||||
background-color: $green;
|
||||
}
|
||||
|
||||
&.accepte {
|
||||
@extend .accepted;
|
||||
}
|
||||
|
||||
&.refused {
|
||||
background-color: $dark-red;
|
||||
}
|
||||
|
||||
&.refuse {
|
||||
@extend .refused;
|
||||
}
|
||||
|
||||
&.without-continuation {
|
||||
background-color: $black;
|
||||
}
|
||||
|
||||
&.sans-suite {
|
||||
@extend .without-continuation;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
margin-bottom: 1 * $default-padding;
|
||||
}
|
||||
|
||||
.titre-dossiers {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dossiers-table {
|
||||
margin-top: $default-spacer;
|
||||
margin-bottom: 3 * $default-spacer;
|
||||
|
@ -30,6 +34,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
.afficher-dossiers-supprimes {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.filter {
|
||||
display: inline-block;
|
||||
padding-left: 10px;
|
||||
|
@ -48,7 +57,7 @@
|
|||
display: inline-block;
|
||||
}
|
||||
|
||||
p.explication-onglet {
|
||||
.explication-onglet {
|
||||
margin-bottom: 3 * $default-spacer;
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
@ -113,6 +113,14 @@ module Instructeurs
|
|||
assign_exports
|
||||
end
|
||||
|
||||
def deleted_dossiers
|
||||
@procedure = procedure
|
||||
@deleted_dossiers = @procedure
|
||||
.deleted_dossiers.where.not(state: :brouillon)
|
||||
.order(:dossier_id)
|
||||
.page params[:page]
|
||||
end
|
||||
|
||||
def update_displayed_fields
|
||||
values = params[:values]
|
||||
|
||||
|
|
|
@ -83,6 +83,12 @@ module DossierHelper
|
|||
end
|
||||
end
|
||||
|
||||
def status_badge(state)
|
||||
status_text = dossier_display_state(state, lower: true)
|
||||
status_class = state.tr('_', '-')
|
||||
content_tag(:span, status_text, class: "label #{status_class} ")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def dinum_instance?
|
||||
|
|
69
app/views/instructeurs/procedures/deleted_dossiers.html.haml
Normal file
69
app/views/instructeurs/procedures/deleted_dossiers.html.haml
Normal file
|
@ -0,0 +1,69 @@
|
|||
- content_for(:title, "#{@procedure.libelle}")
|
||||
|
||||
#procedure-show
|
||||
.sub-header
|
||||
.container.flex
|
||||
|
||||
.procedure-logo{ style: "background-image: url(#{@procedure.logo_url})",
|
||||
role: 'img', 'aria-label': "logo de la démarche #{@procedure.libelle}" }
|
||||
|
||||
.procedure-header
|
||||
%h1= procedure_libelle @procedure
|
||||
= link_to 'gestion des notifications', email_notifications_instructeur_procedure_path(@procedure), class: 'header-link'
|
||||
|
|
||||
= link_to 'statistiques', stats_instructeur_procedure_path(@procedure), class: 'header-link', data: { turbolinks: false } # Turbolinks disabled for Chartkick. See Issue #350
|
||||
|
||||
- if @procedure.routee?
|
||||
|
|
||||
- if current_administrateur.present? && current_administrateur.owns?(@procedure)
|
||||
= link_to 'instructeurs', procedure_groupe_instructeurs_path(@procedure), class: 'header-link'
|
||||
- else
|
||||
= link_to 'instructeurs', instructeur_groupes_path(@procedure), class: 'header-link'
|
||||
|
||||
%ul.tabs
|
||||
= tab_item('à suivre',
|
||||
instructeur_procedure_path(@procedure, statut: 'a-suivre'))
|
||||
= tab_item(t('pluralize.followed', count: 1),
|
||||
instructeur_procedure_path(@procedure, statut: 'suivis'),
|
||||
active: @statut == 'suivis')
|
||||
|
||||
= tab_item(t('pluralize.processed', count: 1),
|
||||
instructeur_procedure_path(@procedure, statut: 'traites'))
|
||||
|
||||
= tab_item('tous les dossiers',
|
||||
instructeur_procedure_path(@procedure, statut: 'tous'))
|
||||
|
||||
= tab_item(t('pluralize.archived', count: 1),
|
||||
instructeur_procedure_path(@procedure, statut: 'archives'),
|
||||
active: true)
|
||||
|
||||
.container
|
||||
%h1.titre-dossiers Dossiers supprimés
|
||||
%details.explication-onglet
|
||||
%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
|
||||
%table.table.dossiers-table.hoverable
|
||||
%thead
|
||||
%tr
|
||||
%th.notification-col
|
||||
%th.number-col N° dossier
|
||||
%th.status-col Etat
|
||||
%th.status-col Date de suppression
|
||||
%tbody
|
||||
- @deleted_dossiers.each do |deleted_dossier|
|
||||
%tr
|
||||
%td.folder-col
|
||||
%span.icon.folder
|
||||
%td.number-col= deleted_dossier.dossier_id
|
||||
%td.status-col
|
||||
= status_badge(deleted_dossier.state)
|
||||
%td.date-col.deleted-cell= l(deleted_dossier.deleted_at, format: '%d/%m/%y')
|
||||
= paginate @deleted_dossiers
|
||||
- else
|
||||
Aucun dossier supprimé
|
||||
|
|
@ -63,6 +63,10 @@
|
|||
%p.explication-onglet Tous les dossiers qui ont été déposés sur cette démarche, sans aucun filtre.
|
||||
- if @statut == 'archives'
|
||||
%p.explication-onglet Les dossiers de cet onglet sont archivés : vous ne pouvez plus y répondre, et les demandeurs ne peuvent plus les modifier.
|
||||
.afficher-dossiers-supprimes
|
||||
= link_to deleted_dossiers_instructeur_procedure_path(@procedure) do
|
||||
%span.icon.delete
|
||||
Afficher les dossiers supprimés
|
||||
|
||||
- if @dossiers.present? || @current_filters.count > 0
|
||||
= paginate @dossiers
|
||||
|
@ -139,7 +143,7 @@
|
|||
|
||||
%td.status-col
|
||||
= link_to(instructeur_dossier_path(@procedure, dossier), class: 'cell-link') do
|
||||
= render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
|
||||
= status_badge(dossier.state)
|
||||
%td.action-col.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
|
||||
= paginate @dossiers
|
||||
- else
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
%td= link_to(dossier.user.email, dossier_linked_path(current_instructeur, dossier), class: 'cell-link')
|
||||
%td.status-col
|
||||
= link_to(dossier_linked_path(current_instructeur, dossier), class: 'cell-link') do
|
||||
= render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
|
||||
= status_badge(dossier.state)
|
||||
%td.action-col.follow-col= render partial: 'instructeurs/procedures/dossier_actions', locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
|
||||
- else
|
||||
%h2 Aucun dossier correspondant à votre recherche n'a été trouvé
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
- if dossier.brouillon?
|
||||
%span.label.brouillon brouillon
|
||||
- elsif dossier.en_construction?
|
||||
%span.label.construction en construction
|
||||
- elsif dossier.en_instruction?
|
||||
%span.label.instruction en instruction
|
||||
- elsif dossier.accepte?
|
||||
%span.label.accepted accepté
|
||||
- elsif dossier.refuse?
|
||||
%span.label.refused refusé
|
||||
- elsif dossier.sans_suite?
|
||||
%span.label.without-continuation sans suite
|
|
@ -44,7 +44,7 @@
|
|||
= procedure_libelle(dossier.procedure)
|
||||
%td.status-col
|
||||
= link_to(url_for_dossier(dossier), class: 'cell-link') do
|
||||
= render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
|
||||
= status_badge(dossier.state)
|
||||
%td.updated-at-col
|
||||
= link_to(url_for_dossier(dossier), class: 'cell-link') do
|
||||
= try_format_date(dossier.updated_at)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.sub-header
|
||||
.container
|
||||
= render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
|
||||
= status_badge(dossier.state)
|
||||
|
||||
.title-container
|
||||
%span.icon.folder
|
||||
|
|
|
@ -307,6 +307,7 @@ Rails.application.routes.draw do
|
|||
get 'stats'
|
||||
get 'email_notifications'
|
||||
patch 'update_email_notifications'
|
||||
get 'deleted_dossiers'
|
||||
|
||||
resources :dossiers, only: [:show], param: :dossier_id do
|
||||
member do
|
||||
|
|
|
@ -411,6 +411,20 @@ describe Instructeurs::ProceduresController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#deleted_dossiers' do
|
||||
let(:instructeur) { create(:instructeur) }
|
||||
let(:procedure) { create(:procedure, instructeurs: [instructeur]) }
|
||||
let(:deleted_dossier) { create(:deleted_dossier, procedure: procedure, state: :en_construction) }
|
||||
let!(:deleted_dossier_brouillon) { create(:deleted_dossier, procedure: procedure, state: :brouillon) }
|
||||
|
||||
before do
|
||||
sign_in(instructeur.user)
|
||||
get :deleted_dossiers, params: { procedure_id: procedure.id }
|
||||
end
|
||||
|
||||
it { expect(assigns(:deleted_dossiers)).to match_array([deleted_dossier]) }
|
||||
end
|
||||
|
||||
describe '#update_email_notifications' do
|
||||
let(:instructeur) { create(:instructeur) }
|
||||
let!(:procedure) { create(:procedure, instructeurs: [instructeur]) }
|
||||
|
|
Loading…
Reference in a new issue