Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
0cdbc707
Unverified
Commit
0cdbc707
authored
Dec 19, 2019
by
Robert Knight
Committed by
GitHub
Dec 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1609 from hypothesis/remove-annotation-analytics
Remove analytics tracking from annotation component
parents
481aa74c
59dd0c9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
49 deletions
+5
-49
annotation.js
src/sidebar/components/annotation.js
+5
-42
annotation-test.js
src/sidebar/components/test/annotation-test.js
+0
-7
No files found.
src/sidebar/components/annotation.js
View file @
0cdbc707
...
...
@@ -32,7 +32,6 @@ function AnnotationController(
$scope
,
$timeout
,
$window
,
analytics
,
store
,
annotationMapper
,
api
,
...
...
@@ -59,8 +58,6 @@ function AnnotationController(
}
return
saved
.
then
(
function
(
savedAnnot
)
{
let
event
;
// Copy across internal properties which are not part of the annotation
// model saved on the server
savedAnnot
.
$tag
=
annot
.
$tag
;
...
...
@@ -70,26 +67,6 @@ function AnnotationController(
}
});
if
(
self
.
isReply
())
{
event
=
updating
?
analytics
.
events
.
REPLY_UPDATED
:
analytics
.
events
.
REPLY_CREATED
;
}
else
if
(
self
.
isHighlight
())
{
event
=
updating
?
analytics
.
events
.
HIGHLIGHT_UPDATED
:
analytics
.
events
.
HIGHLIGHT_CREATED
;
}
else
if
(
isPageNote
(
self
.
annotation
))
{
event
=
updating
?
analytics
.
events
.
PAGE_NOTE_UPDATED
:
analytics
.
events
.
PAGE_NOTE_CREATED
;
}
else
{
event
=
updating
?
analytics
.
events
.
ANNOTATION_UPDATED
:
analytics
.
events
.
ANNOTATION_CREATED
;
}
analytics
.
track
(
event
);
return
savedAnnot
;
});
}
...
...
@@ -216,7 +193,6 @@ function AnnotationController(
flash
.
error
(
err
.
message
,
'Flagging annotation failed'
);
};
annotationMapper
.
flagAnnotation
(
self
.
annotation
).
then
(
function
()
{
analytics
.
track
(
analytics
.
events
.
ANNOTATION_FLAGGED
);
store
.
updateFlagStatus
(
self
.
annotation
.
id
,
true
);
},
onRejected
);
};
...
...
@@ -231,25 +207,12 @@ function AnnotationController(
// Don't use confirm inside the digest cycle.
const
msg
=
'Are you sure you want to delete this annotation?'
;
if
(
$window
.
confirm
(
msg
))
{
const
onRejected
=
function
(
err
)
{
flash
.
error
(
err
.
message
,
'Deleting annotation failed'
);
};
$scope
.
$apply
(
function
()
{
annotationMapper
.
deleteAnnotation
(
self
.
annotation
).
then
(
function
()
{
let
event
;
if
(
self
.
isReply
())
{
event
=
analytics
.
events
.
REPLY_DELETED
;
}
else
if
(
self
.
isHighlight
())
{
event
=
analytics
.
events
.
HIGHLIGHT_DELETED
;
}
else
if
(
isPageNote
(
self
.
annotation
))
{
event
=
analytics
.
events
.
PAGE_NOTE_DELETED
;
}
else
{
event
=
analytics
.
events
.
ANNOTATION_DELETED
;
}
analytics
.
track
(
event
);
},
onRejected
);
annotationMapper
.
deleteAnnotation
(
self
.
annotation
)
.
catch
(
err
=>
flash
.
error
(
err
.
message
,
'Deleting annotation failed'
)
);
});
}
},
true
);
...
...
src/sidebar/components/test/annotation-test.js
View file @
0cdbc707
...
...
@@ -83,7 +83,6 @@ describe('annotation', function() {
const
fakeAccountID
=
{
isThirdPartyUser
:
sinon
.
stub
(),
};
let
fakeAnalytics
;
let
fakeAnnotationMapper
;
let
fakeStore
;
let
fakeFlash
;
...
...
@@ -161,11 +160,6 @@ describe('annotation', function() {
angular
.
mock
.
module
(
function
(
$provide
)
{
sandbox
=
sinon
.
sandbox
.
create
();
fakeAnalytics
=
{
track
:
sandbox
.
stub
(),
events
:
{},
};
fakeAnnotationMapper
=
{
createAnnotation
:
sandbox
.
stub
().
returns
({
permissions
:
{
...
...
@@ -246,7 +240,6 @@ describe('annotation', function() {
call
:
sinon
.
stub
(),
};
$provide
.
value
(
'analytics'
,
fakeAnalytics
);
$provide
.
value
(
'annotationMapper'
,
fakeAnnotationMapper
);
$provide
.
value
(
'store'
,
fakeStore
);
$provide
.
value
(
'api'
,
fakeApi
);
...
...
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