Commit a35bf584 authored by Peter Leitzen's avatar Peter Leitzen

Move tracing setting into a helper

parent 912eb035
...@@ -7,7 +7,6 @@ module Projects ...@@ -7,7 +7,6 @@ module Projects
before_action :authorize_update_environment! before_action :authorize_update_environment!
def show def show
@tracing_settings ||= ProjectTracingSetting.for_project(@project)
end end
def update def update
...@@ -25,6 +24,12 @@ module Projects ...@@ -25,6 +24,12 @@ module Projects
private private
helper_method :tracing_setting
def tracing_setting
@tracing_setting ||= project.tracing_setting || project.build_tracing_setting
end
def render_result(result) def render_result(result)
respond_to do |format| respond_to do |format|
format.html do format.html do
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
- page_title _("Operations Settings") - page_title _("Operations Settings")
- page_title _("Operations") - page_title _("Operations")
- has_jaeger_url = @project.tracing_external_url.present? - setting = tracing_setting
- has_jaeger_url = setting.external_url.present?
%section %section
%h4 %h4
...@@ -18,8 +19,8 @@ ...@@ -18,8 +19,8 @@
%span %span
= _('Tracing') = _('Tracing')
= _("To open Jaeger and easily view tracing from GitLab, link the %{link} page to your server").html_safe % { link: tracing_link } = _("To open Jaeger and easily view tracing from GitLab, link the %{link} page to your server").html_safe % { link: tracing_link }
= form_for @tracing_settings, as: :tracing_settings, url: project_settings_operations_path(@project) do |f| = form_for setting, as: :tracing_settings, url: project_settings_operations_path(@project) do |f|
= form_errors(@tracing_settings) = form_errors(setting)
.form-group .form-group
= f.label :external_url, _('Jaeger URL'), class: 'label-bold' = f.label :external_url, _('Jaeger URL'), class: 'label-bold'
= f.url_field :external_url, class: 'form-control', placeholder: 'e.g. https://jaeger.mycompany.com' = f.url_field :external_url, class: 'form-control', placeholder: 'e.g. https://jaeger.mycompany.com'
......
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