From 0bef5531bb6929296ca90cf5fc6f915f21ac6897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Fern=C3=A1ndez=20Capel?= Date: Mon, 22 Jan 2018 16:20:08 +0000 Subject: [PATCH] Rename editSession -> editingSession --- .../app/coffee/Features/Analytics/AnalyticsController.coffee | 4 ++-- .../app/coffee/Features/Analytics/AnalyticsManager.coffee | 4 ++-- .../web/app/coffee/Features/Analytics/AnalyticsRouter.coffee | 5 ++++- .../web/public/coffee/ide/editor/directives/aceEditor.coffee | 4 ++-- services/web/public/coffee/main/event.coffee | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/services/web/app/coffee/Features/Analytics/AnalyticsController.coffee b/services/web/app/coffee/Features/Analytics/AnalyticsController.coffee index 0fad2ed32e..5166bd2765 100644 --- a/services/web/app/coffee/Features/Analytics/AnalyticsController.coffee +++ b/services/web/app/coffee/Features/Analytics/AnalyticsController.coffee @@ -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) diff --git a/services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee b/services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee index 08a5a11c01..e77139ed7b 100644 --- a/services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee +++ b/services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee @@ -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 diff --git a/services/web/app/coffee/Features/Analytics/AnalyticsRouter.coffee b/services/web/app/coffee/Features/Analytics/AnalyticsRouter.coffee index 639110f2a3..e7a6051c41 100644 --- a/services/web/app/coffee/Features/Analytics/AnalyticsRouter.coffee +++ b/services/web/app/coffee/Features/Analytics/AnalyticsRouter.coffee @@ -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') diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index e05e278625..a91ccc119c 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -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' diff --git a/services/web/public/coffee/main/event.coffee b/services/web/public/coffee/main/event.coffee index c2f3bc417a..9956400979 100644 --- a/services/web/public/coffee/main/event.coffee +++ b/services/web/public/coffee/main/event.coffee @@ -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: {