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
670e88be
Commit
670e88be
authored
Jan 27, 2020
by
Rajendra Kadam
Committed by
Stan Hu
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring entities file 3
parent
e930a6d3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
25 deletions
+50
-25
changelogs/unreleased/refactoring-entities-file-3.yml
changelogs/unreleased/refactoring-entities-file-3.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+0
-25
lib/api/entities/email.rb
lib/api/entities/email.rb
+9
-0
lib/api/entities/identity.rb
lib/api/entities/identity.rb
+9
-0
lib/api/entities/membership.rb
lib/api/entities/membership.rb
+14
-0
lib/api/entities/user_status.rb
lib/api/entities/user_status.rb
+13
-0
No files found.
changelogs/unreleased/refactoring-entities-file-3.yml
0 → 100644
View file @
670e88be
---
title
:
Add separate classes for user related entities for email, membership, status
merge_request
:
23748
author
:
Rajendra Kadam
type
:
added
lib/api/entities.rb
View file @
670e88be
...
...
@@ -2,31 +2,6 @@
module
API
module
Entities
class
Membership
<
Grape
::
Entity
expose
:source_id
expose
:source_name
do
|
member
|
member
.
source
.
name
end
expose
:source_type
expose
:access_level
end
class
Identity
<
Grape
::
Entity
expose
:provider
,
:extern_uid
end
class
UserStatus
<
Grape
::
Entity
expose
:emoji
expose
:message
expose
:message_html
do
|
entity
|
MarkupHelper
.
markdown_field
(
entity
,
:message
)
end
end
class
Email
<
Grape
::
Entity
expose
:id
,
:email
end
class
Hook
<
Grape
::
Entity
expose
:id
,
:url
,
:created_at
,
:push_events
,
:tag_push_events
,
:merge_requests_events
,
:repository_update_events
expose
:enable_ssl_verification
...
...
lib/api/entities/email.rb
0 → 100644
View file @
670e88be
# frozen_string_literal: true
module
API
module
Entities
class
Email
<
Grape
::
Entity
expose
:id
,
:email
end
end
end
lib/api/entities/identity.rb
0 → 100644
View file @
670e88be
# frozen_string_literal: true
module
API
module
Entities
class
Identity
<
Grape
::
Entity
expose
:provider
,
:extern_uid
end
end
end
lib/api/entities/membership.rb
0 → 100644
View file @
670e88be
# frozen_string_literal: true
module
API
module
Entities
class
Membership
<
Grape
::
Entity
expose
:source_id
expose
:source_name
do
|
member
|
member
.
source
.
name
end
expose
:source_type
expose
:access_level
end
end
end
lib/api/entities/user_status.rb
0 → 100644
View file @
670e88be
# frozen_string_literal: true
module
API
module
Entities
class
UserStatus
<
Grape
::
Entity
expose
:emoji
expose
:message
expose
:message_html
do
|
entity
|
MarkupHelper
.
markdown_field
(
entity
,
:message
)
end
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