Commit fc6d5c72 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '331625-add-sorting-by-title-to-epic-list' into 'master'

Add option to order epics by title on list page

See merge request gitlab-org/gitlab!63767
parents 86e8013f 4474d1a6
......@@ -138,6 +138,7 @@ link in the issue sidebar.
> - 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.
> - 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
that of issues and merge requests) based on following parameters:
......@@ -160,6 +161,7 @@ You can also sort epics list by:
- Last updated
- Start date
- Due date
- Title
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
......
......@@ -18,6 +18,14 @@ export const EpicsSortOptions = [
ascending: 'end_date_asc',
},
},
{
id: AvailableSortOptions.length + 30,
title: __('Title'),
sortDirection: {
descending: 'title_desc',
ascending: 'title_asc',
},
},
];
export const FilterStateEmptyMessage = {
......
......@@ -25,7 +25,9 @@ module EE
sort_value_start_date_later => 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 => 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
......@@ -37,8 +39,8 @@ module EE
sort_value_oldest_created => sort_value_recently_created,
sort_value_oldest_updated => sort_value_recently_updated,
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
......
......@@ -37,6 +37,10 @@ module EE
s_('SortOptions|Type')
end
def sort_title_title
s_('SortOptions|Title')
end
def sort_value_start_date
'start_date_asc'
end
......@@ -45,6 +49,14 @@ module EE
'end_date_asc'
end
def sort_value_title
'title_asc'
end
def sort_value_title_desc
'title_desc'
end
def sort_value_end_date_later
'end_date_desc'
end
......
......@@ -16,4 +16,5 @@
= 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)
= sortable_item(sort_title_title, page_filter_path(sort: sort_value_title), sorted_by)
= sort_order_button(@sort)
......@@ -60,7 +60,7 @@ RSpec.describe 'group epic roadmap', :js do
expect(page).to have_css('.filter-dropdown-container')
find('.epics-sort-btn').click
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('Due date')
end
......
......@@ -30564,6 +30564,9 @@ msgstr ""
msgid "SortOptions|Start soon"
msgstr ""
msgid "SortOptions|Title"
msgstr ""
msgid "SortOptions|Type"
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