[#3477] Extract helper
This commit is contained in:
parent
5e1dc7059a
commit
58158938cb
1 changed files with 6 additions and 4 deletions
|
@ -112,7 +112,7 @@ module NewGestionnaire
|
||||||
procedure_presentation.update(displayed_fields: fields)
|
procedure_presentation.update(displayed_fields: fields)
|
||||||
|
|
||||||
current_sort = procedure_presentation.sort
|
current_sort = procedure_presentation.sort
|
||||||
if !values.include?("#{current_sort['table']}/#{current_sort['column']}")
|
if !values.include?(field_id(current_sort))
|
||||||
procedure_presentation.update(sort: Procedure.default_sort)
|
procedure_presentation.update(sort: Procedure.default_sort)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -194,6 +194,10 @@ module NewGestionnaire
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def field_id(field)
|
||||||
|
"#{field['table']}/#{field['column']}"
|
||||||
|
end
|
||||||
|
|
||||||
def statut
|
def statut
|
||||||
@statut ||= (params[:statut].presence || 'a-suivre')
|
@statut ||= (params[:statut].presence || 'a-suivre')
|
||||||
end
|
end
|
||||||
|
@ -228,9 +232,7 @@ module NewGestionnaire
|
||||||
end
|
end
|
||||||
|
|
||||||
def displayed_fields_values
|
def displayed_fields_values
|
||||||
procedure_presentation.displayed_fields.map do |field|
|
procedure_presentation.displayed_fields.map { |field| field_id(field) }
|
||||||
"#{field['table']}/#{field['column']}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_filters
|
def current_filters
|
||||||
|
|
Loading…
Reference in a new issue