Rename editSession -> editingSession

This commit is contained in:
Alberto Fernández Capel 2018-01-22 16:20:08 +00:00
parent 868e32c1bc
commit 0bef5531bb
5 changed files with 12 additions and 9 deletions

View file

@ -3,11 +3,11 @@ Errors = require "../Errors/Errors"
AuthenticationController = require("../Authentication/AuthenticationController")
module.exports = AnalyticsController =
updateEditSession: (req, res, next) ->
updateEditingSession: (req, res, next) ->
userId = AuthenticationController.getLoggedInUserId(req) or req.sessionID
projectId = req.params.projectId
AnalyticsManager.updateEditSession userId, projectId, {}, (error) ->
AnalyticsManager.updateEditingSession userId, projectId, {}, (error) ->
if error instanceof Errors.ServiceNotConfiguredError
# ignore, no-op
return res.send(204)

View file

@ -39,7 +39,7 @@ module.exports =
url: "/user/#{user_id}/event"
makeRequest opts, callback
updateEditSession: (userId, projectId, segmentation = {}, callback = (error) ->) ->
updateEditingSession: (userId, projectId, segmentation = {}, callback = (error) ->) ->
if userId+"" == settings.smokeTest?.userId+""
return callback()
opts =
@ -48,7 +48,7 @@ module.exports =
json: true
method: "PUT"
timeout: 1000
url: "/editSession?userId=#{userId}&projectId=#{projectId}"
url: "/editingSession?userId=#{userId}&projectId=#{projectId}"
makeRequest opts, callback

View file

@ -5,7 +5,10 @@ AnalyticsProxy = require('./AnalyticsProxy')
module.exports =
apply: (webRouter, privateApiRouter, publicApiRouter) ->
webRouter.post '/event/:event', AnalyticsController.recordEvent
webRouter.put '/editSession/:projectId', AnalyticsController.updateEditSession
webRouter.put '/editingSession/:projectId',
AnalyticsController.updateEditingSession
publicApiRouter.use '/analytics/graphs',
AuthenticationController.httpAuth,
AnalyticsProxy.call('/graphs')

View file

@ -301,8 +301,8 @@ define [
onChange = () ->
updateCount++
projectId = _.last( location.pathname.split("/"))
event_tracking.editSessionHeartbeat(projectId)
projectId = _.last(location.pathname.split("/"))
event_tracking.editingSessionHeartbeat(projectId)
if updateCount == 100
event_tracking.send 'editor-interaction', 'multi-doc-update'

View file

@ -35,9 +35,9 @@ define [
send: (category, action, label, value)->
ga('send', 'event', category, action, label, value)
editSessionHeartbeat: _.throttle( (projectId, segmentation = {}) ->
editingSessionHeartbeat: _.throttle( (projectId, segmentation = {}) ->
$http({
url: "/editSession/#{projectId}",
url: "/editingSession/#{projectId}",
method: "PUT",
data: segmentation,
headers: {