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
63589d9a
Commit
63589d9a
authored
Feb 13, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DRY up pipeline entity representation
parent
a0faf81d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
ee/app/serializers/dashboard_operations_project_entity.rb
ee/app/serializers/dashboard_operations_project_entity.rb
+10
-6
No files found.
ee/app/serializers/dashboard_operations_project_entity.rb
View file @
63589d9a
...
...
@@ -9,16 +9,16 @@ class DashboardOperationsProjectEntity < Grape::Entity
remove_operations_project_path
(
project_id:
dashboard_project
.
project
.
id
)
end
expose
:last_pipeline
,
if:
->
(
*
)
{
last_pipeline
}
do
|
dashboard_project
,
options
|
PipelineEntity
.
represent
(
last_pipeline
,
options
.
merge
(
request:
new_request
)
)
expose
:last_pipeline
,
if:
->
(
*
)
{
last_pipeline
}
do
|
_
,
options
|
pipeline_entity_for
(
last_pipeline
,
options
)
end
expose
:upstream_pipeline
,
if:
->
(
*
)
{
upstream_pipeline
}
do
|
dashboard_project
,
options
|
PipelineEntity
.
represent
(
upstream_pipeline
,
options
.
merge
(
request:
new_request
)
)
expose
:upstream_pipeline
,
if:
->
(
*
)
{
upstream_pipeline
}
do
|
_
,
options
|
pipeline_entity_for
(
upstream_pipeline
,
options
)
end
expose
:downstream_pipelines
,
if:
->
(
*
)
{
downstream_pipelines
}
do
|
dashboard_project
,
options
|
PipelineEntity
.
represent
(
downstream_pipelines
,
options
.
merge
(
request:
new_request
)
)
expose
:downstream_pipelines
,
if:
->
(
*
)
{
downstream_pipelines
}
do
|
_
,
options
|
pipeline_entity_for
(
downstream_pipelines
,
options
)
end
expose
:last_deployment
,
if:
->
(
*
)
{
last_deployment?
}
do
|
dashboard_project
,
options
|
...
...
@@ -58,6 +58,10 @@ class DashboardOperationsProjectEntity < Grape::Entity
last_pipeline
&
.
sourced_pipelines
&
.
map
(
&
:source_pipeline
)
end
def
pipeline_entity_for
(
objects
,
options
)
PipelineEntity
.
represent
(
objects
,
options
.
merge
(
request:
new_request
))
end
def
last_deployment?
dashboard_project
.
last_deployment
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