diff options
author | jejacks0n <jjackson@gitlab.com> | 2019-08-26 10:58:33 -0600 |
---|---|---|
committer | jejacks0n <jjackson@gitlab.com> | 2019-08-26 10:58:33 -0600 |
commit | 3766248435c82c0c650604fbc05b8d5caff27e04 (patch) | |
tree | 688e360d0347d8d5a593d3789346434f423e0fcc | |
parent | 66f5462a796d0f9a43eed8ad64e815029baad63f (diff) | |
download | gitlab-ce-user-tracking-settings.tar.gz |
Revert "Rename back to EventTracking"user-tracking-settings
This reverts commit 66f5462a796d0f9a43eed8ad64e815029baad63f.
-rw-r--r-- | app/views/layouts/_snowplow.html.haml | 2 | ||||
-rw-r--r-- | lib/gitlab/tracking.rb (renamed from lib/gitlab/event_tracking.rb) | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/tracking_spec.rb (renamed from spec/lib/gitlab/event_tracking_spec.rb) | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/app/views/layouts/_snowplow.html.haml b/app/views/layouts/_snowplow.html.haml index e73690ff6f3..d7ff5ad1094 100644 --- a/app/views/layouts/_snowplow.html.haml +++ b/app/views/layouts/_snowplow.html.haml @@ -7,4 +7,4 @@ };p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1; n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","#{asset_url('snowplow/sp.js')}","snowplow")); - window.snowplowOptions = #{Gitlab::EventTracking.snowplow_options(@group).to_json} + window.snowplowOptions = #{Gitlab::Tracking.snowplow_options(@group).to_json} diff --git a/lib/gitlab/event_tracking.rb b/lib/gitlab/tracking.rb index 2574e2f566c..ef669b03c87 100644 --- a/lib/gitlab/event_tracking.rb +++ b/lib/gitlab/tracking.rb @@ -3,7 +3,7 @@ require 'snowplow-tracker' module Gitlab - module EventTracking + module Tracking SNOWPLOW_NAMESPACE = 'gl' class << self @@ -11,7 +11,7 @@ module Gitlab Gitlab::CurrentSettings.snowplow_enabled? end - def track(category, action, label: nil, property: nil, value: nil, context: nil) + def event(category, action, label: nil, property: nil, value: nil, context: nil) return unless enabled? snowplow.track_struct_event(category, action, label, property, value, context, Time.now.to_i) diff --git a/spec/lib/gitlab/event_tracking_spec.rb b/spec/lib/gitlab/tracking_spec.rb index cc30dfed2c3..f14e74427e1 100644 --- a/spec/lib/gitlab/event_tracking_spec.rb +++ b/spec/lib/gitlab/tracking_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::EventTracking do +describe Gitlab::Tracking do let(:timestamp) { Time.utc(2017, 3, 22) } before do @@ -39,7 +39,7 @@ describe Gitlab::EventTracking do end end - describe '.track' do + describe '.event' do subject(&method(:described_class)) around do |example| @@ -70,7 +70,7 @@ describe Gitlab::EventTracking do timestamp.to_i ) - subject.track('category', 'action', + subject.event('category', 'action', label: '_label_', property: '_property_', value: '_value_', @@ -82,7 +82,7 @@ describe Gitlab::EventTracking do stub_application_setting(snowplow_enabled: false) expect(SnowplowTracker::Tracker).not_to receive(:new) - subject.track('epics', 'action', property: 'what', value: 'doit') + subject.event('epics', 'action', property: 'what', value: 'doit') end end end |