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
ba87f495
Commit
ba87f495
authored
Feb 21, 2020
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate ee entities into own class files
parent
17df1f5e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
36 deletions
+71
-36
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+0
-36
ee/lib/ee/api/entities/approval_rule.rb
ee/lib/ee/api/entities/approval_rule.rb
+20
-0
ee/lib/ee/api/entities/approval_rule_short.rb
ee/lib/ee/api/entities/approval_rule_short.rb
+11
-0
ee/lib/ee/api/entities/epic_issue_link.rb
ee/lib/ee/api/entities/epic_issue_link.rb
+16
-0
ee/lib/ee/api/entities/issue_link.rb
ee/lib/ee/api/entities/issue_link.rb
+13
-0
ee/lib/ee/api/entities/special_board_filter.rb
ee/lib/ee/api/entities/special_board_filter.rb
+11
-0
No files found.
ee/lib/ee/api/entities.rb
View file @
ba87f495
...
...
@@ -265,42 +265,6 @@ module EE
end
end
class
EpicIssueLink
<
Grape
::
Entity
expose
:id
expose
:relative_position
expose
:epic
do
|
epic_issue_link
,
_options
|
::
EE
::
API
::
Entities
::
Epic
.
represent
(
epic_issue_link
.
epic
,
with_reference:
true
)
end
expose
:issue
,
using:
::
API
::
Entities
::
IssueBasic
end
class
IssueLink
<
Grape
::
Entity
expose
:source
,
as: :source_issue
,
using:
::
API
::
Entities
::
IssueBasic
expose
:target
,
as: :target_issue
,
using:
::
API
::
Entities
::
IssueBasic
expose
:link_type
end
class
SpecialBoardFilter
<
Grape
::
Entity
expose
:title
end
class
ApprovalRuleShort
<
Grape
::
Entity
expose
:id
,
:name
,
:rule_type
end
class
ApprovalRule
<
ApprovalRuleShort
def
initialize
(
object
,
options
=
{})
presenter
=
::
ApprovalRulePresenter
.
new
(
object
,
current_user:
options
[
:current_user
])
super
(
presenter
,
options
)
end
expose
:approvers
,
as: :eligible_approvers
,
using:
::
API
::
Entities
::
UserBasic
expose
:approvals_required
expose
:users
,
using:
::
API
::
Entities
::
UserBasic
expose
:groups
,
using:
::
API
::
Entities
::
Group
expose
:contains_hidden_groups?
,
as: :contains_hidden_groups
end
class
ProjectApprovalRule
<
ApprovalRule
expose
:protected_branches
,
using:
::
API
::
Entities
::
ProtectedBranch
,
if:
->
(
rule
,
_
)
{
rule
.
project
.
multiple_approval_rules_available?
}
end
...
...
ee/lib/ee/api/entities/approval_rule.rb
0 → 100644
View file @
ba87f495
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
ApprovalRule
<
ApprovalRuleShort
def
initialize
(
object
,
options
=
{})
presenter
=
::
ApprovalRulePresenter
.
new
(
object
,
current_user:
options
[
:current_user
])
super
(
presenter
,
options
)
end
expose
:approvers
,
as: :eligible_approvers
,
using:
::
API
::
Entities
::
UserBasic
expose
:approvals_required
expose
:users
,
using:
::
API
::
Entities
::
UserBasic
expose
:groups
,
using:
::
API
::
Entities
::
Group
expose
:contains_hidden_groups?
,
as: :contains_hidden_groups
end
end
end
end
ee/lib/ee/api/entities/approval_rule_short.rb
0 → 100644
View file @
ba87f495
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
ApprovalRuleShort
<
Grape
::
Entity
expose
:id
,
:name
,
:rule_type
end
end
end
end
ee/lib/ee/api/entities/epic_issue_link.rb
0 → 100644
View file @
ba87f495
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
EpicIssueLink
<
Grape
::
Entity
expose
:id
expose
:relative_position
expose
:epic
do
|
epic_issue_link
,
_options
|
::
EE
::
API
::
Entities
::
Epic
.
represent
(
epic_issue_link
.
epic
,
with_reference:
true
)
end
expose
:issue
,
using:
::
API
::
Entities
::
IssueBasic
end
end
end
end
ee/lib/ee/api/entities/issue_link.rb
0 → 100644
View file @
ba87f495
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
IssueLink
<
Grape
::
Entity
expose
:source
,
as: :source_issue
,
using:
::
API
::
Entities
::
IssueBasic
expose
:target
,
as: :target_issue
,
using:
::
API
::
Entities
::
IssueBasic
expose
:link_type
end
end
end
end
ee/lib/ee/api/entities/special_board_filter.rb
0 → 100644
View file @
ba87f495
# frozen_string_literal: true
module
EE
module
API
module
Entities
class
SpecialBoardFilter
<
Grape
::
Entity
expose
:title
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