diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-05-07 11:32:45 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-05-07 11:32:45 +0300 |
commit | d840535c3308b66dbd0f6d030af665ffb06edcd4 (patch) | |
tree | 98c0c634028fbf09bc01308f2e6bf485e021ddd2 /app/controllers/projects/pipelines_controller.rb | |
parent | 67c9f822dd60ef55323082cd0b17ccd6108a24c6 (diff) | |
parent | 7dabb22f22cee04113d45d56ed3fc06cd1ad93ea (diff) |
Merge branch '33697-pipelines-json-endpoint' into 'master'
Resolve "CI retry/cancel job or pipeline redirect the user and can't be open in a new tab"
Closes #33697
See merge request gitlab-org/gitlab-ce!18451
Diffstat (limited to 'app/controllers/projects/pipelines_controller.rb')
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 1ee273091d4..898e88344db 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -104,9 +104,18 @@ class Projects::PipelinesController < Projects::ApplicationController @stage = pipeline.legacy_stage(params[:stage]) return not_found unless @stage - respond_to do |format| - format.json { render json: { html: view_to_html_string('projects/pipelines/_stage') } } - end + render json: StageSerializer + .new(project: @project, current_user: @current_user) + .represent(@stage, details: true) + end + + # TODO: This endpoint is used by mini-pipeline-graph + # TODO: This endpoint should be migrated to `stage.json` + def stage_ajax + @stage = pipeline.legacy_stage(params[:stage]) + return not_found unless @stage + + render json: { html: view_to_html_string('projects/pipelines/_stage') } end def retry |