diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-02-08 00:21:30 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-02-08 00:21:30 +0300 |
commit | 71c80375474e0bda201de07870587b0bb8553069 (patch) | |
tree | 1b4aa9316ba709a534f06522d8224d78fd38ccf0 /app | |
parent | 9aafb2a6d3c1b2588ef0689d6919014150123e64 (diff) | |
parent | d410c937a509c46cd1de807937b8d74bf383070c (diff) |
Merge branch 'fix/gb/invalid-new-merge-request-api' into 'master'
Fix rendering pipelines for a new merge request
See merge request !9032
Diffstat (limited to 'app')
3 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 3be6e8e1772..fbad66c5c40 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -229,9 +229,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController respond_to do |format| format.html { define_new_vars } format.json do - render json: { pipelines: PipelineSerializer + define_pipelines_vars + + render json: PipelineSerializer .new(project: @project, user: @current_user) - .represent(@pipelines) } + .represent(@pipelines) end end end diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 38259faf62f..bd72310c16b 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -46,7 +46,7 @@ -# This tab is always loaded via AJAX - if @pipelines.any? #pipelines.pipelines.tab-pane - = render "projects/merge_requests/show/pipelines", endpoint: link_to(url_for(params)) + = render 'projects/merge_requests/show/pipelines', endpoint: url_for(params.merge(format: :json)) .mr-loading-status = spinner diff --git a/app/views/projects/merge_requests/show/_pipelines.html.haml b/app/views/projects/merge_requests/show/_pipelines.html.haml index cbe534abedb..de4aa255bbd 100644 --- a/app/views/projects/merge_requests/show/_pipelines.html.haml +++ b/app/views/projects/merge_requests/show/_pipelines.html.haml @@ -1 +1,3 @@ -= render 'projects/commit/pipelines_list', endpoint: pipelines_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) +- endpoint_path = local_assigns[:endpoint] || pipelines_namespace_project_merge_request_path(@project.namespace, @project, @merge_request, format: :json) + += render 'projects/commit/pipelines_list', endpoint: endpoint_path |