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
10ca48ad
Commit
10ca48ad
authored
Jan 27, 2020
by
Rajendra Kadam
Committed by
Stan Hu
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate project hook, indentity, export status and shared goup classes from entities
parent
cb346d35
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
46 deletions
+76
-46
changelogs/unreleased/refactoring-entities-file-4.yml
changelogs/unreleased/refactoring-entities-file-4.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+0
-46
lib/api/entities/hook.rb
lib/api/entities/hook.rb
+10
-0
lib/api/entities/project_export_status.rb
lib/api/entities/project_export_status.rb
+20
-0
lib/api/entities/project_hook.rb
lib/api/entities/project_hook.rb
+12
-0
lib/api/entities/project_identity.rb
lib/api/entities/project_identity.rb
+12
-0
lib/api/entities/shared_group.rb
lib/api/entities/shared_group.rb
+17
-0
No files found.
changelogs/unreleased/refactoring-entities-file-4.yml
0 → 100644
View file @
10ca48ad
---
title
:
Add separate classes for project hook, identity, export status
merge_request
:
23789
author
:
Rajendra Kadam
type
:
added
lib/api/entities.rb
View file @
10ca48ad
...
@@ -2,52 +2,6 @@
...
@@ -2,52 +2,6 @@
module
API
module
API
module
Entities
module
Entities
class
Hook
<
Grape
::
Entity
expose
:id
,
:url
,
:created_at
,
:push_events
,
:tag_push_events
,
:merge_requests_events
,
:repository_update_events
expose
:enable_ssl_verification
end
class
ProjectHook
<
Hook
expose
:project_id
,
:issues_events
,
:confidential_issues_events
expose
:note_events
,
:confidential_note_events
,
:pipeline_events
,
:wiki_page_events
expose
:job_events
expose
:push_events_branch_filter
end
class
SharedGroup
<
Grape
::
Entity
expose
:group_id
expose
:group_name
do
|
group_link
,
options
|
group_link
.
group
.
name
end
expose
:group_full_path
do
|
group_link
,
options
|
group_link
.
group
.
full_path
end
expose
:group_access
,
as: :group_access_level
expose
:expires_at
end
class
ProjectIdentity
<
Grape
::
Entity
expose
:id
,
:description
expose
:name
,
:name_with_namespace
expose
:path
,
:path_with_namespace
expose
:created_at
end
class
ProjectExportStatus
<
ProjectIdentity
include
::
API
::
Helpers
::
RelatedResourcesHelpers
expose
:export_status
expose
:_links
,
if:
lambda
{
|
project
,
_options
|
project
.
export_status
==
:finished
}
do
expose
:api_url
do
|
project
|
expose_url
(
api_v4_projects_export_download_path
(
id:
project
.
id
))
end
expose
:web_url
do
|
project
|
Gitlab
::
Routing
.
url_helpers
.
download_export_project_url
(
project
)
end
end
end
class
RemoteMirror
<
Grape
::
Entity
class
RemoteMirror
<
Grape
::
Entity
expose
:id
expose
:id
expose
:enabled
expose
:enabled
...
...
lib/api/entities/hook.rb
0 → 100644
View file @
10ca48ad
# frozen_string_literal: true
module
API
module
Entities
class
Hook
<
Grape
::
Entity
expose
:id
,
:url
,
:created_at
,
:push_events
,
:tag_push_events
,
:merge_requests_events
,
:repository_update_events
expose
:enable_ssl_verification
end
end
end
lib/api/entities/project_export_status.rb
0 → 100644
View file @
10ca48ad
# frozen_string_literal: true
module
API
module
Entities
class
ProjectExportStatus
<
ProjectIdentity
include
::
API
::
Helpers
::
RelatedResourcesHelpers
expose
:export_status
expose
:_links
,
if:
lambda
{
|
project
,
_options
|
project
.
export_status
==
:finished
}
do
expose
:api_url
do
|
project
|
expose_url
(
api_v4_projects_export_download_path
(
id:
project
.
id
))
end
expose
:web_url
do
|
project
|
Gitlab
::
Routing
.
url_helpers
.
download_export_project_url
(
project
)
end
end
end
end
end
lib/api/entities/project_hook.rb
0 → 100644
View file @
10ca48ad
# frozen_string_literal: true
module
API
module
Entities
class
ProjectHook
<
Hook
expose
:project_id
,
:issues_events
,
:confidential_issues_events
expose
:note_events
,
:confidential_note_events
,
:pipeline_events
,
:wiki_page_events
expose
:job_events
expose
:push_events_branch_filter
end
end
end
lib/api/entities/project_identity.rb
0 → 100644
View file @
10ca48ad
# frozen_string_literal: true
module
API
module
Entities
class
ProjectIdentity
<
Grape
::
Entity
expose
:id
,
:description
expose
:name
,
:name_with_namespace
expose
:path
,
:path_with_namespace
expose
:created_at
end
end
end
lib/api/entities/shared_group.rb
0 → 100644
View file @
10ca48ad
# frozen_string_literal: true
module
API
module
Entities
class
SharedGroup
<
Grape
::
Entity
expose
:group_id
expose
:group_name
do
|
group_link
,
options
|
group_link
.
group
.
name
end
expose
:group_full_path
do
|
group_link
,
options
|
group_link
.
group
.
full_path
end
expose
:group_access
,
as: :group_access_level
expose
:expires_at
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