From 70bf7b2aab9af4bde1c1d65bbddf9317e70dada4 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 26 Jun 2024 12:14:42 +0200 Subject: [PATCH] Merge pull request #19109 from overleaf/tm-project-joined-add-project-id Add projectId to project-joined event GitOrigin-RevId: 222e0acc8764592344e384d1a6a5a2327d4161f5 --- .../web/app/src/Features/TokenAccess/TokenAccessHandler.js | 2 ++ .../web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/web/app/src/Features/TokenAccess/TokenAccessHandler.js b/services/web/app/src/Features/TokenAccess/TokenAccessHandler.js index d94d2b4368..77b866737c 100644 --- a/services/web/app/src/Features/TokenAccess/TokenAccessHandler.js +++ b/services/web/app/src/Features/TokenAccess/TokenAccessHandler.js @@ -156,6 +156,7 @@ const TokenAccessHandler = { projectId = new ObjectId(projectId.toString()) Analytics.recordEventForUserInBackground(userId, 'project-joined', { mode: 'read-only', + projectId: projectId.toString(), }) return await Project.updateOne( @@ -173,6 +174,7 @@ const TokenAccessHandler = { projectId = new ObjectId(projectId.toString()) Analytics.recordEventForUserInBackground(userId, 'project-joined', { mode: 'read-write', + projectId: projectId.toString(), }) return await Project.updateOne( diff --git a/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js b/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js index 2b6ad52c5c..25c7ab7cfd 100644 --- a/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js +++ b/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js @@ -130,7 +130,7 @@ describe('TokenAccessHandler', function () { this.Analytics.recordEventForUserInBackground, this.userId, 'project-joined', - { mode: 'read-only' } + { mode: 'read-only', projectId: this.projectId.toString() } ) }) @@ -178,7 +178,7 @@ describe('TokenAccessHandler', function () { this.Analytics.recordEventForUserInBackground, this.userId, 'project-joined', - { mode: 'read-write' } + { mode: 'read-write', projectId: this.projectId.toString() } ) })