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
0b35ea6c
Commit
0b35ea6c
authored
Jul 01, 2019
by
Alexandru Croitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ProjectEntity to IssuableEntity
* Removed unused and deprecated MergeRequestApprovals entity.
parent
06985d67
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
33 deletions
+6
-33
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+1
-28
lib/api/entities.rb
lib/api/entities.rb
+4
-4
lib/api/import_github.rb
lib/api/import_github.rb
+1
-1
No files found.
ee/lib/ee/api/entities.rb
View file @
0b35ea6c
...
...
@@ -363,35 +363,8 @@ module EE
expose
:user
,
using:
::
API
::
Entities
::
UserBasic
end
# @deprecated, replaced with ApprovalState
class
MergeRequestApprovals
<
::
API
::
Entities
::
ProjectEntity
def
initialize
(
merge_request
,
options
=
{})
presenter
=
merge_request
.
present
(
current_user:
options
[
:current_user
])
super
(
presenter
,
options
)
end
expose
:merge_status
expose
:approvals_required
expose
:approvals_left
expose
:approvals
,
as: :approved_by
,
using:
EE
::
API
::
Entities
::
Approvals
expose
:approvers_left
,
as: :suggested_approvers
,
using:
::
API
::
Entities
::
UserBasic
# @deprecated
expose
:approvers
,
using:
EE
::
API
::
Entities
::
Approver
# @deprecated
expose
:approver_groups
,
using:
EE
::
API
::
Entities
::
ApproverGroup
expose
:user_has_approved
do
|
merge_request
,
options
|
merge_request
.
has_approved?
(
options
[
:current_user
])
end
expose
:user_can_approve
do
|
merge_request
,
options
|
merge_request
.
can_approve?
(
options
[
:current_user
])
end
end
class
ApprovalState
<
Grape
::
Entity
expose
:merge_request
,
merge:
true
,
using:
::
API
::
Entities
::
Project
Entity
expose
:merge_request
,
merge:
true
,
using:
::
API
::
Entities
::
Issuable
Entity
expose
(
:merge_status
)
{
|
approval_state
|
approval_state
.
merge_request
.
merge_status
}
expose
:approved?
,
as: :approved
...
...
lib/api/entities.rb
View file @
0b35ea6c
...
...
@@ -491,7 +491,7 @@ module API
end
end
class
Project
Entity
<
Grape
::
Entity
class
Issuable
Entity
<
Grape
::
Entity
expose
:id
,
:iid
expose
(
:project_id
)
{
|
entity
|
entity
&
.
project
.
try
(
:id
)
}
expose
:title
,
:description
...
...
@@ -544,7 +544,7 @@ module API
end
end
class
IssueBasic
<
Project
Entity
class
IssueBasic
<
Issuable
Entity
expose
:closed_at
expose
:closed_by
,
using:
Entities
::
UserBasic
...
...
@@ -650,14 +650,14 @@ module API
end
end
class
MergeRequestSimple
<
Project
Entity
class
MergeRequestSimple
<
Issuable
Entity
expose
:title
expose
:web_url
do
|
merge_request
,
options
|
Gitlab
::
UrlBuilder
.
build
(
merge_request
)
end
end
class
MergeRequestBasic
<
Project
Entity
class
MergeRequestBasic
<
Issuable
Entity
expose
:merged_by
,
using:
Entities
::
UserBasic
do
|
merge_request
,
_options
|
merge_request
.
metrics
&
.
merged_by
end
...
...
lib/api/import_github.rb
View file @
0b35ea6c
...
...
@@ -28,7 +28,7 @@ module API
desc
'Import a GitHub project'
do
detail
'This feature was introduced in GitLab 11.3.4.'
success
Entities
::
ProjectEntity
success
::
ProjectEntity
end
params
do
requires
:personal_access_token
,
type:
String
,
desc:
'GitHub personal access token'
...
...
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