Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
bbda97dde4
commit
1a18b43089
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Seprate 5 classes in separate files from entities
|
||||||
|
merge_request: 23299
|
||||||
|
author: Rajendra Kadam
|
||||||
|
type: added
|
|
@ -11,51 +11,6 @@ module API
|
||||||
expose :access_level
|
expose :access_level
|
||||||
end
|
end
|
||||||
|
|
||||||
class BlameRangeCommit < Grape::Entity
|
|
||||||
expose :id
|
|
||||||
expose :parent_ids
|
|
||||||
expose :message
|
|
||||||
expose :authored_date, :author_name, :author_email
|
|
||||||
expose :committed_date, :committer_name, :committer_email
|
|
||||||
end
|
|
||||||
|
|
||||||
class BlameRange < Grape::Entity
|
|
||||||
expose :commit, using: BlameRangeCommit
|
|
||||||
expose :lines
|
|
||||||
end
|
|
||||||
|
|
||||||
class WikiPageBasic < Grape::Entity
|
|
||||||
expose :format
|
|
||||||
expose :slug
|
|
||||||
expose :title
|
|
||||||
end
|
|
||||||
|
|
||||||
class WikiPage < WikiPageBasic
|
|
||||||
expose :content
|
|
||||||
end
|
|
||||||
|
|
||||||
class WikiAttachment < Grape::Entity
|
|
||||||
include Gitlab::FileMarkdownLinkBuilder
|
|
||||||
|
|
||||||
expose :file_name
|
|
||||||
expose :file_path
|
|
||||||
expose :branch
|
|
||||||
expose :link do
|
|
||||||
expose :file_path, as: :url
|
|
||||||
expose :markdown do |_entity|
|
|
||||||
self.markdown_link
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def filename
|
|
||||||
object.file_name
|
|
||||||
end
|
|
||||||
|
|
||||||
def secure_url
|
|
||||||
object.file_path
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class UserSafe < Grape::Entity
|
class UserSafe < Grape::Entity
|
||||||
expose :id, :name, :username
|
expose :id, :name, :username
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module API
|
||||||
|
module Entities
|
||||||
|
class BlameRange < Grape::Entity
|
||||||
|
expose :commit, using: BlameRangeCommit
|
||||||
|
expose :lines
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module API
|
||||||
|
module Entities
|
||||||
|
class BlameRangeCommit < Grape::Entity
|
||||||
|
expose :id
|
||||||
|
expose :parent_ids
|
||||||
|
expose :message
|
||||||
|
expose :authored_date, :author_name, :author_email
|
||||||
|
expose :committed_date, :committer_name, :committer_email
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,27 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module API
|
||||||
|
module Entities
|
||||||
|
class WikiAttachment < Grape::Entity
|
||||||
|
include Gitlab::FileMarkdownLinkBuilder
|
||||||
|
|
||||||
|
expose :file_name
|
||||||
|
expose :file_path
|
||||||
|
expose :branch
|
||||||
|
expose :link do
|
||||||
|
expose :file_path, as: :url
|
||||||
|
expose :markdown do |_entity|
|
||||||
|
self.markdown_link
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def filename
|
||||||
|
object.file_name
|
||||||
|
end
|
||||||
|
|
||||||
|
def secure_url
|
||||||
|
object.file_path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module API
|
||||||
|
module Entities
|
||||||
|
class WikiPage < WikiPageBasic
|
||||||
|
expose :content
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,11 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module API
|
||||||
|
module Entities
|
||||||
|
class WikiPageBasic < Grape::Entity
|
||||||
|
expose :format
|
||||||
|
expose :slug
|
||||||
|
expose :title
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue