Commit 0e2086ae authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ee-update-page-filter-path-defaults' into 'master'

EE port of update-page-filter-path-defaults

See merge request gitlab-org/gitlab-ee!8851
parents e8c9f57f 6f0796e9
......@@ -171,7 +171,6 @@ module ApplicationHelper
def page_filter_path(options = {})
without = options.delete(:without)
add_label = options.delete(:label)
options = request.query_parameters.merge(options)
......@@ -181,11 +180,7 @@ module ApplicationHelper
end
end
params = options.compact
params.delete(:label_name) unless add_label
"#{request.path}?#{params.to_param}"
"#{request.path}?#{options.compact.to_param}"
end
def outdated_browser?
......
......@@ -166,7 +166,7 @@ module SortingHelper
reverse_sort = issuable_reverse_sort_order_hash[sort_value]
if reverse_sort
reverse_url = page_filter_path(sort: reverse_sort, label: true)
reverse_url = page_filter_path(sort: reverse_sort)
else
reverse_url = '#'
link_class += ' disabled'
......
......@@ -6,6 +6,6 @@
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
%li
= sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_created_date, label: true), sorted_by)
= sortable_item(sort_title_contacted_date, page_filter_path(sort: sort_value_contacted_date, label: true), sorted_by)
= sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_created_date), sorted_by)
= sortable_item(sort_title_contacted_date, page_filter_path(sort: sort_value_contacted_date), sorted_by)
......@@ -8,15 +8,15 @@
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-sort
%li
= link_to page_filter_path(sort: sort_value_due_date_soon, label: true) do
= link_to page_filter_path(sort: sort_value_due_date_soon) do
= sort_title_due_date_soon
= link_to page_filter_path(sort: sort_value_due_date_later, label: true) do
= link_to page_filter_path(sort: sort_value_due_date_later) do
= sort_title_due_date_later
= link_to page_filter_path(sort: sort_value_start_date_soon, label: true) do
= link_to page_filter_path(sort: sort_value_start_date_soon) do
= sort_title_start_date_soon
= link_to page_filter_path(sort: sort_value_start_date_later, label: true) do
= link_to page_filter_path(sort: sort_value_start_date_later) do
= sort_title_start_date_later
= link_to page_filter_path(sort: sort_value_name, label: true) do
= link_to page_filter_path(sort: sort_value_name) do
= sort_title_name_asc
= link_to page_filter_path(sort: sort_value_name_desc, label: true) do
= link_to page_filter_path(sort: sort_value_name_desc) do
= sort_title_name_desc
......@@ -4,20 +4,20 @@
%ul.nav-links.issues-state-filters.mobile-separator.nav.nav-tabs
%li{ class: active_when(params[:state] == 'opened') }>
= link_to page_filter_path(state: 'opened', label: true), id: 'state-opened', title: "Filter by #{page_context_word} that are currently opened.", data: { state: 'opened' } do
= link_to page_filter_path(state: 'opened'), id: 'state-opened', title: "Filter by #{page_context_word} that are currently opened.", data: { state: 'opened' } do
#{issuables_state_counter_text(type, :opened, display_count)}
- if type == :merge_requests
%li{ class: active_when(params[:state] == 'merged') }>
= link_to page_filter_path(state: 'merged', label: true), id: 'state-merged', title: 'Filter by merge requests that are currently merged.', data: { state: 'merged' } do
= link_to page_filter_path(state: 'merged'), id: 'state-merged', title: 'Filter by merge requests that are currently merged.', data: { state: 'merged' } do
#{issuables_state_counter_text(type, :merged, display_count)}
%li{ class: active_when(params[:state] == 'closed') }>
= link_to page_filter_path(state: 'closed', label: true), id: 'state-closed', title: 'Filter by merge requests that are currently closed and unmerged.', data: { state: 'closed' } do
= link_to page_filter_path(state: 'closed'), id: 'state-closed', title: 'Filter by merge requests that are currently closed and unmerged.', data: { state: 'closed' } do
#{issuables_state_counter_text(type, :closed, display_count)}
- else
%li{ class: active_when(params[:state] == 'closed') }>
= link_to page_filter_path(state: 'closed', label: true), id: 'state-closed', title: 'Filter by issues that are currently closed.', data: { state: 'closed' } do
= link_to page_filter_path(state: 'closed'), id: 'state-closed', title: 'Filter by issues that are currently closed.', data: { state: 'closed' } do
#{issuables_state_counter_text(type, :closed, display_count)}
= render 'shared/issuable/nav_links/all', page_context_word: page_context_word, counter: issuables_state_counter_text(type, :all, display_count)
......@@ -10,11 +10,11 @@
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
%li
= sortable_item(sort_title_priority, page_filter_path(sort: sort_value_priority, label: true), sort_title)
= sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_created_date, label: true), sort_title)
= sortable_item(sort_title_recently_updated, page_filter_path(sort: sort_value_recently_updated, label: true), sort_title)
= sortable_item(sort_title_milestone, page_filter_path(sort: sort_value_milestone, label: true), sort_title)
= sortable_item(sort_title_due_date, page_filter_path(sort: sort_value_due_date, label: true), sort_title) if viewing_issues
= sortable_item(sort_title_popularity, page_filter_path(sort: sort_value_popularity, label: true), sort_title)
= sortable_item(sort_title_label_priority, page_filter_path(sort: sort_value_label_priority, label: true), sort_title)
= sortable_item(sort_title_priority, page_filter_path(sort: sort_value_priority), sort_title)
= sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_created_date), sort_title)
= sortable_item(sort_title_recently_updated, page_filter_path(sort: sort_value_recently_updated), sort_title)
= sortable_item(sort_title_milestone, page_filter_path(sort: sort_value_milestone), sort_title)
= sortable_item(sort_title_due_date, page_filter_path(sort: sort_value_due_date), sort_title) if viewing_issues
= sortable_item(sort_title_popularity, page_filter_path(sort: sort_value_popularity), sort_title)
= sortable_item(sort_title_label_priority, page_filter_path(sort: sort_value_label_priority), sort_title)
= issuable_sort_direction_button(sort_value)
......@@ -2,5 +2,5 @@
- counter = local_assigns.fetch(:counter)
%li{ class: active_when(params[:state] == 'all') }>
= link_to page_filter_path(state: 'all', label: true), id: 'state-all', title: "Show all #{page_context_word}.", data: { state: 'all' } do
= link_to page_filter_path(state: 'all'), id: 'state-all', title: "Show all #{page_context_word}.", data: { state: 'all' } do
#{counter}
......@@ -6,4 +6,4 @@
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-sort
%li
- label_sort_options_hash.each do |value, title|
= sortable_item(title, page_filter_path(sort: value, label: true, subscribed: params[:subscribed]), sort_title)
= sortable_item(title, page_filter_path(sort: value), sort_title)
......@@ -47,7 +47,7 @@ module EE
sort_icon = sort.end_with?('desc') ? 'sort-highest' : 'sort-lowest'
link_to sprite_icon(sort_icon, size: 16),
page_filter_path(sort: opposite_sorting_param, label: true),
page_filter_path(sort: opposite_sorting_param),
class: "btn btn-default has-tooltip qa-reverse-sort btn-sort-direction",
title: _("Sort direction")
end
......
......@@ -79,7 +79,7 @@ module EpicsHelper
end
def epic_state_dropdown_link(state, selected_state)
link_to epic_state_title(state), page_filter_path(state: state, label: true), class: state == selected_state ? 'is-active' : ''
link_to epic_state_title(state), page_filter_path(state: state), class: state == selected_state ? 'is-active' : ''
end
def epic_state_title(state)
......
......@@ -21,7 +21,7 @@
= _('Weeks')
.filter-dropdown-container.append-right-default
= render 'shared/epic/state_dropdown'
= form_tag page_filter_path(without: [:author_id, :search]), method: :get, class: 'flex-fill filter-form js-filter-form' do
= form_tag page_filter_path, method: :get, class: 'flex-fill filter-form js-filter-form' do
- if params[:search].present?
= hidden_field_tag :search, params[:search]
.epics-other-filters.filtered-search-wrapper
......
......@@ -7,8 +7,8 @@
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
%li
= sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_recently_created, label: true), sorted_by)
= sortable_item(sort_title_recently_updated, page_filter_path(sort: sort_value_recently_updated, label: true), sorted_by)
= sortable_item(sort_title_start_date, page_filter_path(sort: sort_value_start_date_soon, label: true), sorted_by)
= sortable_item(sort_title_end_date, page_filter_path(sort: sort_value_end_date, label: true), sorted_by)
= sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_recently_created), sorted_by)
= sortable_item(sort_title_recently_updated, page_filter_path(sort: sort_value_recently_updated), sorted_by)
= sortable_item(sort_title_start_date, page_filter_path(sort: sort_value_start_date_soon), sorted_by)
= sortable_item(sort_title_end_date, page_filter_path(sort: sort_value_end_date), sorted_by)
= sort_order_button(@sort)
......@@ -4,11 +4,11 @@
%ul.nav-links.mobile-separator.epics-state-filters
%li{ class: active_when(params[:state] == 'opened') }>
= link_to page_filter_path(state: 'opened', label: true), id: 'state-opened', title: (_("Filter by %{issuable_type} that are currently opened.") % { issuable_type: page_context_word }), data: { state: 'opened' } do
= link_to page_filter_path(state: 'opened'), id: 'state-opened', title: (_("Filter by %{issuable_type} that are currently opened.") % { issuable_type: page_context_word }), data: { state: 'opened' } do
#{issuables_state_counter_text(type, :opened, display_count)}
%li{ class: active_when(params[:state] == 'closed') }>
= link_to page_filter_path(state: 'closed', label: true), id: 'state-closed', title: (_("Filter by %{issuable_type} that are currently closed.") % { issuable_type: page_context_word }), data: { state: 'closed' } do
= link_to page_filter_path(state: 'closed'), id: 'state-closed', title: (_("Filter by %{issuable_type} that are currently closed.") % { issuable_type: page_context_word }), data: { state: 'closed' } do
#{issuables_state_counter_text(type, :closed, display_count)}
= render 'shared/issuable/nav_links/all', page_context_word: page_context_word, counter: issuables_state_counter_text(type, :all, display_count)
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