From e7c268a26ea2a1da4a52c49bf43f33bdf6acaeda Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Fri, 22 Apr 2016 16:50:53 -0300 Subject: Persists search filter state per project/group --- app/controllers/application_controller.rb | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1c53b0b21a3..aeefafcb8f8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -6,6 +6,7 @@ class ApplicationController < ActionController::Base include Gitlab::GonHelper include GitlabRoutingHelper include PageLayoutHelper + include SearchCookies before_action :authenticate_user_from_token! before_action :authenticate_user! @@ -354,24 +355,4 @@ class ApplicationController < ActionController::Base current_user.nil? && root_path == request.path end - - private - - def set_default_sort - key = if is_a_listing_page_for?('issues') || is_a_listing_page_for?('merge_requests') - 'issuable_sort' - end - - cookies[key] = params[:sort] if key && params[:sort].present? - params[:sort] = cookies[key] if key - params[:sort] ||= 'id_desc' - end - - def is_a_listing_page_for?(page_type) - controller_name, action_name = params.values_at(:controller, :action) - - (controller_name == "projects/#{page_type}" && action_name == 'index') || - (controller_name == 'groups' && action_name == page_type) || - (controller_name == 'dashboard' && action_name == page_type) - end end -- cgit v1.2.1