From 3e73ff0d35a83fc38f8b8523cd14ba3258d4c746 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 27 Sep 2024 10:00:48 +0200 Subject: [PATCH] small refactors --- app/components/instructeurs/column_filter_component.rb | 6 +----- .../procedures/_dossiers_filter_dropdown.html.haml | 2 +- app/views/instructeurs/procedures/show.html.haml | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/components/instructeurs/column_filter_component.rb b/app/components/instructeurs/column_filter_component.rb index de1826037..3ea2b1153 100644 --- a/app/components/instructeurs/column_filter_component.rb +++ b/app/components/instructeurs/column_filter_component.rb @@ -39,11 +39,7 @@ class Instructeurs::ColumnFilterComponent < ApplicationComponent end def filterable_columns_options - procedure.columns.filter_map do |column| - next if column.filterable == false - - [column.label, column.id] - end + @procedure.columns.filter(&:filterable).map { [_1.label, _1.id] } end private diff --git a/app/views/instructeurs/procedures/_dossiers_filter_dropdown.html.haml b/app/views/instructeurs/procedures/_dossiers_filter_dropdown.html.haml index e301a5c53..2fe1a3065 100644 --- a/app/views/instructeurs/procedures/_dossiers_filter_dropdown.html.haml +++ b/app/views/instructeurs/procedures/_dossiers_filter_dropdown.html.haml @@ -3,4 +3,4 @@ = t('views.instructeurs.dossiers.filters.title') - menu.with_form do - = render Instructeurs::ColumnFilterComponent.new(procedure:, procedure_presentation: @procedure_presentation, statut:) + = render Instructeurs::ColumnFilterComponent.new(procedure:, procedure_presentation:, statut:) diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 2a9a62fca..a7dd1e0a3 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -61,7 +61,7 @@ %hr .flex.align-center - if @filtered_sorted_paginated_ids.present? || @current_filters.count > 0 - = render partial: "dossiers_filter_dropdown", locals: { procedure: @procedure, statut: @statut} + = render partial: "dossiers_filter_dropdown", locals: { procedure: @procedure, statut: @statut, procedure_presentation: @procedure_presentation } = render Dossiers::NotifiedToggleComponent.new(procedure: @procedure, procedure_presentation: @procedure_presentation) if @statut != 'a-suivre' .fr-ml-auto