diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e6f11f95ec8..27fae716216 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -274,12 +274,12 @@ module ApplicationHelper end end - params = options.compact.to_param + params = options.compact path = request.path if params != nil - path << "?#{params}" + path << "?#{params.to_param}" if add_label if params[:label_name].present? and params[:label_name].respond_to?('any?') params[:label_name].each do |label| diff --git a/app/views/shared/_sort_dropdown.html.haml b/app/views/shared/_sort_dropdown.html.haml index 154d9e30851..1e0f075b303 100644 --- a/app/views/shared/_sort_dropdown.html.haml +++ b/app/views/shared/_sort_dropdown.html.haml @@ -10,31 +10,22 @@ %li = link_to page_filter_path(sort: sort_value_recently_created) do = sort_title_recently_created - %li = link_to page_filter_path(sort: sort_value_oldest_created) do = sort_title_oldest_created - %li = link_to page_filter_path(sort: sort_value_recently_updated) do = sort_title_recently_updated - %li = link_to page_filter_path(sort: sort_value_oldest_updated) do = sort_title_oldest_updated - %li = link_to page_filter_path(sort: sort_value_milestone_soon) do = sort_title_milestone_soon - %li = link_to page_filter_path(sort: sort_value_milestone_later) do = sort_title_milestone_later - - if controller.controller_name == 'issues' || controller.action_name == 'issues' - %li + - if controller.controller_name == 'issues' || controller.action_name == 'issues' = link_to page_filter_path(sort: sort_value_due_date_soon) do = sort_title_due_date_soon - %li = link_to page_filter_path(sort: sort_value_due_date_later) do = sort_title_due_date_later - %li = link_to page_filter_path(sort: sort_value_upvotes) do = sort_title_upvotes - %li = link_to page_filter_path(sort: sort_value_downvotes) do = sort_title_downvotes diff --git a/spec/features/issues/filter_issues_spec.rb b/spec/features/issues/filter_issues_spec.rb index c479e43b016..c7ffee7d09c 100644 --- a/spec/features/issues/filter_issues_spec.rb +++ b/spec/features/issues/filter_issues_spec.rb @@ -167,8 +167,7 @@ describe 'Filter issues', feature: true do project: project, milestone: milestone, author: user, - assignee: user - ) + assignee: user) issue.labels << project.labels.find_by(title: 'bug') visit namespace_project_issues_path(project.namespace, project) @@ -265,7 +264,7 @@ describe 'Filter issues', feature: true do describe 'filter issues and sort', js: true do before do - label = create(:label, project: project, title: 'bug') + create(:label, project: project, title: 'bug') bug_one = create(:issue, title: "Frontend", project: project) bug_two = create(:issue, title: "Bug 2", project: project)