Merge pull request #8947 from demarches-simplifiees/user-dashboard/add-pagination

[refonte usager] Tableau de bord - Améliorer pagination
This commit is contained in:
Lisa Durand 2023-04-24 14:08:08 +00:00 committed by GitHub
commit f5ffd1ad5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 84 additions and 70 deletions

View file

@ -20,7 +20,7 @@ export class BatchOperationController extends ApplicationController {
this.inputTargets.forEach((e) => (e.checked = target.checked));
this.toggleSubmitButtonWhenNeeded();
const pagination = document.querySelector('tfoot .pagination');
const pagination = document.querySelector('tfoot .fr-pagination');
if (pagination) {
displayNotice(this.inputTargets);
}

View file

@ -3,4 +3,4 @@
= link_to_prev_page resources, t("views.pagination.previous"), param_name: "_page"
= link_to_next_page resources, t("views.pagination.next"), param_name: "_page"
- else
= paginate resources, param_name: "_page"
= paginate resources, param_name: "_page", views_prefix: 'shared'

View file

@ -64,4 +64,4 @@
= t('.group_management.move_files', count: group.dossiers.visible_by_administration.size)
= paginate groupes_instructeurs
= paginate groupes_instructeurs, views_prefix: 'shared'

View file

@ -39,4 +39,4 @@
params: { instructeur: { id: instructeur.id }},
class: 'fr-btn fr-btn--secondary' }
= paginate instructeurs
= paginate instructeurs, views_prefix: 'shared'

View file

@ -23,4 +23,4 @@
{ class: 'button',
data: { confirm: "Êtes-vous sûr de vouloir réaffecter les dossiers du groupe « #{@groupe_instructeur.label} » vers le groupe  « #{group.label} » ?" } }
= paginate @groupes_instructeurs
= paginate @groupes_instructeurs, views_prefix: 'shared'

View file

@ -29,7 +29,7 @@
- if @filter.from_publication_date.present?
.selected-from-publication-date.fr-mb-2w
= link_to "Depuis le #{l(@filter.from_publication_date)}", all_admin_procedures_path(@filter.without(:from_publication_date)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
= paginate @admins, views_prefix: 'administrateurs'
= paginate @admins, views_prefix: 'shared'
%thead
%tr
%th{ scope: 'col' }
@ -51,4 +51,4 @@
%ul
- admin.procedures.each do |procedure|
%li= procedure.libelle
.fr-mt-2w= paginate @admins, views_prefix: 'administrateurs'
.fr-mt-2w= paginate @admins, views_prefix: 'shared'

View file

@ -38,7 +38,7 @@
- if @filter.from_publication_date.present?
.selected-from-publication-date.fr-mb-2w
= link_to "Depuis #{l(@filter.from_publication_date)}", all_admin_procedures_path(@filter.without(:from_publication_date)), class: 'fr-tag fr-tag--dismiss fr-mb-1w'
= paginate @procedures, params: @filter.params, views_prefix: 'administrateurs'
= paginate @procedures, params: @filter.params, views_prefix: 'shared'
%thead
%tr
%th{ scope: 'col' }
@ -52,4 +52,4 @@
%tbody{ 'data-turbo': 'true' }
- @procedures.each do |procedure|
= render partial: 'detail', locals: { procedure: procedure, show_detail: false }
.fr-mt-2w= paginate @procedures, params: @filter.params, views_prefix: 'administrateurs'
.fr-mt-2w= paginate @procedures, params: @filter.params, views_prefix: 'shared'

View file

@ -15,16 +15,16 @@
.fr-container#procedures{ data: { item_count: @statut === "publiees" ? @procedures_publiees_count : @statut === "brouillons" ? @procedures_draft_count : @procedures_closed_count } }
- if @statut === "publiees"
= render partial: "procedures_list", locals: { procedures: @procedures_publiees }
= paginate @procedures_publiees
= paginate @procedures_publiees, views_prefix: 'shared'
- if @statut === "brouillons"
= render partial: "procedures_list", locals: { procedures: @procedures_draft }
= paginate @procedures_draft
= paginate @procedures_draft, views_prefix: 'shared'
- if @statut === "archivees"
= render partial: "procedures_list", locals: { procedures: @procedures_closed }
= paginate @procedures_closed
= paginate @procedures_closed, views_prefix: 'shared'
- if @statut === "supprimees"
= render partial: "procedures_list", locals: { procedures: @procedures_deleted }
= paginate @procedures_deleted
= paginate @procedures_deleted, views_prefix: 'shared'

View file

@ -41,6 +41,6 @@
#{avis.dossier.id}
%td= link_to(avis.dossier.user_email_for(:display), expert_avis_path(avis.procedure, avis), class: 'cell-link')
%td= link_to(avis.procedure.libelle, expert_avis_path(avis.procedure, avis), class: 'cell-link')
= paginate(@avis)
= paginate @avis, views_prefix: 'shared'
- else
%h2.empty-text Aucun avis

View file

@ -17,4 +17,4 @@
%td= group.label
%td.actions= link_to "voir", instructeur_groupe_path(@procedure, group)
= paginate @groupes_instructeurs
= paginate @groupes_instructeurs, views_prefix: 'shared'

View file

@ -47,4 +47,4 @@
params: { instructeur: { id: instructeur.id }},
class: 'button' }
= paginate @instructeurs
= paginate @instructeurs, views_prefix: 'shared'

View file

@ -34,7 +34,7 @@
%li Lutilisateur 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
= paginate @deleted_dossiers, views_prefix: 'shared'
%table.table.dossiers-table.hoverable
%thead
%tr
@ -53,6 +53,6 @@
= deletion_reason_badge(deleted_dossier.reason)
%td.deleted-cell
= l(deleted_dossier.deleted_at, format: '%d/%m/%y')
= paginate @deleted_dossiers
= paginate @deleted_dossiers, views_prefix: 'shared'
- else
Aucun dossier supprimé

View file

@ -184,7 +184,8 @@
turbo: false }
%tfoot
%tr
%td.force-table-100{ colspan: @procedure_presentation.displayed_fields_for_headers.size + 2 }= paginate @filtered_sorted_paginated_ids
%td.force-table-100{ colspan: @procedure_presentation.displayed_fields_for_headers.size + 2 }
= paginate @filtered_sorted_paginated_ids, views_prefix: 'shared'
- else
%h2.empty-text

View file

@ -11,7 +11,7 @@
= t('pluralize.dossier_trouve', count: @dossiers_count)
- if @projected_dossiers.present?
= paginate @paginated_ids
= paginate @paginated_ids, views_prefix: 'shared'
.fr-table.fr-table--bordered
%table.table.dossiers-table.hoverable
%thead
@ -105,7 +105,7 @@
- else
%td
= paginate @paginated_ids
= paginate @paginated_ids, views_prefix: 'shared'
- else
%h2 Aucun dossier correspondant à votre recherche na été trouvé

View file

@ -1,5 +1,5 @@
= paginator.render do
%nav.fr-pagination{ role: 'navigation', 'aria-label': 'Pagination' }
%nav.fr-pagination.fr-mt-2w{ role: 'navigation', 'aria-label': 'Pagination' }
%ul.fr-pagination__list
= first_page_tag unless current_page.first?
= prev_page_tag unless current_page.first?

View file

@ -1,28 +1,33 @@
- if deleted_dossiers.present?
%table.table.dossiers-table.hoverable
%thead
%tr
%th.number-col Nº dossier
%th Démarche
%th Raison de suppression
%th Date de suppression
%tbody
- deleted_dossiers.each do |dossier|
- libelle_demarche = Procedure.find(dossier.procedure_id).libelle
%span.fr-h6.fr-mr-2w
= page_entries_info hidden_dossiers
%tr{ data: { 'dossier-id': dossier.dossier_id } }
%td.number-col
%span.icon.folder
= dossier.dossier_id
%td
= libelle_demarche
.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|
- libelle_demarche = Procedure.find(dossier.procedure_id).libelle
%td.cell-link
= deletion_reason_badge(dossier.reason)
%td
= dossier.updated_at.strftime('%d/%m/%Y')
%tr{ data: { 'dossier-id': dossier.dossier_id } }
%td.number-col
%span.icon.folder
= dossier.dossier_id
%td
= libelle_demarche
= paginate(deleted_dossiers)
%td.cell-link
= deletion_reason_badge(dossier.reason)
%td
= dossier.updated_at.strftime('%d/%m/%Y')
= paginate deleted_dossiers, views_prefix: 'shared'
- else
.blank-tab

View file

@ -1,5 +1,7 @@
- if dossiers.present?
.fr-table.fr-table--bordered
%span.fr-h6.fr-mr-2w
= page_entries_info dossiers
.fr-table.fr-table--bordered.fr-table--no-caption.fr-mt-2w
%table.table.dossiers-table.hoverable
%caption= t('views.users.dossiers.dossiers_list.caption')
%thead
@ -41,7 +43,7 @@
%td.action-col.follow-col
= render partial: 'dossier_actions', locals: { dossier: dossier }
= paginate(dossiers)
= paginate dossiers, views_prefix: 'shared'
- else
.blank-tab

View file

@ -1,31 +1,37 @@
- if hidden_dossiers.present?
%table.table.dossiers-table.hoverable
%thead
%tr
%th.number-col Nº dossier
%th Démarche
%th Raison de suppression
%th Date de suppression
%tbody
- hidden_dossiers.each do |dossier|
- libelle_demarche = dossier.procedure.libelle
%span.fr-h6.fr-mr-2w
= page_entries_info hidden_dossiers
%tr{ data: { 'dossier-id': dossier.id } }
%td.number-col
%span.icon.folder
= dossier.id
%td
= libelle_demarche
.fr-table.fr-table--bordered.fr-table--no-caption.fr-mt-2w
%table.table.dossiers-table.hoverable
%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
%th.action-col.follow-col Actions
%tbody
- hidden_dossiers.each do |dossier|
- libelle_demarche = dossier.procedure.libelle
%td.cell-link
= deletion_reason_badge("user_request")
%td
= dossier.updated_at.strftime('%d/%m/%Y')
%td
= link_to restore_dossier_path(dossier.id), method: :patch, class: "button primary" do
Restaurer
%tr{ data: { 'dossier-id': dossier.id } }
%td.number-col
%span.icon.folder
= dossier.id
%td
= libelle_demarche
= paginate(hidden_dossiers)
%td.cell-link
= deletion_reason_badge("user_request")
%td
= dossier.updated_at.strftime('%d/%m/%Y')
%td.action-col.follow-col
= link_to restore_dossier_path(dossier.id), method: :patch, class: "fr-btn" do
Restaurer
= paginate hidden_dossiers, views_prefix: 'shared'
- else
.blank-tab

View file

@ -28,7 +28,7 @@
%td= status_badge(dossier.state)
%td.action-col.follow-col{ style: 'padding: 18px;' }= (dossier.depose_at || dossier.created_at).strftime('%d/%m/%Y')
= paginate(dossier_transfers)
= paginate dossier_transfers, views_prefix: 'shared'
- else
.blank-tab