Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
da8bc3df
Commit
da8bc3df
authored
May 13, 2020
by
Mikolaj Wawrzyniak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert change to dashboard select list order
Sorting will be only done at the front end
parent
3aa25394
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/controllers/concerns/metrics_dashboard.rb
app/controllers/concerns/metrics_dashboard.rb
+0
-1
changelogs/unreleased/214582-revert-sort-order-change-BE.yml
changelogs/unreleased/214582-revert-sort-order-change-BE.yml
+5
-0
spec/controllers/concerns/metrics_dashboard_spec.rb
spec/controllers/concerns/metrics_dashboard_spec.rb
+3
-3
No files found.
app/controllers/concerns/metrics_dashboard.rb
View file @
da8bc3df
...
...
@@ -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
)
...
...
changelogs/unreleased/214582-revert-sort-order-change-BE.yml
0 → 100644
View file @
da8bc3df
---
title
:
Restore original sort order of the metrics dashboard select list
merge_request
:
31859
author
:
type
:
fixed
spec/controllers/concerns/metrics_dashboard_spec.rb
View file @
da8bc3df
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment