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
84ad1a41
Commit
84ad1a41
authored
Mar 28, 2018
by
oswaldoferreira
Committed by
Oswaldo Ferreira
Mar 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Order boards dropdown alphabetically
parent
80221cd4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
5 deletions
+27
-5
app/services/boards/list_service.rb
app/services/boards/list_service.rb
+5
-1
ee/app/services/ee/boards/list_service.rb
ee/app/services/ee/boards/list_service.rb
+7
-0
ee/changelogs/unreleased/osw-order-boards-by-name-ee.yml
ee/changelogs/unreleased/osw-order-boards-by-name-ee.yml
+5
-0
ee/spec/services/boards/list_service_spec.rb
ee/spec/services/boards/list_service_spec.rb
+10
-4
No files found.
app/services/boards/list_service.rb
View file @
84ad1a41
...
...
@@ -4,11 +4,15 @@ module Boards
def
execute
create_board!
if
parent
.
boards
.
empty?
parent
.
boards
boards
end
private
def
boards
parent
.
boards
end
def
create_board!
Boards
::
CreateService
.
new
(
parent
,
current_user
).
execute
end
...
...
ee/app/services/ee/boards/list_service.rb
View file @
84ad1a41
...
...
@@ -11,6 +11,13 @@ module EE
super
.
limit
(
1
)
end
end
private
override
:boards
def
boards
super
.
order
(
'LOWER(name) ASC'
)
end
end
end
end
ee/changelogs/unreleased/osw-order-boards-by-name-ee.yml
0 → 100644
View file @
84ad1a41
---
title
:
Order boards dropdown alphabetically
merge_request
:
author
:
type
:
changed
ee/spec/services/boards/list_service_spec.rb
View file @
84ad1a41
...
...
@@ -3,9 +3,7 @@ require 'spec_helper'
describe
Boards
::
ListService
do
shared_examples
'boards list service'
do
let
(
:service
)
{
described_class
.
new
(
parent
,
double
)
}
before
do
create_list
(
:board
,
2
,
parent:
parent
)
end
let!
(
:boards
)
{
create_list
(
:board
,
3
,
parent:
parent
)
}
describe
'#execute'
do
it
'returns all issue boards when multiple issue boards is enabled'
do
...
...
@@ -13,7 +11,7 @@ describe Boards::ListService do
stub_licensed_features
(
multiple_group_issue_boards:
true
)
end
expect
(
service
.
execute
.
size
).
to
eq
(
2
)
expect
(
service
.
execute
.
size
).
to
eq
(
3
)
end
it
'returns the first issue board when multiple issue boards is disabled'
do
...
...
@@ -23,6 +21,14 @@ describe Boards::ListService do
expect
(
service
.
execute
.
size
).
to
eq
(
1
)
end
it
'returns boards ordered by name'
do
board_names
=
[
'a-board'
,
'B-board'
,
'c-board'
].
shuffle
boards
.
each_with_index
{
|
board
,
i
|
board
.
update_column
(
:name
,
board_names
[
i
])
}
stub_licensed_features
(
multiple_group_issue_boards:
true
)
expect
(
service
.
execute
.
pluck
(
:name
)).
to
eq
([
'a-board'
,
'B-board'
,
'c-board'
])
end
end
end
...
...
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