fix(users): don't show procedures filter when there are not enough procedures

This commit is contained in:
Colin Darie 2023-12-13 16:00:43 +01:00
parent f0e1c1688b
commit c76213cb87
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
2 changed files with 2 additions and 1 deletions

View file

@ -17,7 +17,7 @@
= text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.search_file'), class: "fr-input" = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.search_file'), class: "fr-input"
%button.fr-btn.fr-btn--sm %button.fr-btn.fr-btn--sm
= t('views.users.dossiers.search.simple') = t('views.users.dossiers.search.simple')
- if @procedures_for_select.present? - if @procedures_for_select.size > 1
.fr-col .fr-col
= render Dossiers::UserProcedureFilterComponent.new(procedures_for_select: @procedures_for_select) = render Dossiers::UserProcedureFilterComponent.new(procedures_for_select: @procedures_for_select)

View file

@ -19,6 +19,7 @@ describe 'users/dossiers/index', type: :view do
assign(:dossier_transferes, Kaminari.paginate_array([]).page(1)) assign(:dossier_transferes, Kaminari.paginate_array([]).page(1))
assign(:dossiers_close_to_expiration, Kaminari.paginate_array([]).page(1)) assign(:dossiers_close_to_expiration, Kaminari.paginate_array([]).page(1))
assign(:dossiers, Kaminari.paginate_array(user_dossiers).page(1)) assign(:dossiers, Kaminari.paginate_array(user_dossiers).page(1))
assign(:procedures_for_select, user_dossiers.map(&:procedure))
assign(:statut, statut) assign(:statut, statut)
assign(:filter, filter) assign(:filter, filter)
assign(:all_dossiers_uniq_procedures_count, 0) assign(:all_dossiers_uniq_procedures_count, 0)