mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-06 08:41:28 +00:00
track when users accept invites
This commit is contained in:
parent
50b3403983
commit
130fece0f6
2 changed files with 4 additions and 1 deletions
|
@ -7,7 +7,7 @@ logger = require('logger-sharelatex')
|
|||
EmailHelper = require "../Helpers/EmailHelper"
|
||||
EditorRealTimeController = require("../Editor/EditorRealTimeController")
|
||||
NotificationsBuilder = require("../Notifications/NotificationsBuilder")
|
||||
|
||||
AnalyticsManger = require("../Analytics/AnalyticsManager")
|
||||
|
||||
module.exports = CollaboratorsInviteController =
|
||||
|
||||
|
@ -120,4 +120,5 @@ module.exports = CollaboratorsInviteController =
|
|||
logger.err {projectId, inviteId}, "error accepting invite by token"
|
||||
return next(err)
|
||||
EditorRealTimeController.emitToRoom projectId, 'project:membership:changed', {invites: true, members: true}
|
||||
AnalyticsManger.recordEvent(currentUser._id, "project-invite-accept", {inviteId:inviteId, projectId:projectId})
|
||||
res.redirect "/project/#{projectId}"
|
||||
|
|
|
@ -11,6 +11,7 @@ ObjectId = require("mongojs").ObjectId
|
|||
|
||||
describe "CollaboratorsInviteController", ->
|
||||
beforeEach ->
|
||||
@AnalyticsManger = recordEvent: sinon.stub()
|
||||
@CollaboratorsInviteController = SandboxedModule.require modulePath, requires:
|
||||
"../Project/ProjectGetter": @ProjectGetter = {}
|
||||
'../Subscription/LimitationsManager' : @LimitationsManager = {}
|
||||
|
@ -20,6 +21,7 @@ describe "CollaboratorsInviteController", ->
|
|||
'logger-sharelatex': @logger = {err: sinon.stub(), error: sinon.stub(), log: sinon.stub()}
|
||||
"../Editor/EditorRealTimeController": @EditorRealTimeController = {emitToRoom: sinon.stub()}
|
||||
"../Notifications/NotificationsBuilder": @NotificationsBuilder = {}
|
||||
"../Analytics/AnalyticsManager": @AnalyticsManger
|
||||
@res = new MockResponse()
|
||||
@req = new MockRequest()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue