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 ...@@ -558,8 +558,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@commit = @merge_request.diff_head_commit @commit = @merge_request.diff_head_commit
@base_commit = @merge_request.diff_base_commit @base_commit = @merge_request.diff_base_commit
@pipeline = @merge_request.pipeline @pipelines = @merge_request.all_pipelines
@statuses = @pipeline.statuses.relevant if @pipeline @statuses = @pipelines.first.statuses.relevant if @pipelines.any?
@note_counts = Note.where(commit_id: @commits.map(&:id)). @note_counts = Note.where(commit_id: @commits.map(&:id)).
group(:commit_id).count group(:commit_id).count
end end
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
= link_to url_for(params), data: {target: 'div#commits', action: 'new', toggle: 'tab'} do = link_to url_for(params), data: {target: 'div#commits', action: 'new', toggle: 'tab'} do
Commits Commits
%span.badge= @commits.size %span.badge= @commits.size
- if @pipeline - if @pipelines.any?
%li.builds-tab %li.builds-tab
= link_to url_for(params), data: {target: 'div#pipelines', action: 'pipelines', toggle: 'tab'} do = link_to url_for(params), data: {target: 'div#pipelines', action: 'pipelines', toggle: 'tab'} do
Pipelines Pipelines
%span.badge= @statuses.size %span.badge= @pipelines.size
%li.builds-tab %li.builds-tab
= link_to url_for(params), data: {target: 'div#builds', action: 'builds', toggle: 'tab'} do = link_to url_for(params), data: {target: 'div#builds', action: 'builds', toggle: 'tab'} do
Builds Builds
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
= render "projects/merge_requests/show/commits" = render "projects/merge_requests/show/commits"
#diffs.diffs.tab-pane #diffs.diffs.tab-pane
- # This tab is always loaded via AJAX - # This tab is always loaded via AJAX
- if @pipeline - if @pipelines.any?
#builds.builds.tab-pane #builds.builds.tab-pane
= render "projects/merge_requests/show/builds" = render "projects/merge_requests/show/builds"
#pipelines.pipelines.tab-pane #pipelines.pipelines.tab-pane
...@@ -65,5 +65,5 @@ ...@@ -65,5 +65,5 @@
:javascript :javascript
var merge_request = new MergeRequest({ var merge_request = new MergeRequest({
action: "#{(@show_changes_tab ? 'new/diffs' : 'new')}", 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