remove filter using generic add_filter methods
This commit is contained in:
parent
175f303399
commit
72c389161a
2 changed files with 10 additions and 4 deletions
|
@ -6,6 +6,12 @@
|
||||||
- filters.each_with_index do |filter, i|
|
- filters.each_with_index do |filter, i|
|
||||||
- if i > 0
|
- if i > 0
|
||||||
= " ou "
|
= " ou "
|
||||||
= link_to remove_filter_instructeur_procedure_path(procedure, { statut: statut, column: filter.column.id, value: filter.filter }),
|
= form_tag(add_filter_instructeur_procedure_path(procedure), class: 'inline') do
|
||||||
class: "fr-tag fr-tag--dismiss fr-my-1w", aria: { label: "Retirer le filtre #{filter.column.label}" } do
|
- prefix = procedure_presentation.filters_name_for(statut)
|
||||||
= "#{filter.column.label.truncate(50)} : #{procedure_presentation.human_value_for_filter(filter)}"
|
= hidden_field_tag "#{prefix}[]", ''
|
||||||
|
- (current_filters - [filter]).each do |f|
|
||||||
|
= hidden_field_tag "#{prefix}[][id]", f.column.id
|
||||||
|
= hidden_field_tag "#{prefix}[][filter]", f.filter
|
||||||
|
|
||||||
|
= button_tag "#{filter.column.label.truncate(50)} : #{procedure_presentation.human_value_for_filter(filter)}",
|
||||||
|
class: 'fr-tag fr-tag--dismiss fr-my-1w'
|
||||||
|
|
|
@ -224,7 +224,7 @@ describe "procedure filters" do
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_filter(filter_value)
|
def remove_filter(filter_value)
|
||||||
click_link text: filter_value
|
click_button text: filter_value
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_column(column_name)
|
def add_column(column_name)
|
||||||
|
|
Loading…
Reference in a new issue