Commit 546e0a86 authored by Coung Ngo's avatar Coung Ngo Committed by Nikola Milojevic

Update sort name from Last updated to Updated date

Update sort name on list views such as issues,
merge requests, and epics

https://gitlab.com/gitlab-org/gitlab/-/issues/23775

Changelog: changed
parent b292b07c
...@@ -72,7 +72,7 @@ export const getSortOptions = (hasIssueWeightsFeature, hasBlockedIssuesFeature) ...@@ -72,7 +72,7 @@ export const getSortOptions = (hasIssueWeightsFeature, hasBlockedIssuesFeature)
}, },
{ {
id: 3, id: 3,
title: __('Last updated'), title: __('Updated date'),
sortDirection: { sortDirection: {
ascending: UPDATED_ASC, ascending: UPDATED_ASC,
descending: UPDATED_DESC, descending: UPDATED_DESC,
......
...@@ -38,7 +38,7 @@ export const AvailableSortOptions = [ ...@@ -38,7 +38,7 @@ export const AvailableSortOptions = [
}, },
{ {
id: 2, id: 2,
title: __('Last updated'), title: __('Updated date'),
sortDirection: { sortDirection: {
descending: 'updated_desc', descending: 'updated_desc',
ascending: 'updated_asc', ascending: 'updated_asc',
......
...@@ -141,7 +141,7 @@ module SearchHelper ...@@ -141,7 +141,7 @@ module SearchHelper
} }
}, },
{ {
title: _('Last updated'), title: _('Updated date'),
sortable: true, sortable: true,
sortParam: { sortParam: {
asc: 'updated_asc', asc: 'updated_asc',
......
...@@ -59,7 +59,7 @@ module SortingTitlesValuesHelper ...@@ -59,7 +59,7 @@ module SortingTitlesValuesHelper
end end
def sort_title_latest_activity def sort_title_latest_activity
s_('SortOptions|Last updated') _('Updated date')
end end
def sort_title_milestone def sort_title_milestone
...@@ -127,7 +127,7 @@ module SortingTitlesValuesHelper ...@@ -127,7 +127,7 @@ module SortingTitlesValuesHelper
end end
def sort_title_recently_updated def sort_title_recently_updated
s_('SortOptions|Last updated') _('Updated date')
end end
def sort_title_start_date_later def sort_title_start_date_later
......
...@@ -22,7 +22,7 @@ export const AvailableSortOptions = [ ...@@ -22,7 +22,7 @@ export const AvailableSortOptions = [
}, },
{ {
id: 2, id: 2,
title: __('Last updated'), title: __('Updated date'),
sortDirection: { sortDirection: {
descending: 'updated_desc', descending: 'updated_desc',
ascending: 'updated_asc', ascending: 'updated_asc',
......
...@@ -38,7 +38,7 @@ export const AvailableSortOptions = [ ...@@ -38,7 +38,7 @@ export const AvailableSortOptions = [
}, },
{ {
id: 2, id: 2,
title: __('Last updated'), title: __('Updated date'),
sortDirection: { sortDirection: {
descending: 'updated_desc', descending: 'updated_desc',
ascending: 'updated_asc', ascending: 'updated_asc',
......
...@@ -94,14 +94,14 @@ RSpec.describe 'epics list', :js do ...@@ -94,14 +94,14 @@ RSpec.describe 'epics list', :js do
sort_options = find('ul.dropdown-menu-sort li').all('a').collect(&:text) sort_options = find('ul.dropdown-menu-sort li').all('a').collect(&:text)
expect(sort_options[0]).to eq('Created date') expect(sort_options[0]).to eq('Created date')
expect(sort_options[1]).to eq('Last updated') expect(sort_options[1]).to eq('Updated date')
expect(sort_options[2]).to eq('Start date') expect(sort_options[2]).to eq('Start date')
expect(sort_options[3]).to eq('Due date') expect(sort_options[3]).to eq('Due date')
click_link 'Last updated' click_link 'Updated date'
end end
expect(page).to have_button('Last updated') expect(page).to have_button('Updated date')
page.within('.content-wrapper .content') do page.within('.content-wrapper .content') do
expect(find('.top-area')).to have_content('All 3') expect(find('.top-area')).to have_content('All 3')
...@@ -123,7 +123,7 @@ RSpec.describe 'epics list', :js do ...@@ -123,7 +123,7 @@ RSpec.describe 'epics list', :js do
visit group_epics_path(group) visit group_epics_path(group)
expect(page).to have_button('Last updated') expect(page).to have_button('Updated date')
end end
it 'renders the epic detail correctly after clicking the link' do it 'renders the epic detail correctly after clicking the link' do
......
...@@ -149,7 +149,7 @@ Object { ...@@ -149,7 +149,7 @@ Object {
"ascending": "updated_asc", "ascending": "updated_asc",
"descending": "updated_desc", "descending": "updated_desc",
}, },
"title": "Last updated", "title": "Updated date",
}, },
], ],
"tabCounts": null, "tabCounts": null,
......
...@@ -268,7 +268,7 @@ RSpec.describe SearchHelper do ...@@ -268,7 +268,7 @@ RSpec.describe SearchHelper do
} }
mock_updated_sort = { mock_updated_sort = {
title: _('Last updated'), title: _('Updated date'),
sortable: true, sortable: true,
sortParam: { sortParam: {
asc: 'updated_asc', asc: 'updated_asc',
......
...@@ -33574,9 +33574,6 @@ msgstr "" ...@@ -33574,9 +33574,6 @@ msgstr ""
msgid "SortOptions|Last created" msgid "SortOptions|Last created"
msgstr "" msgstr ""
msgid "SortOptions|Last updated"
msgstr ""
msgid "SortOptions|Least popular" msgid "SortOptions|Least popular"
msgstr "" msgstr ""
...@@ -38264,6 +38261,9 @@ msgstr "" ...@@ -38264,6 +38261,9 @@ msgstr ""
msgid "Updated %{updated_at} by %{updated_by}" msgid "Updated %{updated_at} by %{updated_by}"
msgstr "" msgstr ""
msgid "Updated date"
msgstr ""
msgid "Updates" msgid "Updates"
msgstr "" msgstr ""
......
...@@ -168,7 +168,7 @@ RSpec.describe 'Dashboard > User filters projects' do ...@@ -168,7 +168,7 @@ RSpec.describe 'Dashboard > User filters projects' do
sorting_dropdown.click sorting_dropdown.click
['Last updated', 'Created date', 'Name', 'Stars'].each do |label| ['Updated date', 'Created date', 'Name', 'Stars'].each do |label|
expect(sorting_dropdown).to have_content(label) expect(sorting_dropdown).to have_content(label)
end end
end end
...@@ -192,9 +192,9 @@ RSpec.describe 'Dashboard > User filters projects' do ...@@ -192,9 +192,9 @@ RSpec.describe 'Dashboard > User filters projects' do
end end
end end
context 'Sorting by Last updated' do context 'Sorting by Updated date' do
it 'sorts the project list' do it 'sorts the project list' do
select_dropdown_option '#filtered-search-sorting-dropdown', 'Last updated' select_dropdown_option '#filtered-search-sorting-dropdown', 'Updated date'
expect_to_see_projects(desc_sorted_project_names) expect_to_see_projects(desc_sorted_project_names)
......
...@@ -34,7 +34,7 @@ RSpec.describe 'Sort labels', :js do ...@@ -34,7 +34,7 @@ RSpec.describe 'Sort labels', :js do
expect(sort_options[1]).to eq('Name, descending') expect(sort_options[1]).to eq('Name, descending')
expect(sort_options[2]).to eq('Last created') expect(sort_options[2]).to eq('Last created')
expect(sort_options[3]).to eq('Oldest created') expect(sort_options[3]).to eq('Oldest created')
expect(sort_options[4]).to eq('Last updated') expect(sort_options[4]).to eq('Updated date')
expect(sort_options[5]).to eq('Oldest updated') expect(sort_options[5]).to eq('Oldest updated')
click_link 'Name, descending' click_link 'Name, descending'
......
...@@ -54,10 +54,10 @@ RSpec.describe 'Sort Issuable List' do ...@@ -54,10 +54,10 @@ RSpec.describe 'Sort Issuable List' do
context 'in the "merge requests / merged" tab', :js do context 'in the "merge requests / merged" tab', :js do
let(:issuable_type) { :merged_merge_request } let(:issuable_type) { :merged_merge_request }
it 'is "last updated"' do it 'is "updated date"' do
visit_merge_requests_with_state(project, 'merged') visit_merge_requests_with_state(project, 'merged')
expect(page).to have_button 'Last updated' expect(page).to have_button 'Updated date'
expect(first_merge_request).to include(last_updated_issuable.title) expect(first_merge_request).to include(last_updated_issuable.title)
expect(last_merge_request).to include(first_updated_issuable.title) expect(last_merge_request).to include(first_updated_issuable.title)
end end
...@@ -66,10 +66,10 @@ RSpec.describe 'Sort Issuable List' do ...@@ -66,10 +66,10 @@ RSpec.describe 'Sort Issuable List' do
context 'in the "merge requests / closed" tab', :js do context 'in the "merge requests / closed" tab', :js do
let(:issuable_type) { :closed_merge_request } let(:issuable_type) { :closed_merge_request }
it 'is "last updated"' do it 'is "updated date"' do
visit_merge_requests_with_state(project, 'closed') visit_merge_requests_with_state(project, 'closed')
expect(page).to have_button 'Last updated' expect(page).to have_button 'Updated date'
expect(first_merge_request).to include(last_updated_issuable.title) expect(first_merge_request).to include(last_updated_issuable.title)
expect(last_merge_request).to include(first_updated_issuable.title) expect(last_merge_request).to include(first_updated_issuable.title)
end end
...@@ -95,7 +95,7 @@ RSpec.describe 'Sort Issuable List' do ...@@ -95,7 +95,7 @@ RSpec.describe 'Sort Issuable List' do
visit_merge_requests_with_state(project, 'open') visit_merge_requests_with_state(project, 'open')
click_button('Created date') click_button('Created date')
click_link('Last updated') click_link('Updated date')
expect(first_merge_request).to include(last_updated_issuable.title) expect(first_merge_request).to include(last_updated_issuable.title)
expect(last_merge_request).to include(first_updated_issuable.title) expect(last_merge_request).to include(first_updated_issuable.title)
...@@ -152,10 +152,10 @@ RSpec.describe 'Sort Issuable List' do ...@@ -152,10 +152,10 @@ RSpec.describe 'Sort Issuable List' do
context 'in the "issues / closed" tab', :js do context 'in the "issues / closed" tab', :js do
let(:issuable_type) { :closed_issue } let(:issuable_type) { :closed_issue }
it 'is "last updated"' do it 'is "updated date"' do
visit_issues_with_state(project, 'closed') visit_issues_with_state(project, 'closed')
expect(page).to have_button 'Last updated' expect(page).to have_button 'Updated date'
expect(first_issue).to include(last_updated_issuable.title) expect(first_issue).to include(last_updated_issuable.title)
expect(last_issue).to include(first_updated_issuable.title) expect(last_issue).to include(first_updated_issuable.title)
end end
...@@ -195,7 +195,7 @@ RSpec.describe 'Sort Issuable List' do ...@@ -195,7 +195,7 @@ RSpec.describe 'Sort Issuable List' do
visit_issues_with_state(project, 'opened') visit_issues_with_state(project, 'opened')
click_button('Created date') click_button('Created date')
click_on('Last updated') click_on('Updated date')
expect(page).to have_css('.issue:first-child', text: last_updated_issuable.title) expect(page).to have_css('.issue:first-child', text: last_updated_issuable.title)
expect(page).to have_css('.issue:last-child', text: first_updated_issuable.title) expect(page).to have_css('.issue:last-child', text: first_updated_issuable.title)
......
...@@ -117,7 +117,7 @@ RSpec.describe 'Branches' do ...@@ -117,7 +117,7 @@ RSpec.describe 'Branches' do
it 'sorts the branches by name', :js do it 'sorts the branches by name', :js do
visit project_branches_filtered_path(project, state: 'all') visit project_branches_filtered_path(project, state: 'all')
click_button "Last updated" # Open sorting dropdown click_button "Updated date" # Open sorting dropdown
within '[data-testid="branches-dropdown"]' do within '[data-testid="branches-dropdown"]' do
find('p', text: 'Name').click find('p', text: 'Name').click
end end
...@@ -128,7 +128,7 @@ RSpec.describe 'Branches' do ...@@ -128,7 +128,7 @@ RSpec.describe 'Branches' do
it 'sorts the branches by oldest updated', :js do it 'sorts the branches by oldest updated', :js do
visit project_branches_filtered_path(project, state: 'all') visit project_branches_filtered_path(project, state: 'all')
click_button "Last updated" # Open sorting dropdown click_button "Updated date" # Open sorting dropdown
within '[data-testid="branches-dropdown"]' do within '[data-testid="branches-dropdown"]' do
find('p', text: 'Oldest updated').click find('p', text: 'Oldest updated').click
end end
......
...@@ -34,7 +34,7 @@ RSpec.describe 'Sort labels', :js do ...@@ -34,7 +34,7 @@ RSpec.describe 'Sort labels', :js do
expect(sort_options[1]).to eq('Name, descending') expect(sort_options[1]).to eq('Name, descending')
expect(sort_options[2]).to eq('Last created') expect(sort_options[2]).to eq('Last created')
expect(sort_options[3]).to eq('Oldest created') expect(sort_options[3]).to eq('Oldest created')
expect(sort_options[4]).to eq('Last updated') expect(sort_options[4]).to eq('Updated date')
expect(sort_options[5]).to eq('Oldest updated') expect(sort_options[5]).to eq('Oldest updated')
click_link 'Name, descending' click_link 'Name, descending'
......
...@@ -41,10 +41,10 @@ RSpec.describe 'User sorts projects and order persists' do ...@@ -41,10 +41,10 @@ RSpec.describe 'User sorts projects and order persists' do
sign_in(user) sign_in(user)
visit(explore_projects_path) visit(explore_projects_path)
find('#sort-projects-dropdown').click find('#sort-projects-dropdown').click
first(:link, 'Last updated').click first(:link, 'Updated date').click
end end
it_behaves_like "sort order persists across all views", "Last updated", "Last updated" it_behaves_like "sort order persists across all views", 'Updated date', 'Updated date'
end end
context 'from dashboard projects' do context 'from dashboard projects' do
......
...@@ -21,7 +21,7 @@ RSpec.describe "User sorts things" do ...@@ -21,7 +21,7 @@ RSpec.describe "User sorts things" do
end end
it "issues -> project home page -> issues" do it "issues -> project home page -> issues" do
sort_option = "Last updated" sort_option = 'Updated date'
visit(project_issues_path(project)) visit(project_issues_path(project))
...@@ -34,7 +34,7 @@ RSpec.describe "User sorts things" do ...@@ -34,7 +34,7 @@ RSpec.describe "User sorts things" do
end end
it "issues -> merge requests" do it "issues -> merge requests" do
sort_option = "Last updated" sort_option = 'Updated date'
visit(project_issues_path(project)) visit(project_issues_path(project))
...@@ -46,7 +46,7 @@ RSpec.describe "User sorts things" do ...@@ -46,7 +46,7 @@ RSpec.describe "User sorts things" do
end end
it "merge requests -> dashboard merge requests" do it "merge requests -> dashboard merge requests" do
sort_option = "Last updated" sort_option = 'Updated date'
visit(project_merge_requests_path(project)) visit(project_merge_requests_path(project))
......
...@@ -641,7 +641,7 @@ RSpec.describe SearchHelper do ...@@ -641,7 +641,7 @@ RSpec.describe SearchHelper do
} }
}, },
{ {
title: _('Last updated'), title: _('Updated date'),
sortable: true, sortable: true,
sortParam: { sortParam: {
asc: 'updated_asc', asc: 'updated_asc',
......
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