Skip to content
Snippets Groups Projects
Verified Commit 8e8be5d1 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett
Browse files

Fixed view to correct property

parent cb4b2e31
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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?
 
Loading
Loading
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment