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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
551f8c4b
Commit
551f8c4b
authored
Apr 23, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proper stage.json data
parent
e0b7541b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+3
-3
app/serializers/stage_details_entity.rb
app/serializers/stage_details_entity.rb
+21
-0
app/serializers/stage_serializer.rb
app/serializers/stage_serializer.rb
+7
-0
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
551f8c4b
...
@@ -104,9 +104,9 @@ class Projects::PipelinesController < Projects::ApplicationController
...
@@ -104,9 +104,9 @@ class Projects::PipelinesController < Projects::ApplicationController
@stage
=
pipeline
.
legacy_stage
(
params
[
:stage
])
@stage
=
pipeline
.
legacy_stage
(
params
[
:stage
])
return
not_found
unless
@stage
return
not_found
unless
@stage
re
spond_to
do
|
format
|
re
nder
json:
StageSerializer
format
.
json
{
render
json:
{
html:
view_to_html_string
(
'projects/pipelines/_stage'
)
}
}
.
new
(
project:
@project
,
current_user:
@current_user
)
end
.
represent
(
@pipeline
)
end
end
def
retry
def
retry
...
...
app/serializers/stage_details_entity.rb
0 → 100644
View file @
551f8c4b
class
StageDetailsEntity
<
Grape
::
Entity
include
RequestAwareEntity
expose
:name
expose
:title
do
|
stage
|
"
#{
stage
.
name
}
:
#{
detailed_status
.
label
}
"
end
expose
:statuses
,
with:
JobEntity
expose
:detailed_status
,
as: :status
,
with:
StatusEntity
private
alias_method
:stage
,
:object
def
detailed_status
stage
.
detailed_status
(
request
.
current_user
)
end
end
app/serializers/stage_serializer.rb
0 → 100644
View file @
551f8c4b
class
StageSerializer
<
BaseSerializer
include
WithPagination
InvalidResourceError
=
Class
.
new
(
StandardError
)
entity
StageDetailsEntity
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