summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorEva Kadlecová <evka.kadl@gmail.com>2018-08-26 17:57:51 +0200
committerEva Kadlecová <evka.kadl@gmail.com>2018-09-17 14:04:16 +0200
commit4899dfcafe55ca2935d699f85c13fc35a8e16545 (patch)
tree3f768fdd885c2f2535d964c38c46649ef84f77db /app
parent120ce02e5e7e72654cb42edddc25ff3b057ec136 (diff)
downloadgitlab-ce-4899dfcafe55ca2935d699f85c13fc35a8e16545.tar.gz
Redirect to the pipeline builds page when a build is canceled
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/jobs_controller.rb8
-rw-r--r--app/views/projects/ci/builds/_build.html.haml2
2 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index e69faae754a..009d8afd523 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -1,5 +1,6 @@
class Projects::JobsController < Projects::ApplicationController
include SendFileUpload
+ include ContinueParams
before_action :build, except: [:index, :cancel_all]
before_action :authorize_read_build!
@@ -101,7 +102,12 @@ class Projects::JobsController < Projects::ApplicationController
return respond_422 unless @build.cancelable?
@build.cancel
- redirect_to build_path(@build)
+
+ if continue_params
+ redirect_to continue_params[:to]
+ else
+ redirect_to builds_project_pipeline_path(@project, @build.pipeline.id)
+ end
end
def status
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 44c1453e239..44446f15ddc 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -99,7 +99,7 @@
= sprite_icon('download')
- if can?(current_user, :update_build, job)
- if job.active?
- = link_to cancel_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: 'Cancel', class: 'btn btn-build' do
+ = link_to cancel_project_job_path(job.project, job, continue: { to: request.fullpath }), method: :post, title: 'Cancel', class: 'btn btn-build' do
= icon('remove', class: 'cred')
- elsif allow_retry
- if job.playable? && !admin && can?(current_user, :update_build, job)