fix incrementation of success dossiers in batch alert

This commit is contained in:
Lisa Durand 2023-05-11 15:42:23 +02:00
parent b44a2f9ce4
commit 1e7add3b6e
4 changed files with 13 additions and 17 deletions

View file

@ -7,7 +7,7 @@ en:
in_progress: in_progress:
text_success: text_success:
one: 1/1 is being archived one: 1/1 is being archived
other: "%{progress_count}/%{count} files have been archived" other: "%{success_count}/%{count} files have been archived"
passer_en_instruction: passer_en_instruction:
finish: finish:
text_success: text_success:
@ -16,7 +16,7 @@ en:
in_progress: in_progress:
text_success: text_success:
one: 1/1 is being changed to instructing one: 1/1 is being changed to instructing
other: "%{progress_count}/%{count} files have been changed to instructing" other: "%{success_count}/%{count} files have been changed to instructing"
accepter: accepter:
finish: finish:
text_success: text_success:
@ -25,7 +25,7 @@ en:
in_progress: in_progress:
text_success: text_success:
one: 1/1 is being accepted one: 1/1 is being accepted
other: "%{progress_count}/%{count} files have been accepted" other: "%{success_count}/%{count} files have been accepted"
follow: follow:
finish: finish:
text_success: text_success:
@ -34,7 +34,7 @@ en:
in_progress: in_progress:
text_success: text_success:
one: 1/1 is being followed one: 1/1 is being followed
other: "%{progress_count}/%{count} files have been followed" other: "%{success_count}/%{count} files have been followed"
unfollow: unfollow:
finish: finish:
text_success: text_success:
@ -43,7 +43,7 @@ en:
in_progress: in_progress:
text_success: text_success:
one: 1/1 is being unfollowed one: 1/1 is being unfollowed
other: "%{progress_count}/%{count} files have been unfollowed" other: "%{success_count}/%{count} files have been unfollowed"
repasser_en_construction: repasser_en_construction:
finish: finish:
text_success: text_success:
@ -52,7 +52,7 @@ en:
in_progress: in_progress:
text_success: text_success:
one: 1/1 is being changed to in progress one: 1/1 is being changed to in progress
other: "%{progress_count}/%{count} files have been changed to in progress" other: "%{success_count}/%{count} files have been changed to in progress"
title: title:
finish: The bulk action is finished finish: The bulk action is finished
in_progress: A bulk action is processing in_progress: A bulk action is processing

View file

@ -7,7 +7,7 @@ fr:
in_progress: in_progress:
text_success: text_success:
one: 1 dossier sera archivé one: 1 dossier sera archivé
other: "%{progress_count}/%{count} dossiers ont été archivés" other: "%{success_count}/%{count} dossiers ont été archivés"
passer_en_instruction: passer_en_instruction:
finish: finish:
text_success: text_success:
@ -16,7 +16,7 @@ fr:
in_progress: in_progress:
text_success: text_success:
one: 1 dossier sera passé en instruction one: 1 dossier sera passé en instruction
other: "%{progress_count}/%{count} dossiers ont été passés en instruction" other: "%{success_count}/%{count} dossiers ont été passés en instruction"
accepter: accepter:
finish: finish:
text_success: text_success:
@ -25,7 +25,7 @@ fr:
in_progress: in_progress:
text_success: text_success:
one: 1 dossier sera accepté one: 1 dossier sera accepté
other: "%{progress_count}/%{count} dossiers ont été acceptés" other: "%{success_count}/%{count} dossiers ont été acceptés"
follow: follow:
finish: finish:
text_success: text_success:
@ -34,7 +34,7 @@ fr:
in_progress: in_progress:
text_success: text_success:
one: 1 dossier sera suivi one: 1 dossier sera suivi
other: "%{progress_count}/%{count} dossiers ont été suivis" other: "%{success_count}/%{count} dossiers ont été suivis"
unfollow: unfollow:
finish: finish:
text_success: text_success:
@ -43,7 +43,7 @@ fr:
in_progress: in_progress:
text_success: text_success:
one: 1 dossier ne sera plus suivi one: 1 dossier ne sera plus suivi
other: "%{progress_count}/%{count} dossiers ne sont plus suivis" other: "%{success_count}/%{count} dossiers ne sont plus suivis"
repasser_en_construction: repasser_en_construction:
finish: finish:
text_success: text_success:
@ -52,7 +52,7 @@ fr:
in_progress: in_progress:
text_success: text_success:
one: 1 dossier sera repassé en construction one: 1 dossier sera repassé en construction
other: "%{progress_count}/%{count} dossiers ont été repassés en construction" other: "%{success_count}/%{count} dossiers ont été repassés en construction"
title: title:
finish: L'action de masse est terminée finish: L'action de masse est terminée
in_progress: Une action de masse est en cours in_progress: Une action de masse est en cours

View file

@ -9,7 +9,7 @@
- else - else
= render Dsfr::AlertComponent.new(title: t(".title.in_progress"), state: :info, heading_level: 'h2') do |c| = render Dsfr::AlertComponent.new(title: t(".title.in_progress"), state: :info, heading_level: 'h2') do |c|
- c.body do - c.body do
%p= t(".#{batch.operation}.in_progress.text_success", count: @batch.total_count, progress_count: @batch.progress_count) %p= t(".#{batch.operation}.in_progress.text_success", count: @batch.total_count, success_count: @batch.success_count)
%p %p
= link_to t('.link_text'), instructeur_procedure_path(@procedure, statut: params["statut"]), data: { action: 'turbo-poll#refresh' } = link_to t('.link_text'), instructeur_procedure_path(@procedure, statut: params["statut"]), data: { action: 'turbo-poll#refresh' }

View file

@ -128,10 +128,6 @@ class BatchOperation < ApplicationRecord
dossier_operations.size dossier_operations.size
end end
def progress_count
dossier_operations.pending.size
end
def success_count def success_count
dossier_operations.success.size dossier_operations.success.size
end end