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
43995dea
Commit
43995dea
authored
Feb 09, 2020
by
Rajendra Kadam
Committed by
Stan Hu
Feb 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate note entities into own class files
parent
25bfc88e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
34 deletions
+64
-34
changelogs/unreleased/refactoring-entities-file-13.yml
changelogs/unreleased/refactoring-entities-file-13.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+0
-34
lib/api/entities/avatar.rb
lib/api/entities/avatar.rb
+11
-0
lib/api/entities/award_emoji.rb
lib/api/entities/award_emoji.rb
+13
-0
lib/api/entities/commit_note.rb
lib/api/entities/commit_note.rb
+14
-0
lib/api/entities/commit_status.rb
lib/api/entities/commit_status.rb
+11
-0
lib/api/entities/mr_note.rb
lib/api/entities/mr_note.rb
+10
-0
No files found.
changelogs/unreleased/refactoring-entities-file-13.yml
0 → 100644
View file @
43995dea
---
title
:
Separate note entities into own class files
merge_request
:
24732
author
:
Rajendra Kadam
type
:
added
lib/api/entities.rb
View file @
43995dea
...
...
@@ -129,40 +129,6 @@ module API
end
end
class
Avatar
<
Grape
::
Entity
expose
:avatar_url
do
|
avatarable
,
options
|
avatarable
.
avatar_url
(
only_path:
false
,
size:
options
[
:size
])
end
end
class
AwardEmoji
<
Grape
::
Entity
expose
:id
expose
:name
expose
:user
,
using:
Entities
::
UserBasic
expose
:created_at
,
:updated_at
expose
:awardable_id
,
:awardable_type
end
class
MRNote
<
Grape
::
Entity
expose
:note
expose
:author
,
using:
Entities
::
UserBasic
end
class
CommitNote
<
Grape
::
Entity
expose
:note
expose
(
:path
)
{
|
note
|
note
.
diff_file
.
try
(
:file_path
)
if
note
.
diff_note?
}
expose
(
:line
)
{
|
note
|
note
.
diff_line
.
try
(
:new_line
)
if
note
.
diff_note?
}
expose
(
:line_type
)
{
|
note
|
note
.
diff_line
.
try
(
:type
)
if
note
.
diff_note?
}
expose
:author
,
using:
Entities
::
UserBasic
expose
:created_at
end
class
CommitStatus
<
Grape
::
Entity
expose
:id
,
:sha
,
:ref
,
:status
,
:name
,
:target_url
,
:description
,
:created_at
,
:started_at
,
:finished_at
,
:allow_failure
,
:coverage
expose
:author
,
using:
Entities
::
UserBasic
end
class
PushEventPayload
<
Grape
::
Entity
expose
:commit_count
,
:action
,
:ref_type
,
:commit_from
,
:commit_to
,
:ref
,
:commit_title
,
:ref_count
...
...
lib/api/entities/avatar.rb
0 → 100644
View file @
43995dea
# frozen_string_literal: true
module
API
module
Entities
class
Avatar
<
Grape
::
Entity
expose
:avatar_url
do
|
avatarable
,
options
|
avatarable
.
avatar_url
(
only_path:
false
,
size:
options
[
:size
])
end
end
end
end
lib/api/entities/award_emoji.rb
0 → 100644
View file @
43995dea
# frozen_string_literal: true
module
API
module
Entities
class
AwardEmoji
<
Grape
::
Entity
expose
:id
expose
:name
expose
:user
,
using:
Entities
::
UserBasic
expose
:created_at
,
:updated_at
expose
:awardable_id
,
:awardable_type
end
end
end
lib/api/entities/commit_note.rb
0 → 100644
View file @
43995dea
# frozen_string_literal: true
module
API
module
Entities
class
CommitNote
<
Grape
::
Entity
expose
:note
expose
(
:path
)
{
|
note
|
note
.
diff_file
.
try
(
:file_path
)
if
note
.
diff_note?
}
expose
(
:line
)
{
|
note
|
note
.
diff_line
.
try
(
:new_line
)
if
note
.
diff_note?
}
expose
(
:line_type
)
{
|
note
|
note
.
diff_line
.
try
(
:type
)
if
note
.
diff_note?
}
expose
:author
,
using:
Entities
::
UserBasic
expose
:created_at
end
end
end
lib/api/entities/commit_status.rb
0 → 100644
View file @
43995dea
# frozen_string_literal: true
module
API
module
Entities
class
CommitStatus
<
Grape
::
Entity
expose
:id
,
:sha
,
:ref
,
:status
,
:name
,
:target_url
,
:description
,
:created_at
,
:started_at
,
:finished_at
,
:allow_failure
,
:coverage
expose
:author
,
using:
Entities
::
UserBasic
end
end
end
lib/api/entities/mr_note.rb
0 → 100644
View file @
43995dea
# frozen_string_literal: true
module
API
module
Entities
class
MRNote
<
Grape
::
Entity
expose
:note
expose
:author
,
using:
Entities
::
UserBasic
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