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
b289f9a6
Commit
b289f9a6
authored
Mar 16, 2021
by
Axel García
Committed by
Axel Garcia
Mar 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check hard-coded data-track-event instances
parent
e2feb523
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
app/helpers/tracking_helper.rb
app/helpers/tracking_helper.rb
+2
-2
danger/product_intelligence/Dangerfile
danger/product_intelligence/Dangerfile
+2
-1
spec/helpers/tracking_helper_spec.rb
spec/helpers/tracking_helper_spec.rb
+1
-1
No files found.
app/helpers/tracking_helper.rb
View file @
b289f9a6
# frozen_string_literal: true
module
TrackingHelper
def
tracking_attrs
(
label
,
event
,
property
)
def
tracking_attrs
(
label
,
action
,
property
)
return
{}
unless
tracking_enabled?
{
data:
{
track_label:
label
,
track_
event:
event
,
track_
action:
action
,
track_property:
property
}
}
...
...
danger/product_intelligence/Dangerfile
View file @
b289f9a6
...
...
@@ -51,7 +51,8 @@ end
js_patterns
=
Regexp
.
union
(
'Tracking.event'
,
/\btrack\(/
,
'data-track-event'
'data-track-event'
,
'data-track-action'
)
dictionary_pattern
=
Regexp
.
union
(
...
...
spec/helpers/tracking_helper_spec.rb
View file @
b289f9a6
...
...
@@ -10,7 +10,7 @@ RSpec.describe TrackingHelper do
let
(
:results
)
do
{
no_data:
{},
with_data:
{
data:
{
track_label:
'a'
,
track_
event
:
'b'
,
track_property:
'c'
}
}
with_data:
{
data:
{
track_label:
'a'
,
track_
action
:
'b'
,
track_property:
'c'
}
}
}
end
...
...
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