Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Azzopardi <steveazz@outlook.com>2018-10-31 11:44:22 +0300
committerSteve Azzopardi <steveazz@outlook.com>2018-10-31 18:57:46 +0300
commit8f36f1cad215ac1bc37bd203f69bc0c56847e85b (patch)
tree125da34468e0d7875b6c05fb54e07f337d300b04 /app/serializers
parent98a504ecbb45907517ae465018906af7ef4573de (diff)
Send continue parameter on for cancel_path
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21595 `ContinueParams` was introducted in the `Projects::JobController#cancel` since `continue` parameter is not present for in `cancel_path` for `Projects::JobController#show.sjon` the user is being redirect to the pipeline page, where it should be redirected to the current job page instead. Add the `continue` parameter as a query string for `cancel_path`.
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/job_entity.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/app/serializers/job_entity.rb b/app/serializers/job_entity.rb
index 0b19cb16955..a0a66511b7b 100644
--- a/app/serializers/job_entity.rb
+++ b/app/serializers/job_entity.rb
@@ -9,7 +9,7 @@ class JobEntity < Grape::Entity
expose :started?, as: :started
expose :build_path do |build|
- build.target_url || path_to(:namespace_project_job, build)
+ build_path(build)
end
expose :retry_path, if: -> (*) { retryable? } do |build|
@@ -17,7 +17,11 @@ class JobEntity < Grape::Entity
end
expose :cancel_path, if: -> (*) { cancelable? } do |build|
- path_to(:cancel_namespace_project_job, build)
+ path_to(
+ :cancel_namespace_project_job,
+ build,
+ { continue: { to: build_path(build) } }
+ )
end
expose :play_path, if: -> (*) { playable? } do |build|
@@ -60,8 +64,12 @@ class JobEntity < Grape::Entity
build.detailed_status(request.current_user)
end
- def path_to(route, build)
- send("#{route}_path", build.project.namespace, build.project, build) # rubocop:disable GitlabSecurity/PublicSend
+ def path_to(route, build, params = {})
+ send("#{route}_path", build.project.namespace, build.project, build, params) # rubocop:disable GitlabSecurity/PublicSend
+ end
+
+ def build_path(build)
+ build.target_url || path_to(:namespace_project_job, build)
end
def failed?