Merge branch 'develop' into staging
This commit is contained in:
commit
533aaf281b
5 changed files with 31 additions and 5 deletions
|
@ -7,7 +7,7 @@ class Backoffice::DossiersListController < ApplicationController
|
|||
def index
|
||||
cookies[:liste] = param_liste
|
||||
|
||||
unless DossiersListGestionnaireService.dossiers_list_libelle.include?(param_liste)
|
||||
unless DossiersListGestionnaireService.dossiers_liste_libelle.include?(param_liste)
|
||||
cookies[:liste] = 'a_traiter'
|
||||
return redirect_to backoffice_dossiers_path
|
||||
end
|
||||
|
|
|
@ -10,10 +10,14 @@ class Users::DossiersController < UsersController
|
|||
end
|
||||
|
||||
def index
|
||||
liste = params[:liste] || cookies[:liste] || 'a_traiter'
|
||||
cookies[:liste] = liste
|
||||
cookies[:liste] = param_liste
|
||||
|
||||
@dossiers_list_facade = DossiersListFacades.new current_user, liste
|
||||
@dossiers_list_facade = DossiersListFacades.new current_user, param_liste
|
||||
|
||||
unless DossiersListUserService.dossiers_liste_libelle.include?(param_liste)
|
||||
cookies[:liste] = 'a_traiter'
|
||||
return redirect_to users_dossiers_path
|
||||
end
|
||||
|
||||
@dossiers = smart_listing_create :dossiers,
|
||||
@dossiers_list_facade.dossiers_to_display,
|
||||
|
@ -169,4 +173,8 @@ class Users::DossiersController < UsersController
|
|||
def facade id = params[:id]
|
||||
DossierFacades.new id, current_user.email
|
||||
end
|
||||
|
||||
def param_liste
|
||||
@liste ||= params[:liste] || cookies[:liste] || 'a_traiter'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ class DossiersListGestionnaireService
|
|||
'termine' => termine}[@liste]
|
||||
end
|
||||
|
||||
def self.dossiers_list_libelle
|
||||
def self.dossiers_liste_libelle
|
||||
['nouveaux', 'a_traiter', 'en_attente', 'deposes', 'a_instruire', 'termine']
|
||||
end
|
||||
|
||||
|
|
|
@ -15,6 +15,10 @@ class DossiersListUserService
|
|||
'invite' => invite}[@liste]
|
||||
end
|
||||
|
||||
def self.dossiers_liste_libelle
|
||||
['brouillon', 'nouveaux', 'a_traiter', 'en_attente', 'valides', 'en_instruction', 'termine', 'invite']
|
||||
end
|
||||
|
||||
def brouillon
|
||||
@brouillon ||= @current_devise_profil.dossiers.brouillon
|
||||
end
|
||||
|
|
|
@ -456,4 +456,18 @@ describe Users::DossiersController, type: :controller do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET #list_fake' do
|
||||
context 'when user is connected' do
|
||||
before do
|
||||
sign_in user
|
||||
end
|
||||
|
||||
it 'returns http success' do
|
||||
get :index, liste: :list_fake
|
||||
expect(response).to redirect_to(users_dossiers_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue