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
bed774a8
Commit
bed774a8
authored
Jun 22, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE changes from Boards::BaseService to its own module
parent
c7edc332
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
27 deletions
+34
-27
app/services/boards/base_service.rb
app/services/boards/base_service.rb
+2
-27
ee/app/services/ee/boards/base_service.rb
ee/app/services/ee/boards/base_service.rb
+32
-0
No files found.
app/services/boards/base_service.rb
View file @
bed774a8
module
Boards
class
BaseService
<
::
BaseService
prepend
EE
::
Boards
::
BaseService
# Parent can either a group or a project
attr_accessor
:parent
,
:current_user
,
:params
def
initialize
(
parent
,
user
,
params
=
{})
@parent
,
@current_user
,
@params
=
parent
,
user
,
params
.
dup
end
def
set_assignee
assignee
=
User
.
find_by
(
id:
params
.
delete
(
:assignee_id
))
params
.
merge!
(
assignee:
assignee
)
end
def
set_milestone
milestone_id
=
params
[
:milestone_id
]
return
unless
milestone_id
return
if
[
::
Milestone
::
None
.
id
,
::
Milestone
::
Upcoming
.
id
,
::
Milestone
::
Started
.
id
].
include?
(
milestone_id
)
finder_params
=
case
parent
when
Group
{
group_ids:
[
parent
.
id
]
}
when
Project
{
project_ids:
[
parent
.
id
],
group_ids:
[
parent
.
group
&
.
id
]
}
end
milestone
=
MilestonesFinder
.
new
(
finder_params
).
find_by
(
id:
milestone_id
)
params
[
:milestone_id
]
=
milestone
&
.
id
end
end
end
ee/app/services/ee/boards/base_service.rb
0 → 100644
View file @
bed774a8
module
EE
module
Boards
module
BaseService
def
set_assignee
assignee
=
::
User
.
find_by
(
id:
params
.
delete
(
:assignee_id
))
params
.
merge!
(
assignee:
assignee
)
end
def
set_milestone
milestone_id
=
params
[
:milestone_id
]
return
unless
milestone_id
return
if
[
::
Milestone
::
None
.
id
,
::
Milestone
::
Upcoming
.
id
,
::
Milestone
::
Started
.
id
].
include?
(
milestone_id
)
finder_params
=
case
parent
when
Group
{
group_ids:
[
parent
.
id
]
}
when
Project
{
project_ids:
[
parent
.
id
],
group_ids:
[
parent
.
group
&
.
id
]
}
end
milestone
=
::
MilestonesFinder
.
new
(
finder_params
).
find_by
(
id:
milestone_id
)
params
[
:milestone_id
]
=
milestone
&
.
id
end
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