feat(tabs.expirants): re-order so it comes before deleted dossiers
This commit is contained in:
parent
8e9b15aef4
commit
22531560d8
7 changed files with 90 additions and 23 deletions
|
@ -34,8 +34,8 @@ module Instructeurs
|
|||
'suivis' => @followed_dossiers_count_per_procedure.sum { |_, v| v },
|
||||
'traités' => @dossiers_termines_count_per_procedure.sum { |_, v| v },
|
||||
'dossiers' => @dossiers_count_per_procedure.sum { |_, v| v },
|
||||
'archivés' => @dossiers_archived_count_per_procedure.sum { |_, v| v },
|
||||
'expirant' => @dossiers_expirant_count_per_procedure.sum { |_, v| v }
|
||||
'expirant' => @dossiers_expirant_count_per_procedure.sum { |_, v| v },
|
||||
'archivés' => @dossiers_archived_count_per_procedure.sum { |_, v| v }
|
||||
}
|
||||
|
||||
@procedure_ids_en_cours_with_notifications = current_instructeur.procedure_ids_with_notifications(:en_cours)
|
||||
|
|
|
@ -40,12 +40,14 @@
|
|||
active: statut == 'tous',
|
||||
badge: number_with_html_delimiter(tous_count))
|
||||
|
||||
- if procedure.procedure_expires_when_termine_enabled
|
||||
= tab_item(t('pluralize.dossiers_close_to_expiration', count: expirant_count),
|
||||
instructeur_procedure_path(procedure, statut: 'expirant'),
|
||||
active: statut == 'expirant',
|
||||
badge: number_with_html_delimiter(expirant_count))
|
||||
|
||||
= tab_item(t('pluralize.archived', count: archives_count),
|
||||
instructeur_procedure_path(procedure, statut: 'archives'),
|
||||
active: statut == 'archives',
|
||||
badge: number_with_html_delimiter(archives_count))
|
||||
|
||||
= tab_item(t('pluralize.dossiers_close_to_expiration', count: expirant_count),
|
||||
instructeur_procedure_path(procedure, statut: 'expirant'),
|
||||
active: statut == 'expirant',
|
||||
badge: number_with_html_delimiter(expirant_count))
|
||||
|
|
|
@ -44,6 +44,17 @@
|
|||
= number_with_html_delimiter(dossier_count)
|
||||
.stats-legend
|
||||
= 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
|
||||
%object
|
||||
= link_to(instructeur_procedure_path(p, statut: 'archives')) do
|
||||
|
@ -52,14 +63,6 @@
|
|||
= number_with_html_delimiter(archived_count)
|
||||
.stats-legend
|
||||
= t('pluralize.archived', count: archived_count)
|
||||
%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)
|
||||
|
||||
- if p.close?
|
||||
.procedure-status
|
||||
|
|
|
@ -32,6 +32,12 @@
|
|||
active: @statut == 'dossiers-invites',
|
||||
badge: number_with_html_delimiter(@dossiers_invites.count))
|
||||
|
||||
- if @dossiers_close_to_expiration.count > 0
|
||||
= tab_item(t('pluralize.dossiers_close_to_expiration', count: @dossiers_close_to_expiration.count),
|
||||
dossiers_path(statut: 'dossiers-expirant'),
|
||||
active: @statut == 'dossiers-expirant',
|
||||
badge: number_with_html_delimiter(@dossiers_close_to_expiration.count))
|
||||
|
||||
- if @dossiers_supprimes.present?
|
||||
= tab_item(t('pluralize.dossiers_supprimes', count: @dossiers_supprimes.count),
|
||||
dossiers_path(statut: 'dossiers-supprimes'),
|
||||
|
@ -44,12 +50,6 @@
|
|||
active: @statut == 'dossiers-transferes',
|
||||
badge: number_with_html_delimiter(@dossier_transfers.count))
|
||||
|
||||
- if @dossiers_close_to_expiration.count > 0
|
||||
= tab_item(t('pluralize.dossiers_close_to_expiration', count: @dossiers_close_to_expiration.count),
|
||||
dossiers_path(statut: 'dossiers-expirant'),
|
||||
active: @statut == 'dossiers-expirant',
|
||||
badge: number_with_html_delimiter(@dossiers_close_to_expiration.count))
|
||||
|
||||
.container
|
||||
- if @statut == "en-cours"
|
||||
= render partial: "dossiers_list", locals: { dossiers: @user_dossiers }
|
||||
|
|
|
@ -365,9 +365,9 @@ fr:
|
|||
one: demande de transfert
|
||||
other: demandes de transfert
|
||||
dossiers_close_to_expiration:
|
||||
zero: dossier expirant
|
||||
one: dossier expirant
|
||||
other: dossiers expirant
|
||||
zero: expirant
|
||||
one: expirant
|
||||
other: expirant
|
||||
dossier_trouve:
|
||||
zero: 0 dossier trouvé
|
||||
one: 1 dossier trouvé
|
||||
|
|
32
spec/views/instructeur/procedures/_header.html.haml_spec.rb
Normal file
32
spec/views/instructeur/procedures/_header.html.haml_spec.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
describe 'instructeurs/procedures/_header.html.haml', type: :view do
|
||||
let(:procedure) { create(:procedure, id: 1, procedure_expires_when_termine_enabled: expiration_enabled)}
|
||||
|
||||
subject do
|
||||
render('instructeurs/procedures/header.html.haml',
|
||||
procedure: procedure,
|
||||
statut: 'tous',
|
||||
a_suivre_count: 0,
|
||||
suivis_count: 0,
|
||||
traites_count: 0,
|
||||
tous_count: 0,
|
||||
archives_count: 0,
|
||||
expirant_count: 0,
|
||||
has_en_cours_notifications: false,
|
||||
has_termine_notifications: false,
|
||||
current_instructeur: build_stubbed(:instructeur))
|
||||
end
|
||||
|
||||
context 'when procedure_expires_when_termine_enabled is true' do
|
||||
let(:expiration_enabled) { true }
|
||||
it 'contains link to expiring dossiers within procedure' do
|
||||
expect(subject).to have_selector(%Q(a[href="#{instructeur_procedure_path(procedure, statut: 'expirant')}"]), count: 1)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when procedure_expires_when_termine_enabled is false' do
|
||||
let(:expiration_enabled) { false }
|
||||
it 'does not contain link to expiring dossiers within procedure' do
|
||||
expect(subject).to have_selector(%Q(a[href="#{instructeur_procedure_path(procedure, statut: 'expirant')}"]), count: 0)
|
||||
end
|
||||
end
|
||||
end
|
30
spec/views/instructeur/procedures/_list.html.haml_spec.rb
Normal file
30
spec/views/instructeur/procedures/_list.html.haml_spec.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
describe 'instructeurs/procedures/_list.html.haml', type: :view do
|
||||
let(:procedure) { create(:procedure, id: 1, procedure_expires_when_termine_enabled: expiration_enabled)}
|
||||
|
||||
subject do
|
||||
render('instructeurs/procedures/list.html.haml',
|
||||
p: procedure,
|
||||
dossiers_count_per_procedure: 5,
|
||||
dossiers_a_suivre_count_per_procedure: 2,
|
||||
dossiers_archived_count_per_procedure: 1,
|
||||
dossiers_termines_count_per_procedure: 1,
|
||||
dossiers_expirant_count_per_procedure: 0,
|
||||
followed_dossiers_count_per_procedure: 0,
|
||||
procedure_ids_en_cours_with_notifications: [],
|
||||
procedure_ids_termines_with_notifications: [])
|
||||
end
|
||||
|
||||
context 'when procedure_expires_when_termine_enabled is true' do
|
||||
let(:expiration_enabled) { true }
|
||||
it 'contains link to expiring dossiers within procedure' do
|
||||
expect(subject).to have_selector(%Q(a[href="#{instructeur_procedure_path(procedure, statut: 'expirant')}"]), count: 1)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when procedure_expires_when_termine_enabled is false' do
|
||||
let(:expiration_enabled) { false }
|
||||
it 'does not contain link to expiring dossiers within procedure' do
|
||||
expect(subject).to have_selector(%Q(a[href="#{instructeur_procedure_path(procedure, statut: 'expirant')}"]), count: 0)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue