Add tab for follow dossier in gestionnaire dashboard
This commit is contained in:
parent
ab02fe48c3
commit
c815ec5e82
5 changed files with 30 additions and 15 deletions
|
@ -150,7 +150,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
|||
begin
|
||||
@liste = URI(request.referer).query.split('=').second
|
||||
rescue NoMethodError
|
||||
@liste = cookies[:liste] || 'a_traiter'
|
||||
@liste = cookies[:liste] || 'all_state'
|
||||
end
|
||||
|
||||
smartlisting_dossier
|
||||
|
|
|
@ -8,7 +8,7 @@ class Backoffice::DossiersListController < ApplicationController
|
|||
cookies[:liste] = param_liste
|
||||
|
||||
unless DossiersListGestionnaireService.dossiers_liste_libelle.include?(param_liste)
|
||||
cookies[:liste] = 'a_traiter'
|
||||
cookies[:liste] = 'all_state'
|
||||
end
|
||||
|
||||
dossiers_list_facade param_liste
|
||||
|
@ -23,11 +23,11 @@ class Backoffice::DossiersListController < ApplicationController
|
|||
dossiers_list_facade.service.add_filter param_filter
|
||||
end
|
||||
|
||||
def dossiers_list_facade liste='a_traiter'
|
||||
def dossiers_list_facade liste='all_state'
|
||||
@facade_data_view ||= DossiersListFacades.new current_gestionnaire, liste, retrieve_procedure
|
||||
end
|
||||
|
||||
def smartlisting_dossier dossiers_list=nil, liste='a_traiter'
|
||||
def smartlisting_dossier dossiers_list=nil, liste='all_state'
|
||||
dossiers_list_facade liste
|
||||
|
||||
new_dossiers_list = dossiers_list_facade.service.nouveaux
|
||||
|
@ -79,6 +79,6 @@ class Backoffice::DossiersListController < ApplicationController
|
|||
end
|
||||
|
||||
def param_liste
|
||||
@liste ||= params[:liste] || cookies[:liste] || 'a_traiter'
|
||||
@liste ||= params[:liste] || cookies[:liste] || 'all_state'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,14 +6,16 @@ class DossiersListGestionnaireService
|
|||
end
|
||||
|
||||
def dossiers_to_display
|
||||
{'nouveaux' => nouveaux,
|
||||
'suivi' => suivi,
|
||||
'a_traiter' => ouvert,
|
||||
'fige' => fige,
|
||||
'deposes' => deposes,
|
||||
'a_instruire' => a_instruire,
|
||||
'termine' => termine,
|
||||
'all_state' => all_state}[@liste]
|
||||
@dossiers_to_display ||=
|
||||
{'nouveaux' => nouveaux,
|
||||
# 'suivi' => suivi,
|
||||
'a_traiter' => ouvert,
|
||||
'fige' => fige,
|
||||
'deposes' => deposes,
|
||||
'a_instruire' => a_instruire,
|
||||
'termine' => termine,
|
||||
'all_state' => all_state}[@liste]
|
||||
|
||||
end
|
||||
|
||||
def self.dossiers_liste_libelle
|
||||
|
@ -25,7 +27,7 @@ class DossiersListGestionnaireService
|
|||
end
|
||||
|
||||
def suivi
|
||||
@suivi ||= @current_devise_profil.dossiers_follow.merge(all_state)
|
||||
@suivi ||= @current_devise_profil.dossiers_follow.merge(dossiers_to_display)
|
||||
end
|
||||
|
||||
def nouveaux
|
||||
|
|
|
@ -15,6 +15,19 @@
|
|||
%div.body
|
||||
= smart_listing_render :new_dossiers
|
||||
|
||||
.row.center
|
||||
.col-lg-1.col-md-1.col-sm-1.col-xs-1
|
||||
.col-lg-2.col-md-2.col-sm-2.col-xs-2
|
||||
=link_to 'Tous les états', '?liste=all_state', class: 'text-info', style:"text-decoration: #{@facade_data_view.liste == 'all_state'? 'underline' : ''}"
|
||||
.col-lg-2.col-md-2.col-sm-2.col-xs-2
|
||||
=link_to 'En construction', '?liste=a_traiter', class: 'text-danger', style:"text-decoration: #{@facade_data_view.liste == 'a_traiter'? 'underline' : ''}"
|
||||
.col-lg-2.col-md-2.col-sm-2.col-xs-2
|
||||
=link_to 'À receptionner', '?liste=deposes', class: 'text-purple', style:"text-decoration: #{@facade_data_view.liste == 'deposes'? 'underline' : ''}"
|
||||
.col-lg-2.col-md-2.col-sm-2.col-xs-2
|
||||
=link_to 'À instruire', '?liste=a_instruire', class: 'text-warning', style:"text-decoration: #{@facade_data_view.liste == 'a_instruire'? 'underline' : ''}"
|
||||
.col-lg-2.col-md-2.col-sm-2.col-xs-2
|
||||
=link_to 'Terminés', '?liste=termine', class: 'text-success', style:"text-decoration: #{@facade_data_view.liste == 'termine'? 'underline' : ''}"
|
||||
|
||||
.default_data_block.default_visible
|
||||
%div.row.show-block#follow_dossiers
|
||||
%div.header
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||
describe DossiersListGestionnaireService do
|
||||
let(:gestionnaire) { create :gestionnaire }
|
||||
let(:preference_smart_listing_page) { gestionnaire.preference_smart_listing_page }
|
||||
let(:liste) { 'a_traiter' }
|
||||
let(:liste) { 'all_state' }
|
||||
let(:dossier) { create :dossier }
|
||||
let(:accompagnateur_service) { AccompagnateurService.new gestionnaire, procedure, 'assign' }
|
||||
|
||||
|
|
Loading…
Reference in a new issue