Commit 048db426 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Extract filter bar params into separate helper

parent 3d252244
...@@ -178,18 +178,9 @@ module ApplicationHelper ...@@ -178,18 +178,9 @@ module ApplicationHelper
without = options.delete(:without) without = options.delete(:without)
add_label = options.delete(:label) add_label = options.delete(:label)
exist_opts = { exist_opts = filter_bar_params.merge(
state: params[:state], params.slice(:state, :scope)
scope: params[:scope], )
milestone_title: params[:milestone_title],
assignee_username: params[:assignee_username],
author_username: params[:author_username],
search: params[:search],
label_name: params[:label_name],
my_reaction_emoji: params[:my_reaction_emoji],
wip: params[:wip],
weight: params[:weight]
}
options = exist_opts.merge(options) options = exist_opts.merge(options)
...@@ -206,6 +197,19 @@ module ApplicationHelper ...@@ -206,6 +197,19 @@ module ApplicationHelper
"#{request.path}?#{params.to_param}" "#{request.path}?#{params.to_param}"
end end
def filter_bar_params
params.slice(
:assignee_id,
:assignee_username,
:author_username,
:label_name,
:milestone_title,
:my_reaction_emoji,
:wip,
:search
)
end
def outdated_browser? def outdated_browser?
browser.ie? && browser.version.to_i < 10 browser.ie? && browser.version.to_i < 10
end end
......
...@@ -87,6 +87,11 @@ module EE ...@@ -87,6 +87,11 @@ module EE
::Gitlab::CurrentSettings.instance_review_permitted? && current_user&.admin? ::Gitlab::CurrentSettings.instance_review_permitted? && current_user&.admin?
end end
override :filter_bar_params
def filter_bar_params
super.merge(params.slice(:weight))
end
private private
def appearance def appearance
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment