Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c8c20634
Commit
c8c20634
authored
Aug 30, 2021
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename snowplow_options to options
parent
f5a42a3b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
8 deletions
+8
-8
app/views/layouts/_snowplow.html.haml
app/views/layouts/_snowplow.html.haml
+1
-1
doc/development/snowplow/index.md
doc/development/snowplow/index.md
+2
-2
lib/gitlab/tracking.rb
lib/gitlab/tracking.rb
+1
-1
spec/lib/gitlab/tracking_spec.rb
spec/lib/gitlab/tracking_spec.rb
+3
-3
tooling/danger/product_intelligence.rb
tooling/danger/product_intelligence.rb
+1
-1
No files found.
app/views/layouts/_snowplow.html.haml
View file @
c8c20634
...
...
@@ -7,7 +7,7 @@
};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
::
Tracking
.
snowplow_
options
(
@group
).
to_json
}
window.snowplowOptions =
#{
Gitlab
::
Tracking
.
options
(
@group
).
to_json
}
gl = window.gl || {};
gl.snowplowStandardContext =
#{
Gitlab
::
Tracking
::
StandardContext
.
new
.
to_context
.
to_json
.
to_json
}
doc/development/snowplow/index.md
View file @
c8c20634
...
...
@@ -568,14 +568,14 @@ Snowplow Micro is a Docker-based solution for testing frontend and backend event
formTracking: false,
```
1.
Update
`
snowplow_
options`
in
`lib/gitlab/tracking.rb`
to add
`protocol`
and
`port`
:
1.
Update
`options`
in
`lib/gitlab/tracking.rb`
to add
`protocol`
and
`port`
:
```
diff
diff --git a/lib/gitlab/tracking.rb b/lib/gitlab/tracking.rb
index 618e359211b..e9084623c43 100644
--- a/lib/gitlab/tracking.rb
+++ b/lib/gitlab/tracking.rb
@@ -41,7 +41,9 @@ def
snowplow_
options(group)
@@ -41,7 +41,9 @@ def options(group)
cookie_domain: Gitlab::CurrentSettings.snowplow_cookie_domain,
app_id: Gitlab::CurrentSettings.snowplow_app_id,
form_tracking: additional_features,
...
...
lib/gitlab/tracking.rb
View file @
c8c20634
...
...
@@ -18,7 +18,7 @@ module Gitlab
Gitlab
::
ErrorTracking
.
track_and_raise_for_dev_exception
(
error
,
snowplow_category:
category
,
snowplow_action:
action
)
end
def
snowplow_
options
(
group
)
def
options
(
group
)
additional_features
=
Feature
.
enabled?
(
:additional_snowplow_tracking
,
group
)
{
namespace:
SNOWPLOW_NAMESPACE
,
...
...
spec/lib/gitlab/tracking_spec.rb
View file @
c8c20634
...
...
@@ -11,7 +11,7 @@ RSpec.describe Gitlab::Tracking do
described_class
.
instance_variable_set
(
"@snowplow"
,
nil
)
end
describe
'.
snowplow_
options'
do
describe
'.options'
do
it
'returns useful client options'
do
expected_fields
=
{
namespace:
'gl'
,
...
...
@@ -22,13 +22,13 @@ RSpec.describe Gitlab::Tracking do
linkClickTracking:
true
}
expect
(
subject
.
snowplow_
options
(
nil
)).
to
match
(
expected_fields
)
expect
(
subject
.
options
(
nil
)).
to
match
(
expected_fields
)
end
it
'when feature flag is disabled'
do
stub_feature_flags
(
additional_snowplow_tracking:
false
)
expect
(
subject
.
snowplow_
options
(
nil
)).
to
include
(
expect
(
subject
.
options
(
nil
)).
to
include
(
formTracking:
false
,
linkClickTracking:
false
)
...
...
tooling/danger/product_intelligence.rb
View file @
c8c20634
...
...
@@ -70,7 +70,7 @@ module Tooling
'data-track-action'
)
all_changed_files
.
select
do
|
file
|
matching_files?
(
file
,
extension:
'.rb'
,
pattern:
%r{Gitlab::Tracking
\.
(event|enabled
\?
|
snowplow_
options)$}
)
||
matching_files?
(
file
,
extension:
'.rb'
,
pattern:
%r{Gitlab::Tracking
\.
(event|enabled
\?
|options)$}
)
||
matching_files?
(
file
,
extension:
'.js'
,
pattern:
js_patterns
)
||
matching_files?
(
file
,
extension:
'.vue'
,
pattern:
js_patterns
)
||
matching_files?
(
file
,
extension:
'.haml'
,
pattern:
%r{data:
\{
track}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment