Commit 231e03e9 authored by Dallas Reedy's avatar Dallas Reedy

Make Gitlab::Tracking.enabled? the SSoT of tracking being enabled

- Consolidates several uses of Gitlab::CurrentSettings.snowplow_enabled?
- Allows room for other tracking collectors in the future
parent 204f9332
......@@ -17,6 +17,6 @@ module TrackingHelper
def tracking_enabled?
Rails.env.production? &&
::Gitlab::CurrentSettings.snowplow_enabled?
::Gitlab::Tracking.enabled?
end
end
......@@ -7,5 +7,5 @@
- else
%link{ { rel: 'preload', href: stylesheet_url('application'), as: 'style' }, ActionController::Base.asset_host ? { crossorigin: 'anonymous' } : {} }
%link{ { rel: 'preload', href: stylesheet_url("highlight/themes/#{user_color_scheme}"), as: 'style' }, ActionController::Base.asset_host ? { crossorigin: 'anonymous' } : {} }
- if Gitlab::CurrentSettings.snowplow_enabled? && Gitlab::CurrentSettings.snowplow_collector_hostname
- if Gitlab::Tracking.enabled? && Gitlab::CurrentSettings.snowplow_collector_hostname
%link{ rel: 'preconnect', href: Gitlab::CurrentSettings.snowplow_collector_hostname, crossorigin: '' }
- return unless Gitlab::CurrentSettings.snowplow_enabled?
- return unless Gitlab::Tracking.enabled?
= javascript_tag do
:plain
......
......@@ -18,7 +18,7 @@ module Gitlab
private
def enabled?
Gitlab::CurrentSettings.snowplow_enabled?
Gitlab::Tracking.enabled?
end
def tracker
......
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