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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
e7b4eade
Commit
e7b4eade
authored
Jun 06, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved creating backlog list into list service
parent
a980a4f6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
app/controllers/projects/boards/lists_controller.rb
app/controllers/projects/boards/lists_controller.rb
+2
-2
app/services/boards/lists/list_service.rb
app/services/boards/lists/list_service.rb
+2
-0
spec/services/boards/issues/list_service_spec.rb
spec/services/boards/issues/list_service_spec.rb
+1
-1
spec/services/boards/lists/list_service_spec.rb
spec/services/boards/lists/list_service_spec.rb
+1
-1
No files found.
app/controllers/projects/boards/lists_controller.rb
View file @
e7b4eade
...
...
@@ -5,9 +5,9 @@ module Projects
before_action
:authorize_read_list!
,
only:
[
:index
]
def
index
board
.
lists
.
create
(
list_type: :backlog
)
unless
board
.
lists
.
backlog
.
any?
lists
=
::
Boards
::
Lists
::
ListService
.
new
(
project
,
current_user
).
execute
(
board
)
render
json:
serialize_as_json
(
board
.
lists
)
render
json:
serialize_as_json
(
lists
)
end
def
create
...
...
app/services/boards/lists/list_service.rb
View file @
e7b4eade
...
...
@@ -2,6 +2,8 @@ module Boards
module
Lists
class
ListService
<
BaseService
def
execute
(
board
)
board
.
lists
.
create
(
list_type: :backlog
)
unless
board
.
lists
.
backlog
.
any?
board
.
lists
end
end
...
...
spec/services/boards/issues/list_service_spec.rb
View file @
e7b4eade
...
...
@@ -67,7 +67,7 @@ describe Boards::Issues::ListService, services: true do
issues
=
described_class
.
new
(
project
,
user
,
params
).
execute
expect
(
issues
).
to
eq
[
closed_issue4
,
closed_issue2
,
closed_issue
5
,
closed_issue
3
,
closed_issue1
]
expect
(
issues
).
to
eq
[
closed_issue4
,
closed_issue2
,
closed_issue3
,
closed_issue1
]
end
it
'returns opened issues that have label list applied when listing issues from a label list'
do
...
...
spec/services/boards/lists/list_service_spec.rb
View file @
e7b4eade
...
...
@@ -10,7 +10,7 @@ describe Boards::Lists::ListService, services: true do
service
=
described_class
.
new
(
project
,
double
)
expect
(
service
.
execute
(
board
)).
to
eq
[
list
,
board
.
closed_list
]
expect
(
service
.
execute
(
board
)).
to
eq
[
board
.
backlog_list
,
list
,
board
.
closed_list
]
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