Skip to content

Commit

Permalink
Améliore la liste des démarches pour l'interface instructeuer
Browse files Browse the repository at this point in the history
  • Loading branch information
kara22 committed Dec 11, 2024
1 parent fac38c5 commit 7499b6e
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 103 deletions.
25 changes: 5 additions & 20 deletions app/assets/stylesheets/procedure_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@

li {
min-height: 36px;
width: 90px;
min-width: 6em;
color: var(--text-default-grey);
position: relative;

border-left: 1px solid $border-grey;

&:first-child {
border-left: none;
}
Expand All @@ -35,24 +34,10 @@
background-color: rgba(0, 0, 0, 0.05);
}

.stats-number,
.stats-legend {
text-align: center;
}

.stats-number {
font-size: 14px;
font-weight: bold;
.notifications {
top: 3px;
right: 18px;
}

.stats-legend {
font-size: 12px;
}
}

.notifications {
top: 3px;
right: 18px;
}
}
}
125 changes: 59 additions & 66 deletions app/views/instructeurs/procedures/_list.html.haml
Original file line number Diff line number Diff line change
@@ -1,80 +1,73 @@
%li.flex.align-start.fr-mb-5w

%li.flex.align-start.fr-mb-3w{ style: "border-top: 1px solid var(--border-default-grey);" }
.flex
.procedure-logo{ style: "background-image: url(#{p.logo_url})" }
.procedure-details
.flex.clipboard-container
.fr-mb-2w
.fr-mb-2w.fr-mt-2w
= procedure_badge(p)
%h3.font-weight-normal.fr-link.fr-ml-1w
= link_to("#{p.libelle} - n°#{p.id}", instructeur_procedure_path(p))
= render Dsfr::CopyButtonComponent.new(title: t('instructeurs.procedures.index.copy_link_button'), text: commencer_url(p.path))
= link_to "#{p.libelle} - n°#{p.id}", instructeur_procedure_path(p)

%ul.procedure-stats.flex
%li
%object
= link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do
- a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0
.stats-number
= number_with_html_delimiter(a_suivre_count)
.stats-legend
= t('instructeurs.dossiers.labels.to_follow')
%li
%object
= link_to(instructeur_procedure_path(p, statut: 'suivis')) do
- if procedure_ids_en_cours_with_notifications.include?(p.id)
%span.notifications{ 'aria-label': "notifications" }
- followed_count = followed_dossiers_count_per_procedure[p.id] || 0
.stats-number
= number_with_html_delimiter(followed_count)
.stats-legend
= t('pluralize.followed', count: followed_count)
%li
%object
= link_to(instructeur_procedure_path(p, statut: 'traites')) do
- if procedure_ids_termines_with_notifications.include?(p.id)
%span.notifications{ 'aria-label': "notifications" }
- termines_count = dossiers_termines_count_per_procedure[p.id] || 0
.stats-number
= number_with_html_delimiter(termines_count)
.stats-legend
= t('pluralize.processed', count: termines_count)
%li
%object
= link_to(instructeur_procedure_path(p, statut: 'tous')) do
- dossier_count = dossiers_count_per_procedure[p.id] || 0
.stats-number
= number_with_html_delimiter(dossier_count)
.stats-legend
= t('pluralize.case', count: dossier_count)
= render Dsfr::CopyButtonComponent.new(title: t('instructeurs.procedures.index.copy_link_button'), text: commencer_url(p.path))

%li
%object
= 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', count: dossier_count)
%ul.procedure-stats.flex.wrap.flex-gap-1
%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to instructeur_procedure_path(p, statut: 'a-suivre') do
- a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0
.center.fr-text--bold.fr-text--sm
= number_with_html_delimiter(a_suivre_count)
.center.fr-text--xs
= t('instructeurs.dossiers.labels.to_follow')
%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to(instructeur_procedure_path(p, statut: 'suivis')) do
- if procedure_ids_en_cours_with_notifications.include?(p.id)
%span.notifications{ 'aria-label': "notifications" }
- followed_count = followed_dossiers_count_per_procedure[p.id] || 0
.center.fr-text--bold.fr-text--sm
= number_with_html_delimiter(followed_count)
.center.fr-text--xs
= t('pluralize.followed', count: followed_count)
%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to(instructeur_procedure_path(p, statut: 'traites')) do
- if procedure_ids_termines_with_notifications.include?(p.id)
%span.notifications{ 'aria-label': "notifications" }
- termines_count = dossiers_termines_count_per_procedure[p.id] || 0
.center.fr-text--bold.fr-text--sm
= number_with_html_delimiter(termines_count)
.center.fr-text--xs
= t('pluralize.processed', count: termines_count)
%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to(instructeur_procedure_path(p, statut: 'tous')) do
- dossier_count = dossiers_count_per_procedure[p.id] || 0
.center.fr-text--bold.fr-text--sm
= number_with_html_delimiter(dossier_count)
.center.fr-text--xs
= t('pluralize.case', count: dossier_count)

- if p.procedure_expires_when_termine_enabled
%li
%object
= link_to(instructeur_procedure_path(p, statut: 'expirant')) do
- expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0
.stats-number
= number_with_html_delimiter(expirant_count)
.stats-legend
= t('pluralize.dossiers_close_to_expiration', count: expirant_count)
%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to(instructeur_procedure_path(p, statut: 'expirant')) do
- expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0
.center.fr-text--bold.fr-text--sm
= number_with_html_delimiter(expirant_count)
.center.fr-text--xs
= t('pluralize.dossiers_close_to_expiration', count: expirant_count)

%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to(instructeur_procedure_path(p, statut: 'archives')) do
.center.fr-text--bold.fr-text--sm
%span.fr-icon-folder-2-line
.center.fr-text--xs
= t('instructeurs.dossiers.labels.to_archive')

%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to(instructeur_procedure_path(p, statut: 'supprimes')) do
.center.fr-text--bold.fr-text--sm
%span.fr-icon-delete-line
.center.fr-text--xs
= t('instructeurs.dossiers.labels.dossiers_supprimes')

%li
%object
= link_to(instructeur_procedure_path(p, statut: 'archives')) do
- archived_count = dossiers_archived_count_per_procedure[p.id] || 0
.stats-number
= number_with_html_delimiter(archived_count)
.stats-legend
= t('pluralize.archived', count: archived_count)

- if p.close?
.ml-auto
Expand Down
2 changes: 0 additions & 2 deletions app/views/instructeurs/procedures/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@
as: :p,
locals: { dossiers_count_per_procedure: @dossiers_count_per_procedure,
dossiers_a_suivre_count_per_procedure: @dossiers_a_suivre_count_per_procedure,
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_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 }
Expand Down
14 changes: 6 additions & 8 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -772,12 +772,8 @@ en:
new:
one: new
other: new
followed:
one: followed
other: followed
archived:
one: archived
other: archived
followed: followed by me
archived: to archive
en_cours:
one: in progress
other: in progress
Expand All @@ -791,8 +787,8 @@ en:
one: guest file
other: guest files
dossiers_supprimes:
one: recently deleted file
other: recently deleted files
one: deleted
other: deleted
dossiers_transferes:
one: transfer request
other: transfer requests
Expand Down Expand Up @@ -878,6 +874,8 @@ en:
restore: "The folder has been restored"
labels:
to_follow: to follow
to_archive: to archive
dossiers_supprimes: trash
france_connect:
particulier:
choose_email:
Expand Down
12 changes: 6 additions & 6 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,9 @@ fr:
one: nouveau
other: nouveaux
followed:
one: suivi
other: suivis
archived:
one: archivé
other: archivés
one: suivi par moi
other: suivis par moi
archived: à archiver
en_cours:
one: en cours
other: en cours
Expand All @@ -799,7 +797,7 @@ fr:
one: dossier invité
other: dossiers invités
dossiers_supprimes:
one: supprimé
one: supprimé
other: supprimés
dossiers_historique:
one: supprimé définitivement
Expand Down Expand Up @@ -879,6 +877,8 @@ fr:
other: "%{count} groupes existent"
labels:
to_follow: à suivre
to_archive: à archiver
dossiers_supprimes: corbeille
total: dossiers
administrateurs:
activate:
Expand Down
2 changes: 1 addition & 1 deletion spec/system/instructeurs/instruction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def test_statut_bar(a_suivre: 0, suivi: 0, traite: 0, tous_les_dossiers: 0, arch
"#{suivi} suivi",
"#{traite} traité",
"#{tous_les_dossiers} au total",
"#{archive} archivé"
"à archiver"
]

texts.each { |text| expect(page).to have_text(text) }
Expand Down

0 comments on commit 7499b6e

Please sign in to comment.