Commit da8bc3df authored by Mikolaj Wawrzyniak's avatar Mikolaj Wawrzyniak

Revert change to dashboard select list order

Sorting will be only done at the front end
parent 3aa25394
......@@ -38,7 +38,6 @@ module MetricsDashboard
dashboard_finder
.find_all_paths(project_for_dashboard)
.map(&method(:amend_dashboard))
.sort_by { |dashboard| [dashboard[:starred] ? 0 : 1, dashboard[:display_name].downcase] }
end
def amend_dashboard(dashboard)
......
---
title: Restore original sort order of the metrics dashboard select list
merge_request: 31859
author:
type: fixed
......@@ -134,10 +134,10 @@ describe MetricsDashboard do
it 'adds starred dashboard information and sorts the list' do
all_dashboards = json_response['all_dashboards'].map { |dashboard| dashboard.slice('display_name', 'starred', 'user_starred_path') }
expected_response = [
{ "display_name" => "errors.yml", "starred" => true, 'user_starred_path' => nil },
{ "display_name" => "test.yml", "starred" => true, 'user_starred_path' => nil },
{ "display_name" => "Default", "starred" => false, 'user_starred_path' => nil },
{ "display_name" => "anomaly.yml", "starred" => false, 'user_starred_path' => nil },
{ "display_name" => "Default", "starred" => false, 'user_starred_path' => nil }
{ "display_name" => "errors.yml", "starred" => true, 'user_starred_path' => nil },
{ "display_name" => "test.yml", "starred" => true, 'user_starred_path' => nil }
]
expect(all_dashboards).to eql expected_response
......
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