Commit 227d8b44 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '58275-rename-project-entity' into 'master'

Rename ProjectEntity to IssuableEntity

Closes #58275

See merge request gitlab-org/gitlab-ce!30217
parents 713cc99a dba5f3ae
...@@ -511,7 +511,7 @@ module API ...@@ -511,7 +511,7 @@ module API
end end
end end
class ProjectEntity < Grape::Entity class IssuableEntity < Grape::Entity
expose :id, :iid expose :id, :iid
expose(:project_id) { |entity| entity&.project.try(:id) } expose(:project_id) { |entity| entity&.project.try(:id) }
expose :title, :description expose :title, :description
...@@ -564,7 +564,7 @@ module API ...@@ -564,7 +564,7 @@ module API
end end
end end
class IssueBasic < ProjectEntity class IssueBasic < IssuableEntity
expose :closed_at expose :closed_at
expose :closed_by, using: Entities::UserBasic expose :closed_by, using: Entities::UserBasic
...@@ -670,14 +670,14 @@ module API ...@@ -670,14 +670,14 @@ module API
end end
end end
class MergeRequestSimple < ProjectEntity class MergeRequestSimple < IssuableEntity
expose :title expose :title
expose :web_url do |merge_request, options| expose :web_url do |merge_request, options|
Gitlab::UrlBuilder.build(merge_request) Gitlab::UrlBuilder.build(merge_request)
end end
end end
class MergeRequestBasic < ProjectEntity class MergeRequestBasic < IssuableEntity
expose :merged_by, using: Entities::UserBasic do |merge_request, _options| expose :merged_by, using: Entities::UserBasic do |merge_request, _options|
merge_request.metrics&.merged_by merge_request.metrics&.merged_by
end end
......
...@@ -28,7 +28,7 @@ module API ...@@ -28,7 +28,7 @@ module API
desc 'Import a GitHub project' do desc 'Import a GitHub project' do
detail 'This feature was introduced in GitLab 11.3.4.' detail 'This feature was introduced in GitLab 11.3.4.'
success Entities::ProjectEntity success ::ProjectEntity
end end
params do params do
requires :personal_access_token, type: String, desc: 'GitHub personal access token' requires :personal_access_token, type: String, desc: 'GitHub personal access token'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment