Change page_filter_path
default behavior
`label_name` is now not excluded by default Also removed `label: true` from calls to the helper
This commit is contained in:
parent
0087396036
commit
7d1a7261f0
8 changed files with 23 additions and 28 deletions
|
@ -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?
|
||||
|
|
|
@ -164,7 +164,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)
|
||||
|
|
Loading…
Reference in a new issue