Fetch all count at once (- 400ms on pass culture)

This commit is contained in:
simon lehericey 2021-04-09 09:32:10 +02:00
parent 9a5a41d0bb
commit 430acb1cb0
3 changed files with 38 additions and 8 deletions

View file

@ -24,29 +24,29 @@
= tab_item('à suivre',
instructeur_procedure_path(@procedure, statut: 'a-suivre'),
active: @statut == 'a-suivre',
badge: number_with_html_delimiter(@a_suivre_dossiers.count))
badge: number_with_html_delimiter(@a_suivre_count))
= tab_item(t('pluralize.followed', count: @followed_dossiers.count),
= tab_item(t('pluralize.followed', count: @suivis_count),
instructeur_procedure_path(@procedure, statut: 'suivis'),
active: @statut == 'suivis',
badge: number_with_html_delimiter(@followed_dossiers.count),
badge: number_with_html_delimiter(@suivis_count),
notification: @has_en_cours_notifications)
= tab_item(t('pluralize.processed', count: @termines_dossiers.count),
= tab_item(t('pluralize.processed', count: @traites_count),
instructeur_procedure_path(@procedure, statut: 'traites'),
active: @statut == 'traites',
badge: number_with_html_delimiter(@termines_dossiers.count),
badge: number_with_html_delimiter(@traites_count),
notification: @has_termine_notifications)
= tab_item('tous les dossiers',
instructeur_procedure_path(@procedure, statut: 'tous'),
active: @statut == 'tous',
badge: number_with_html_delimiter(@all_state_dossiers.count))
badge: number_with_html_delimiter(@tous_count))
= tab_item(t('pluralize.archived', count: @archived_dossiers.count),
= tab_item(t('pluralize.archived', count: @archives_count),
instructeur_procedure_path(@procedure, statut: 'archives'),
active: @statut == 'archives',
badge: number_with_html_delimiter(@archived_dossiers.count))
badge: number_with_html_delimiter(@archives_count))
.procedure-actions
= render partial: "download_dossiers",