Dossier: replace nouveau scope by en_construction

This commit is contained in:
Simon Lehericey 2017-12-05 16:14:02 +01:00 committed by LeSim
parent 4be6cb9126
commit 40b9a77395
3 changed files with 4 additions and 4 deletions

View file

@ -50,7 +50,7 @@ class Dossier < ActiveRecord::Base
scope :order_by_updated_at, -> (order = :desc) { order(updated_at: order) } scope :order_by_updated_at, -> (order = :desc) { order(updated_at: order) }
scope :all_state, -> { not_archived.state_not_brouillon } scope :all_state, -> { not_archived.state_not_brouillon }
scope :nouveaux, -> { not_archived.state_en_construction } scope :en_construction, -> { not_archived.state_en_construction }
scope :en_instruction, -> { not_archived.state_en_instruction } scope :en_instruction, -> { not_archived.state_en_instruction }
scope :termine, -> { not_archived.state_termine } scope :termine, -> { not_archived.state_termine }
scope :downloadable_sorted, -> { state_not_brouillon.includes(:entreprise, :etablissement, :champs, :champs_private).order(en_construction_at: 'asc') } scope :downloadable_sorted, -> { state_not_brouillon.includes(:entreprise, :etablissement, :champs, :champs_private).order(en_construction_at: 'asc') }

View file

@ -28,7 +28,7 @@ class DossiersListGestionnaireService
end end
def nouveaux def nouveaux
@nouveaux ||= filter_dossiers.nouveaux.order_by_updated_at('asc') @nouveaux ||= filter_dossiers.en_construction.order_by_updated_at('asc')
end end
def a_instruire def a_instruire

View file

@ -3,7 +3,7 @@
.count= current_gestionnaire.followed_dossiers.count .count= current_gestionnaire.followed_dossiers.count
.text SUIVIS .text SUIVIS
.nouveaux-dossiers .nouveaux-dossiers
.count= current_gestionnaire.dossiers.nouveaux.count .count= current_gestionnaire.dossiers.en_construction.count
.text NOUVEAUX .text NOUVEAUX
.nouvelles-notifications .nouvelles-notifications
.count= current_gestionnaire.dossiers_with_notifications_count .count= current_gestionnaire.dossiers_with_notifications_count
@ -28,7 +28,7 @@
= link_to backoffice_dossiers_procedure_path(procedure.id), { title: procedure.libelle } do = link_to backoffice_dossiers_procedure_path(procedure.id), { title: procedure.libelle } do
.procedure-list-element{ class: ('active' if procedure.id.to_s == params[:id]) } .procedure-list-element{ class: ('active' if procedure.id.to_s == params[:id]) }
= procedure.libelle.truncate(50) = procedure.libelle.truncate(50)
- total_new = procedure.dossiers.nouveaux.count - total_new = procedure.dossiers.en_construction.count
- if total_new > 0 - if total_new > 0
.badge.progress-bar-success{ title: 'Nouveaux dossiers' } .badge.progress-bar-success{ title: 'Nouveaux dossiers' }
= total_new = total_new