Commit db0e700d authored by Grzegorz Bizon's avatar Grzegorz Bizon Committed by Annabel Dunstone Gray

Use all pipelines variable when creating merge request

parent 27c762b8
......@@ -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
......
......@@ -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'}"
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment