Fix issuables sort direction button parameters

Fix labels parameter being deleted from filter
when clicking sort direction button on issues/merge requests search bar.
This commit is contained in:
Felipe Artur 2018-12-11 15:11:08 -02:00
parent 18a48e348b
commit 61ad1da134
2 changed files with 6 additions and 2 deletions

View file

@ -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)
reverse_url = page_filter_path(sort: reverse_sort, label: true)
else
reverse_url = '#'
link_class += ' disabled'

View file

@ -21,7 +21,11 @@ describe SortingHelper do
describe '#issuable_sort_direction_button' do
before do
allow(self).to receive(:request).and_return(double(path: 'http://test.com', query_parameters: {}))
allow(self).to receive(:request).and_return(double(path: 'http://test.com', query_parameters: { label_name: 'test_label' }))
end
it 'keeps label filter param' do
expect(issuable_sort_direction_button('created_date')).to include('label_name=test_label')
end
it 'returns icon with sort-highest when sort is created_date' do