diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-10-19 16:14:46 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-10-19 16:14:46 +0000 |
commit | d927336403a92d340d7e5b2d2328c5a0e029d666 (patch) | |
tree | 53089a4875c6a3599e246fe182305a5d4a186a24 /app/controllers/projects | |
parent | 85fba09b67c88e50d1567f6452673a5144a68433 (diff) | |
parent | 72d84e48511fcf88b1d9efb622eb37cdff95aa1c (diff) | |
download | gitlab-ce-d927336403a92d340d7e5b2d2328c5a0e029d666.tar.gz |
Merge branch '21444-pipeliens-new-mr' into 'master'
Add pipelines tab to new MR
#### What does this MR do?
Adds pipelines tab to new MRs
#### Screenshots (if relevant)
![Screen_Shot_2016-10-10_at_10.23.27_AM](/uploads/6c3f8f2be0cf9ba7cc78f6d918307ec0/Screen_Shot_2016-10-10_at_10.23.27_AM.png)
![Screen_Shot_2016-10-11_at_8.59.45_AM](/uploads/e67577d92327eafef6f04073f3d94212/Screen_Shot_2016-10-11_at_8.59.45_AM.png)
#### What are the relevant issue numbers?
Closes #21444
See merge request !6238
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 88e21b5886d..04386258c19 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -489,13 +489,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController @noteable = @merge_request @commits_count = @merge_request.commits.count - @pipeline = @merge_request.pipeline - @statuses = @pipeline.statuses.relevant if @pipeline - if @merge_request.locked_long_ago? @merge_request.unlock_mr @merge_request.close end + + define_pipelines_vars end # Discussion tab data is rendered on html responses of actions @@ -523,7 +522,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController def define_widget_vars @pipeline = @merge_request.pipeline - @pipelines = [@pipeline].compact end def define_commit_vars @@ -550,6 +548,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController ) end + def define_pipelines_vars + @pipelines = @merge_request.all_pipelines + + if @pipelines.any? + @pipeline = @pipelines.first + @statuses = @pipeline.statuses.relevant + end + end + def define_new_vars @noteable = @merge_request @@ -565,10 +572,10 @@ 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 @note_counts = Note.where(commit_id: @commits.map(&:id)). group(:commit_id).count + + define_pipelines_vars end def invalid_mr |