mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 03:23:10 +00:00
Merge pull request #3016 from overleaf/ta-editor-load-events
Fix Editor Load Events GitOrigin-RevId: bb23f17ccab2d53933ad9da870f8ce26fdd169df
This commit is contained in:
parent
60bdd4641a
commit
c200511f86
3 changed files with 10 additions and 5 deletions
|
@ -35,6 +35,7 @@ const Features = require('../../infrastructure/Features')
|
|||
const BrandVariationsHandler = require('../BrandVariations/BrandVariationsHandler')
|
||||
const { getUserAffiliations } = require('../Institutions/InstitutionsAPI')
|
||||
const UserController = require('../User/UserController')
|
||||
const AnalyticsManager = require('../Analytics/AnalyticsManager')
|
||||
|
||||
const _ssoAvailable = (affiliation, session, linkedInstitutionIds) => {
|
||||
if (!affiliation.institution) return false
|
||||
|
@ -773,6 +774,12 @@ const ProjectController = {
|
|||
const enableOptimize =
|
||||
!!Settings.experimentId && !user.features.zotero
|
||||
|
||||
if (userId) {
|
||||
AnalyticsManager.recordEvent(userId, 'project-opened', {
|
||||
projectId: project._id
|
||||
})
|
||||
}
|
||||
|
||||
res.render('project/editor', {
|
||||
title: project.name,
|
||||
priority_title: true,
|
||||
|
|
|
@ -192,10 +192,7 @@ export default App.controller('SettingsController', function(
|
|||
}
|
||||
// don't save on initialisation, Angular passes oldRootDoc_id as
|
||||
// undefined in this case.
|
||||
if (
|
||||
typeof rootDoc_id === 'undefined' &&
|
||||
typeof oldRootDoc_id === 'undefined'
|
||||
) {
|
||||
if (typeof oldRootDoc_id === 'undefined') {
|
||||
return
|
||||
}
|
||||
// otherwise only save changes, null values are allowed
|
||||
|
|
|
@ -178,7 +178,8 @@ describe('ProjectController', function() {
|
|||
getUserAffiliations: this.getUserAffiliations
|
||||
},
|
||||
'../ThirdPartyDataStore/TpdsProjectFlusher': this.TpdsProjectFlusher,
|
||||
'../../models/Project': {}
|
||||
'../../models/Project': {},
|
||||
'../Analytics/AnalyticsManager': { recordEvent: () => {} }
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue