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
1a18b430
Commit
1a18b430
authored
Jan 26, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
bbda97dd
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
45 deletions
+75
-45
changelogs/unreleased/refactoring-entities-file.yml
changelogs/unreleased/refactoring-entities-file.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+0
-45
lib/api/entities/blame_range.rb
lib/api/entities/blame_range.rb
+10
-0
lib/api/entities/blame_range_commit.rb
lib/api/entities/blame_range_commit.rb
+13
-0
lib/api/entities/wiki_attachment.rb
lib/api/entities/wiki_attachment.rb
+27
-0
lib/api/entities/wiki_page.rb
lib/api/entities/wiki_page.rb
+9
-0
lib/api/entities/wiki_page_basic.rb
lib/api/entities/wiki_page_basic.rb
+11
-0
No files found.
changelogs/unreleased/refactoring-entities-file.yml
0 → 100644
View file @
1a18b430
---
title
:
Seprate 5 classes in separate files from entities
merge_request
:
23299
author
:
Rajendra Kadam
type
:
added
lib/api/entities.rb
View file @
1a18b430
...
...
@@ -11,51 +11,6 @@ module API
expose
:access_level
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
expose
:id
,
:name
,
:username
end
...
...
lib/api/entities/blame_range.rb
0 → 100644
View file @
1a18b430
# frozen_string_literal: true
module
API
module
Entities
class
BlameRange
<
Grape
::
Entity
expose
:commit
,
using:
BlameRangeCommit
expose
:lines
end
end
end
lib/api/entities/blame_range_commit.rb
0 → 100644
View file @
1a18b430
# 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
lib/api/entities/wiki_attachment.rb
0 → 100644
View file @
1a18b430
# 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
lib/api/entities/wiki_page.rb
0 → 100644
View file @
1a18b430
# frozen_string_literal: true
module
API
module
Entities
class
WikiPage
<
WikiPageBasic
expose
:content
end
end
end
lib/api/entities/wiki_page_basic.rb
0 → 100644
View file @
1a18b430
# frozen_string_literal: true
module
API
module
Entities
class
WikiPageBasic
<
Grape
::
Entity
expose
:format
expose
:slug
expose
:title
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