[#2874] Show archived / followed status of dossier in search result
This commit is contained in:
parent
447e54fe45
commit
4b2a06acb5
2 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,10 @@ module NewGestionnaire
|
||||||
def index
|
def index
|
||||||
@search_terms = params[:q]
|
@search_terms = params[:q]
|
||||||
@dossiers = DossierSearchService.matching_dossiers_for_gestionnaire(@search_terms, current_gestionnaire)
|
@dossiers = DossierSearchService.matching_dossiers_for_gestionnaire(@search_terms, current_gestionnaire)
|
||||||
|
@followed_dossiers_id = current_gestionnaire
|
||||||
|
.followed_dossiers
|
||||||
|
.where(procedure_id: @dossiers.pluck(:procedure_id))
|
||||||
|
.pluck(:id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
%th Démarche
|
%th Démarche
|
||||||
%th Demandeur
|
%th Demandeur
|
||||||
%th.status-col Statut
|
%th.status-col Statut
|
||||||
|
%th.follow-col
|
||||||
%tbody
|
%tbody
|
||||||
- @dossiers.each do |dossier|
|
- @dossiers.each do |dossier|
|
||||||
/ # FIXME: here we have a n+1, we fire a request
|
/ # FIXME: here we have a n+1, we fire a request
|
||||||
|
@ -30,5 +31,6 @@
|
||||||
%td.status-col
|
%td.status-col
|
||||||
= link_to(dossier_linked_path(current_gestionnaire, dossier), class: 'cell-link') do
|
= link_to(dossier_linked_path(current_gestionnaire, dossier), class: 'cell-link') do
|
||||||
= render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
|
= render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
|
||||||
|
%td.follow-col= render partial: 'new_gestionnaire/procedures/dossier_actions', locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
|
||||||
- else
|
- else
|
||||||
%h2 Aucun dossier correspondant à votre recherche n'a été trouvé
|
%h2 Aucun dossier correspondant à votre recherche n'a été trouvé
|
||||||
|
|
Loading…
Reference in a new issue