change design from table to cards for usager for deleted dossier tab

This commit is contained in:
Lisa Durand 2023-06-29 10:45:31 +02:00
parent 1edfaae354
commit 6738dcf080
8 changed files with 52 additions and 64 deletions

View file

@ -1,38 +1,31 @@
- if deleted_dossiers.present?
%span.fr-h6.fr-mr-2w
.fr-h6.fr-mb-2w
= page_entries_info deleted_dossiers
.fr-table.fr-table--bordered.fr-table--no-caption.fr-mt-2w
%table.table.dossiers-table.hoverable.display-table
%caption= t('views.users.dossiers.dossiers_list.caption')
%thead
%tr
%th.number-col Nº dossier
%th Démarche
%th Raison de suppression
%th Date de suppression
%tbody
- deleted_dossiers.each do |dossier|
%tr{ data: { 'dossier-id': dossier.dossier_id } }
%td.number-col
%span.icon.folder
= dossier.dossier_id
%td
.card
.flex.justify-between
%div
%h2.card-title
= dossier.procedure.libelle
%td.cell-link
= deletion_reason_badge(dossier.reason)
%td
= dossier.updated_at.strftime('%d/%m/%Y')
%p.fr-icon--sm.fr-icon-delete-line.fr-mb-0
= t('views.users.dossiers.dossiers_list.deleted', date: dossier.updated_at.strftime('%d/%m/%Y'))
= "-"
= 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
%span.fr-badge.fr-badge--warning
= t('views.users.dossiers.dossiers_list.deleted_badge')
= paginate deleted_dossiers, views_prefix: 'shared'
- else
.blank-tab
%h2.empty-text
= t("views.users.dossiers.account_creation.empty")
%h2.empty-text= t('views.users.dossiers.dossiers_list.no_result_title')
%p.empty-text-details
= t("views.users.dossiers.account_creation.detail_one")
%p.empty-text-details
= t("views.users.dossiers.account_creation.detail_two")
#{APPLICATION_BASE_URL}/commencer/xxx.
= t('views.users.dossiers.dossiers_list.no_result_text_html', app_base: APPLICATION_BASE_URL)

View file

@ -18,7 +18,7 @@
- if dossier.hidden_by_user?
%p.fr-icon--sm.fr-icon-delete-line
= t('views.users.dossiers.dossiers_list.hidden_by_user', date: dossier.hidden_by_user_at.strftime('%d/%m/%Y'))
= t('views.users.dossiers.dossiers_list.deleted', date: dossier.hidden_by_user_at.strftime('%d/%m/%Y'))
- else
%p.fr-icon--sm.fr-icon-edit-box-line
- if dossier.depose_at.present?
@ -42,7 +42,7 @@
- if @statut == "dossiers-supprimes-recemment"
%span.fr-badge.fr-badge--warning
= t('views.users.dossiers.dossiers_list.hidden_by_user_badge')
= t('views.users.dossiers.dossiers_list.deleted_badge')
- else
= status_badge(dossier.state, 'fr-mb-1w')

View file

@ -78,23 +78,8 @@
- else
= render Dossiers::UserFilterComponent.new(statut: @statut, filter: @filter)
- if @statut == "en-cours"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- if @statut == "traites"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- if @statut == "dossiers-invites"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- if @statut == "dossiers-supprimes-recemment"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- 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 }
- if @statut == "dossiers-transferes"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- if @statut == "dossiers-expirant"
- else
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }

View file

@ -393,10 +393,6 @@ en:
dossier_not_in_instructor_group: "File no. %{dossier_id} of the “%{procedure_libelle}” procedure corresponds to your search, but it is attached to the “%{groupe_instructeur_label}” instructor group."
users:
dossiers:
account_creation:
empty: "No file"
detail_one: "To complete a procedure, contact your administration and ask for the link to the procedure."
detail_two: "This one should look like"
fix_champ: "fill in this field"
archived_dossier: "Your file will be kept %{duree_conservation_dossiers_dans_ds} more months"
identite:
@ -460,7 +456,6 @@ en:
index:
dossiers: "My files"
dossiers_list:
caption: My files
n_dossier: "File n."
no_result_title: No files
no_result_text_html: "To fill a procedure, contact your administration asking for the procedure link. <br> It should look like %{app_base}/commencer/xxx."
@ -472,8 +467,8 @@ en:
created_at: Created at %{date}
updated_at: updated at %{date}
shared_with: File shared with
hidden_by_user: Deleted at %{date}
hidden_by_user_badge: Deleted
deleted: Deleted at %{date}
deleted_badge: Deleted
transfers:
sender_demande_en_cours: "A transfer request is pending on file Nº %{id} to %{email}"
receiver_demande_en_cours: "Transfer request on file Nº %{id} sent by %{email}"

View file

@ -395,10 +395,6 @@ fr:
dossier_not_in_instructor_group: "Le dossier n° %{dossier_id} de la procédure « %{procedure_libelle} » correspond à votre recherche mais il est rattaché au groupe dinstructeurs « %{groupe_instructeur_label} »."
users:
dossiers:
account_creation:
empty: "Aucun dossier"
detail_one: "Pour remplir une démarche, contactez votre administration en lui demandant le lien de la démarche."
detail_two: "Celui ci doit ressembler à"
fix_champ: "corriger lerreur"
archived_dossier: "Votre dossier sera conservé %{duree_conservation_dossiers_dans_ds} mois supplémentaire"
identite:
@ -462,7 +458,6 @@ fr:
index:
dossiers: "Mes dossiers"
dossiers_list:
caption: Mes dossiers
n_dossier: "Nº dossier"
no_result_title: Aucun dossier
no_result_text_html: "Pour remplir une démarche, contactez votre administration en lui demandant le lien de la démarche. <br> Celui ci doit ressembler à %{app_base}/commencer/xxx."
@ -474,8 +469,8 @@ fr:
created_at: Créé le %{date}
updated_at: modifié le %{date}
shared_with: Dossier partagé avec
hidden_by_user: Supprimé le %{date}
hidden_by_user_badge: Supprimé
deleted: Supprimé le %{date}
deleted_badge: Supprimé
dossier_action:
edit_dossier: "Modifier le dossier"
start_other_dossier: "Commencer un autre dossier vide"

View file

@ -0,0 +1,16 @@
en:
activerecord:
models:
deleted_dossier:
one: "Deleted file"
other: "Deleted files"
attributes:
deleted_dossier:
reason:
user_request: User request
manager_request: Manager request
user_removed: User removed
procedure_removed: Procedure removed
expired: Expired
unknown: Unknow
instructeur_request: Deleted by instructor

View file

@ -1,5 +1,9 @@
fr:
activerecord:
models:
deleted_dossier:
one: "Dossier supprimé"
other: "Dossiers supprimés"
attributes:
deleted_dossier:
reason:

View file

@ -11,8 +11,8 @@ describe 'Transfer dossier:' do
end
scenario 'the user can transfer dossier to another user' do
within(:css, "tr[data-dossier-id=\"#{dossier.id}\"]") do
click_on 'Actions'
within(:css, ".card", match: :first) do
click_on 'Autres actions'
click_on 'Transférer le dossier'
end