summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-09-02 02:37:11 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-04 21:55:26 +0900
commit3ae2038176b27673b06a040873fdbe19c94d67d3 (patch)
treeb06366ef67123713f55e462f9dd57e5a12c60c48 /app
parentd614c431055286eaab3b82e810186ac19a2c4fd7 (diff)
downloadgitlab-ce-3ae2038176b27673b06a040873fdbe19c94d67d3.tar.gz
Remove ci_trigger_request_with_variables
Diffstat (limited to 'app')
-rw-r--r--app/presenters/ci/build_presenter.rb11
-rw-r--r--app/views/projects/jobs/_sidebar.html.haml4
2 files changed, 13 insertions, 2 deletions
diff --git a/app/presenters/ci/build_presenter.rb b/app/presenters/ci/build_presenter.rb
index c495c3f39bb..531ccd39cf2 100644
--- a/app/presenters/ci/build_presenter.rb
+++ b/app/presenters/ci/build_presenter.rb
@@ -17,5 +17,16 @@ module Ci
"Job is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}"
end
end
+
+ def old_or_new_trigger_variables
+ return @old_or_new_trigger_variables if defined?(@old_or_new_trigger_variables)
+
+ if build.pipeline.variables.any?
+ @old_or_new_trigger_variables =
+ build.pipeline.variables&.map { |v| { v.key => v.value } } &.reduce({}, :merge)
+ else
+ @old_or_new_trigger_variables = build.trigger_request.variables
+ end
+ end
end
end
diff --git a/app/views/projects/jobs/_sidebar.html.haml b/app/views/projects/jobs/_sidebar.html.haml
index f5d5bc7eda9..f22de357e5f 100644
--- a/app/views/projects/jobs/_sidebar.html.haml
+++ b/app/views/projects/jobs/_sidebar.html.haml
@@ -46,12 +46,12 @@
%span.build-light-text Token:
#{@build.trigger_request.trigger.short_token}
- - if @build.trigger_request.variables
+ - if @build.old_or_new_trigger_variables
%p
%button.btn.group.btn-group-justified.reveal-variables Reveal Variables
%dl.js-build-variables.trigger-build-variables.hide
- - @build.trigger_request.variables.each do |key, value|
+ - @build.old_or_new_trigger_variables.each do |key, value|
%dt.js-build-variable.trigger-build-variable= key
%dd.js-build-value.trigger-build-value= value