Delete tab Nouveau A traiter and En cours d'étude for User and replace this only one call En construction
This commit is contained in:
parent
fd9eaa5a4d
commit
a7166d306f
9 changed files with 110 additions and 87 deletions
|
@ -20,7 +20,7 @@ class DossiersListFacades
|
|||
end
|
||||
|
||||
def gestionnaire_procedures_name_and_id_list
|
||||
@current_devise_profil.procedures.order('libelle ASC').inject([]) { |acc, procedure| acc.push({id: procedure.id, libelle: procedure.libelle})}
|
||||
@current_devise_profil.procedures.order('libelle ASC').inject([]) { |acc, procedure| acc.push({id: procedure.id, libelle: procedure.libelle}) }
|
||||
end
|
||||
|
||||
def procedure_id
|
||||
|
@ -53,6 +53,10 @@ class DossiersListFacades
|
|||
(@liste == 'a_traiter' ? 'active' : '')
|
||||
end
|
||||
|
||||
def en_construction_class
|
||||
(@liste == 'a_traiter' ? 'active' : '')
|
||||
end
|
||||
|
||||
def en_attente_class
|
||||
(@liste == 'en_attente' ? 'active' : '')
|
||||
end
|
||||
|
@ -98,13 +102,15 @@ class DossiersListFacades
|
|||
end
|
||||
|
||||
def a_traiter_total
|
||||
return service.waiting_for_gestionnaire.count if gestionnaire?
|
||||
service.waiting_for_user.count if user?
|
||||
service.waiting_for_gestionnaire.count
|
||||
end
|
||||
|
||||
def en_construction_total
|
||||
service.en_construction.count
|
||||
end
|
||||
|
||||
def en_attente_total
|
||||
return service.waiting_for_user.count if gestionnaire?
|
||||
service.waiting_for_gestionnaire.count if user?
|
||||
service.waiting_for_user.count
|
||||
end
|
||||
|
||||
def valides_total
|
||||
|
@ -147,6 +153,10 @@ class DossiersListFacades
|
|||
base_url 'a_traiter'
|
||||
end
|
||||
|
||||
def en_construction_url
|
||||
base_url 'a_traiter'
|
||||
end
|
||||
|
||||
def en_attente_url
|
||||
base_url 'en_attente'
|
||||
end
|
||||
|
|
|
@ -47,7 +47,7 @@ class Dossier < ActiveRecord::Base
|
|||
NOUVEAUX = %w(initiated)
|
||||
WAITING_FOR_GESTIONNAIRE = %w(updated)
|
||||
WAITING_FOR_USER = %w(replied validated)
|
||||
WAITING_FOR_USER_WITHOUT_VALIDATED = %w(replied)
|
||||
EN_CONSTRUCTION = %w(initiated updated replied)
|
||||
VALIDES = %w(validated)
|
||||
DEPOSES = %w(submitted)
|
||||
EN_INSTRUCTION = %w(submitted received)
|
||||
|
@ -185,8 +185,8 @@ class Dossier < ActiveRecord::Base
|
|||
WAITING_FOR_USER.include?(state)
|
||||
end
|
||||
|
||||
def waiting_for_user_without_validated?
|
||||
WAITING_FOR_USER_WITHOUT_VALIDATED.include?(state)
|
||||
def en_construction?
|
||||
EN_CONSTRUCTION.include?(state)
|
||||
end
|
||||
|
||||
def deposes?
|
||||
|
@ -225,8 +225,8 @@ class Dossier < ActiveRecord::Base
|
|||
where(state: WAITING_FOR_USER, archived: false).order("updated_at #{order}")
|
||||
end
|
||||
|
||||
def self.waiting_for_user_without_validated order = 'ASC'
|
||||
where(state: WAITING_FOR_USER_WITHOUT_VALIDATED, archived: false).order("updated_at #{order}")
|
||||
def self.en_construction order = 'ASC'
|
||||
where(state: EN_CONSTRUCTION, archived: false).order("updated_at #{order}")
|
||||
end
|
||||
|
||||
def self.valides order = 'ASC'
|
||||
|
|
|
@ -121,7 +121,7 @@ class DossiersListGestionnaireService
|
|||
|
||||
def joins_filter
|
||||
filter_preference_list.inject([]) do |acc, preference|
|
||||
acc.push(preference.table.to_sym) unless preference.table.blank?
|
||||
acc.push(preference.table.to_sym) unless preference.table.blank? || preference.filter.blank?
|
||||
acc
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,9 +6,7 @@ class DossiersListUserService
|
|||
|
||||
def dossiers_to_display
|
||||
{'brouillon' => brouillon,
|
||||
'nouveaux' => nouveaux,
|
||||
'a_traiter' => waiting_for_user,
|
||||
'en_attente' => waiting_for_gestionnaire,
|
||||
'a_traiter' => en_construction,
|
||||
'valides' => valides,
|
||||
'en_instruction' => en_instruction,
|
||||
'termine' => termine,
|
||||
|
@ -16,23 +14,15 @@ class DossiersListUserService
|
|||
end
|
||||
|
||||
def self.dossiers_liste_libelle
|
||||
['brouillon', 'nouveaux', 'a_traiter', 'en_attente', 'valides', 'en_instruction', 'termine', 'invite']
|
||||
['brouillon', 'a_traiter', 'valides', 'en_instruction', 'termine', 'invite']
|
||||
end
|
||||
|
||||
def brouillon
|
||||
@brouillon ||= @current_devise_profil.dossiers.brouillon
|
||||
end
|
||||
|
||||
def nouveaux
|
||||
@nouveaux ||= @current_devise_profil.dossiers.nouveaux
|
||||
end
|
||||
|
||||
def waiting_for_gestionnaire
|
||||
@waiting_for_gestionnaire ||= @current_devise_profil.dossiers.waiting_for_gestionnaire
|
||||
end
|
||||
|
||||
def waiting_for_user
|
||||
@waiting_for_user ||= @current_devise_profil.dossiers.waiting_for_user_without_validated
|
||||
def en_construction
|
||||
@en_construction ||= @current_devise_profil.dossiers.en_construction
|
||||
end
|
||||
|
||||
def invite
|
||||
|
|
|
@ -8,26 +8,12 @@
|
|||
.badge.progress-bar-default
|
||||
= @dossiers_list_facade.brouillon_total
|
||||
|
||||
%li{ class: @dossiers_list_facade.nouveaux_class }
|
||||
%a{:href => "#{url_for users_dossiers_path(liste: 'nouveaux')}", 'data-toggle' => :tooltip, title: 'Les nouveaux dossiers qui n\'ont pas encore été vus par votre accompagnateur.'}
|
||||
%h5.text-info
|
||||
= "Nouveaux"
|
||||
.badge.progress-bar-info
|
||||
= @dossiers_list_facade.nouveaux_total
|
||||
|
||||
%li{ class: @dossiers_list_facade.a_traiter_class }
|
||||
%li{ class: @dossiers_list_facade.en_construction_class }
|
||||
%a{:href => "#{url_for users_dossiers_path(liste: 'a_traiter')}", 'data-toggle' => :tooltip, title: 'Les dossiers qui requièrent une action de votre part.'}
|
||||
%h5.text-danger
|
||||
= "Action requise"
|
||||
= "En construction"
|
||||
.badge.progress-bar-danger
|
||||
= @dossiers_list_facade.a_traiter_total
|
||||
|
||||
%li{ class: @dossiers_list_facade.en_attente_class }
|
||||
%a{:href => "#{url_for users_dossiers_path(liste: 'en_attente')}", 'data-toggle' => :tooltip, title: 'Les dossiers en cours de relecture par votre accompagnateur.'}
|
||||
%h5.text-default
|
||||
="Etude en cours"
|
||||
.badge.progress-bar-default
|
||||
= @dossiers_list_facade.en_attente_total
|
||||
= @dossiers_list_facade.en_construction_total
|
||||
|
||||
%li{ class: @dossiers_list_facade.valides_class }
|
||||
%a{:href => "#{url_for users_dossiers_path(liste: 'valides')}", 'data-toggle' => :tooltip, title: 'Les dossiers relus par votre accompagnateur pouvant être déposés pour examen.'}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue