Commit 4474d1a6 authored by Andrew Smith's avatar Andrew Smith

Add option to order epics by title on list page

Changelog: added
EE: true
parent 24efb0b3
...@@ -140,6 +140,7 @@ link in the issue sidebar. ...@@ -140,6 +140,7 @@ link in the issue sidebar.
> - Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 10.5. > - Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 10.5.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/37081) to the [Premium](https://about.gitlab.com/pricing/) tier in GitLab 12.8. > - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/37081) to the [Premium](https://about.gitlab.com/pricing/) tier in GitLab 12.8.
> - Searching by the user's reaction emoji [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/325630) in GitLab 13.11. > - Searching by the user's reaction emoji [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/325630) in GitLab 13.11.
> - Sorting by epic titles [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/331625) in GitLab 14.1.
You can search for an epic from the list of epics using filtered search bar (similar to You can search for an epic from the list of epics using filtered search bar (similar to
that of issues and merge requests) based on following parameters: that of issues and merge requests) based on following parameters:
...@@ -162,6 +163,7 @@ You can also sort epics list by: ...@@ -162,6 +163,7 @@ You can also sort epics list by:
- Last updated - Last updated
- Start date - Start date
- Due date - Due date
- Title
Each option contains a button that can toggle the order between **Ascending** and **Descending**. Each option contains a button that can toggle the order between **Ascending** and **Descending**.
The sort option and order is saved and used wherever you browse epics, including the The sort option and order is saved and used wherever you browse epics, including the
......
...@@ -18,6 +18,14 @@ export const EpicsSortOptions = [ ...@@ -18,6 +18,14 @@ export const EpicsSortOptions = [
ascending: 'end_date_asc', ascending: 'end_date_asc',
}, },
}, },
{
id: AvailableSortOptions.length + 30,
title: __('Title'),
sortDirection: {
descending: 'title_desc',
ascending: 'title_asc',
},
},
]; ];
export const FilterStateEmptyMessage = { export const FilterStateEmptyMessage = {
......
...@@ -25,7 +25,9 @@ module EE ...@@ -25,7 +25,9 @@ module EE
sort_value_start_date_later => sort_title_start_date, sort_value_start_date_later => sort_title_start_date,
sort_value_start_date_soon => sort_title_start_date, sort_value_start_date_soon => sort_title_start_date,
sort_value_end_date_later => sort_title_end_date, sort_value_end_date_later => sort_title_end_date,
sort_value_end_date => sort_title_end_date sort_value_end_date => sort_title_end_date,
sort_value_title => sort_title_title,
sort_value_title_desc => sort_title_title
} }
end end
...@@ -37,8 +39,8 @@ module EE ...@@ -37,8 +39,8 @@ module EE
sort_value_oldest_created => sort_value_recently_created, sort_value_oldest_created => sort_value_recently_created,
sort_value_oldest_updated => sort_value_recently_updated, sort_value_oldest_updated => sort_value_recently_updated,
sort_value_start_date_soon => sort_value_start_date_later, sort_value_start_date_soon => sort_value_start_date_later,
sort_value_end_date => sort_value_end_date_later sort_value_end_date => sort_value_end_date_later,
sort_value_title => sort_value_title_desc
} }
end end
......
...@@ -37,6 +37,10 @@ module EE ...@@ -37,6 +37,10 @@ module EE
s_('SortOptions|Type') s_('SortOptions|Type')
end end
def sort_title_title
s_('SortOptions|Title')
end
def sort_value_start_date def sort_value_start_date
'start_date_asc' 'start_date_asc'
end end
...@@ -45,6 +49,14 @@ module EE ...@@ -45,6 +49,14 @@ module EE
'end_date_asc' 'end_date_asc'
end end
def sort_value_title
'title_asc'
end
def sort_value_title_desc
'title_desc'
end
def sort_value_end_date_later def sort_value_end_date_later
'end_date_desc' 'end_date_desc'
end end
......
...@@ -16,4 +16,5 @@ ...@@ -16,4 +16,5 @@
= sortable_item(sort_title_recently_updated, page_filter_path(sort: sort_value_recently_updated), 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_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) = sortable_item(sort_title_end_date, page_filter_path(sort: sort_value_end_date), sorted_by)
= sortable_item(sort_title_title, page_filter_path(sort: sort_value_title), sorted_by)
= sort_order_button(@sort) = sort_order_button(@sort)
...@@ -60,7 +60,7 @@ RSpec.describe 'group epic roadmap', :js do ...@@ -60,7 +60,7 @@ RSpec.describe 'group epic roadmap', :js do
expect(page).to have_css('.filter-dropdown-container') expect(page).to have_css('.filter-dropdown-container')
find('.epics-sort-btn').click find('.epics-sort-btn').click
page.within('.dropdown-menu') do page.within('.dropdown-menu') do
expect(page).to have_selector('li a', count: 2) expect(page).to have_selector('li a', count: 3)
expect(page).to have_content('Start date') expect(page).to have_content('Start date')
expect(page).to have_content('Due date') expect(page).to have_content('Due date')
end end
......
...@@ -30546,6 +30546,9 @@ msgstr "" ...@@ -30546,6 +30546,9 @@ msgstr ""
msgid "SortOptions|Start soon" msgid "SortOptions|Start soon"
msgstr "" msgstr ""
msgid "SortOptions|Title"
msgstr ""
msgid "SortOptions|Type" msgid "SortOptions|Type"
msgstr "" msgstr ""
......
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