Fixed view to correct property

上级 cb4b2e31
......@@ -6,10 +6,4 @@ module SentryHelper
def sentry_context
Gitlab::Sentry.context(current_user)
end
def clientside_sentry_enabled?
current_application_settings.clientside_sentry_enabled
end
delegate :clientside_sentry_dsn, to: :current_application_settings
end
......@@ -422,9 +422,9 @@
%a{ href: 'https://sentry.io/for/javascript/', target: '_blank', rel: 'noopener noreferrer' } https://sentry.io/for/javascript/
.form-group
= f.label :sentry_dsn, 'Sentry DSN', class: 'control-label col-sm-2'
= f.label :clientside_sentry_dsn, 'Clientside Sentry DSN', class: 'control-label col-sm-2'
.col-sm-10
= f.text_field :sentry_dsn, class: 'form-control'
= f.text_field :clientside_sentry_dsn, class: 'form-control'
%fieldset
%legend Repository Storage
......
......@@ -33,7 +33,7 @@
= webpack_bundle_tag "runtime"
= webpack_bundle_tag "common"
= webpack_bundle_tag "main"
= webpack_bundle_tag "raven" if clientside_sentry_enabled?
= webpack_bundle_tag "raven" if Gitlab.config.clientside_sentry_enabled
- if content_for?(:page_specific_javascripts)
= yield :page_specific_javascripts
......
......@@ -12,7 +12,7 @@ module Gitlab
gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class
gon.katex_css_url = ActionController::Base.helpers.asset_path('katex.css')
gon.katex_js_url = ActionController::Base.helpers.asset_path('katex.js')
gon.sentry_dsn = Gitlab.config.clientside_sentry_dsn if clientside_sentry_enabled?
gon.sentry_dsn = Gitlab.config.clientside_sentry_dsn if Gitlab.config.clientside_sentry_enabled
gon.gitlab_url = Gitlab.config.gitlab.url
gon.is_production = Rails.env.production?
......
require 'spec_helper'
describe SentryHelper do
describe '#sentry_dsn_public' do
it 'returns nil if no sentry_dsn is set' do
mock_sentry_dsn(nil)
expect(helper.sentry_dsn_public).to eq nil
end
it 'returns the uri string with no password if sentry_dsn is set' do
mock_sentry_dsn('https://test:dsn@host/path')
expect(helper.sentry_dsn_public).to eq 'https://test@host/path'
end
end
def mock_sentry_dsn(value)
allow_message_expectations_on_nil
allow(ApplicationSetting.current).to receive(:sentry_dsn).and_return(value)
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册