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
Léo-Paul Géneau
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
module
Boards
class
BaseService
class
BaseService
<
::
BaseService
def
initialize
(
project
,
user
,
params
=
{})
delegate
:board
,
to: :project
@project
=
project
@board
=
project
.
board
@user
=
user
@params
=
params
.
dup
end
private
attr_reader
:project
,
:board
,
:user
,
:params
end
end
end
end
app/services/boards/issues/list_service.rb
View file @
4de6799e
...
@@ -2,7 +2,7 @@ module Boards
...
@@ -2,7 +2,7 @@ module Boards
module
Issues
module
Issues
class
ListService
<
Boards
::
BaseService
class
ListService
<
Boards
::
BaseService
def
execute
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
=
without_board_labels
(
issues
)
unless
list
.
movable?
issues
=
with_list_label
(
issues
)
if
list
.
movable?
issues
=
with_list_label
(
issues
)
if
list
.
movable?
issues
issues
...
...
app/services/boards/issues/move_service.rb
View file @
4de6799e
...
@@ -2,7 +2,7 @@ module Boards
...
@@ -2,7 +2,7 @@ module Boards
module
Issues
module
Issues
class
MoveService
<
Boards
::
BaseService
class
MoveService
<
Boards
::
BaseService
def
execute
(
issue
)
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?
return
false
unless
valid_move?
update_service
.
execute
(
issue
)
update_service
.
execute
(
issue
)
...
@@ -23,7 +23,7 @@ module Boards
...
@@ -23,7 +23,7 @@ module Boards
end
end
def
update_service
def
update_service
::
Issues
::
UpdateService
.
new
(
project
,
user
,
issue_params
)
::
Issues
::
UpdateService
.
new
(
project
,
current_
user
,
issue_params
)
end
end
def
issue_params
def
issue_params
...
...
app/services/boards/lists/generate_service.rb
View file @
4de6799e
...
@@ -15,7 +15,7 @@ module Boards
...
@@ -15,7 +15,7 @@ module Boards
def
create_list
(
params
)
def
create_list
(
params
)
label
=
find_or_create_label
(
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
end
def
find_or_create_label
(
params
)
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