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
4de6799e
Commit
4de6799e
authored
Aug 16, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inherit board related services from BaseService
parent
50ac488c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
15 deletions
+6
-15
app/services/boards/base_service.rb
app/services/boards/base_service.rb
+2
-11
app/services/boards/issues/list_service.rb
app/services/boards/issues/list_service.rb
+1
-1
app/services/boards/issues/move_service.rb
app/services/boards/issues/move_service.rb
+2
-2
app/services/boards/lists/generate_service.rb
app/services/boards/lists/generate_service.rb
+1
-1
No files found.
app/services/boards/base_service.rb
View file @
4de6799e
module
Boards
class
BaseService
def
initialize
(
project
,
user
,
params
=
{})
@project
=
project
@board
=
project
.
board
@user
=
user
@params
=
params
.
dup
end
private
attr_reader
:project
,
:board
,
:user
,
:params
class
BaseService
<
::
BaseService
delegate
:board
,
to: :project
end
end
app/services/boards/issues/list_service.rb
View file @
4de6799e
...
...
@@ -2,7 +2,7 @@ module Boards
module
Issues
class
ListService
<
Boards
::
BaseService
def
execute
issues
=
IssuesFinder
.
new
(
user
,
filter_params
).
execute
issues
=
IssuesFinder
.
new
(
current_
user
,
filter_params
).
execute
issues
=
without_board_labels
(
issues
)
unless
list
.
movable?
issues
=
with_list_label
(
issues
)
if
list
.
movable?
issues
...
...
app/services/boards/issues/move_service.rb
View file @
4de6799e
...
...
@@ -2,7 +2,7 @@ module Boards
module
Issues
class
MoveService
<
Boards
::
BaseService
def
execute
(
issue
)
return
false
unless
user
.
can?
(
:update_issue
,
issue
)
return
false
unless
can?
(
current_user
,
:update_issue
,
issue
)
return
false
unless
valid_move?
update_service
.
execute
(
issue
)
...
...
@@ -23,7 +23,7 @@ module Boards
end
def
update_service
::
Issues
::
UpdateService
.
new
(
project
,
user
,
issue_params
)
::
Issues
::
UpdateService
.
new
(
project
,
current_
user
,
issue_params
)
end
def
issue_params
...
...
app/services/boards/lists/generate_service.rb
View file @
4de6799e
...
...
@@ -15,7 +15,7 @@ module Boards
def
create_list
(
params
)
label
=
find_or_create_label
(
params
)
Lists
::
CreateService
.
new
(
project
,
user
,
label_id:
label
.
id
).
execute
Lists
::
CreateService
.
new
(
project
,
current_
user
,
label_id:
label
.
id
).
execute
end
def
find_or_create_label
(
params
)
...
...
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