diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-17 12:55:18 +0200 |
---|---|---|
committer | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2016-10-18 08:32:17 -0500 |
commit | db0e700d2ff9a372a8bd903faf305c0debd9b372 (patch) | |
tree | cbb2d10d7cfcfb76818a7f1a7723b3f5c4339991 | |
parent | 27c762b8db3e2b6896ef88ea1a078745ae33909d (diff) | |
download | gitlab-ce-db0e700d2ff9a372a8bd903faf305c0debd9b372.tar.gz |
Use all pipelines variable when creating merge request
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 4 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_new_submit.html.haml | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index cfa463b6452..bce89d0a9ad 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -558,8 +558,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController @commit = @merge_request.diff_head_commit @base_commit = @merge_request.diff_base_commit - @pipeline = @merge_request.pipeline - @statuses = @pipeline.statuses.relevant if @pipeline + @pipelines = @merge_request.all_pipelines + @statuses = @pipelines.first.statuses.relevant if @pipelines.any? @note_counts = Note.where(commit_id: @commits.map(&:id)). group(:commit_id).count end diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index bfe461e6943..9c6f562f7db 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -29,11 +29,11 @@ = link_to url_for(params), data: {target: 'div#commits', action: 'new', toggle: 'tab'} do Commits %span.badge= @commits.size - - if @pipeline + - if @pipelines.any? %li.builds-tab = link_to url_for(params), data: {target: 'div#pipelines', action: 'pipelines', toggle: 'tab'} do Pipelines - %span.badge= @statuses.size + %span.badge= @pipelines.size %li.builds-tab = link_to url_for(params), data: {target: 'div#builds', action: 'builds', toggle: 'tab'} do Builds @@ -48,7 +48,7 @@ = render "projects/merge_requests/show/commits" #diffs.diffs.tab-pane - # This tab is always loaded via AJAX - - if @pipeline + - if @pipelines.any? #builds.builds.tab-pane = render "projects/merge_requests/show/builds" #pipelines.pipelines.tab-pane @@ -65,5 +65,5 @@ :javascript var merge_request = new MergeRequest({ action: "#{(@show_changes_tab ? 'new/diffs' : 'new')}", - buildsLoaded: "#{@pipeline ? 'true' : 'false'}" + buildsLoaded: "#{@pipelines.any? ? 'true' : 'false'}" }); |