Make default sorting preference work for Issues and MRs.
This commit is contained in:
parent
9ef468922c
commit
c3c92c7317
3 changed files with 16 additions and 4 deletions
|
@ -410,10 +410,8 @@ class ApplicationController < ActionController::Base
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_default_sort
|
def set_default_sort
|
||||||
key = if is_a_listing_page_for?('issues')
|
key = if is_a_listing_page_for?('issues') || is_a_listing_page_for?('merge_requests')
|
||||||
'issues_sort'
|
'issuable_sort'
|
||||||
elsif is_a_listing_page_for?('merge_requests')
|
|
||||||
'merge_requests_sort'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
cookies[key] = params[:sort] if key && params[:sort].present?
|
cookies[key] = params[:sort] if key && params[:sort].present?
|
||||||
|
|
|
@ -67,6 +67,13 @@ Feature: Project Issues
|
||||||
And I visit project "Shop" issues page
|
And I visit project "Shop" issues page
|
||||||
Then The list should be sorted by "Oldest updated"
|
Then The list should be sorted by "Oldest updated"
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: Visiting Merge Requests after being sorted the list
|
||||||
|
Given I visit project "Shop" issues page
|
||||||
|
And I sort the list by "Oldest updated"
|
||||||
|
And I visit project "Shop" merge requests page
|
||||||
|
Then The list should be sorted by "Oldest updated"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Visiting Merge Requests from a differente Project after sorting
|
Scenario: Visiting Merge Requests from a differente Project after sorting
|
||||||
Given I visit project "Shop" merge requests page
|
Given I visit project "Shop" merge requests page
|
||||||
|
|
|
@ -92,6 +92,13 @@ Feature: Project Merge Requests
|
||||||
And I visit project "Shop" merge requests page
|
And I visit project "Shop" merge requests page
|
||||||
Then The list should be sorted by "Oldest updated"
|
Then The list should be sorted by "Oldest updated"
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: Visiting Issues after being sorted the list
|
||||||
|
Given I visit project "Shop" merge requests page
|
||||||
|
And I sort the list by "Oldest updated"
|
||||||
|
And I visit project "Shop" issues page
|
||||||
|
Then The list should be sorted by "Oldest updated"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Visiting Merge Requests from a differente Project after sorting
|
Scenario: Visiting Merge Requests from a differente Project after sorting
|
||||||
Given I visit project "Shop" merge requests page
|
Given I visit project "Shop" merge requests page
|
||||||
|
|
Loading…
Reference in a new issue