mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #34644 from overleaf/as-link-sharing-analytics
[web] Add sharing link analytics events GitOrigin-RevId: b206732397065c399d38a8e42dbdebe60222fb24
This commit is contained in:
+7
-1
@@ -5,6 +5,7 @@ import { useProjectContext } from '@/shared/context/project-context'
|
||||
import { useUserContext } from '@/shared/context/user-context'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import getMeta from '@/utils/meta'
|
||||
import { sendMB } from '@/infrastructure/event-tracking'
|
||||
|
||||
export default function CopySharingLinkButton() {
|
||||
const { t } = useTranslation()
|
||||
@@ -31,7 +32,12 @@ export default function CopySharingLinkButton() {
|
||||
|
||||
navigator.clipboard
|
||||
.writeText(link)
|
||||
.then(() => setSuccessActionMessage(t('link_copied')))
|
||||
.then(() => {
|
||||
setSuccessActionMessage(t('link_copied'))
|
||||
sendMB('sharing-link-copied', {
|
||||
project_id: projectId,
|
||||
})
|
||||
})
|
||||
.catch(debugConsole.error)
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
import { ExcludeStrict } from '@ol-types/utils'
|
||||
import getMeta from '@/utils/meta'
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
import { sendMB } from '@/infrastructure/event-tracking'
|
||||
|
||||
type ProjectAccessProps = {
|
||||
setIsInvitedPeopleScreen: React.Dispatch<React.SetStateAction<boolean>>
|
||||
@@ -95,6 +96,11 @@ function ProjectAccess({
|
||||
setSharingLinkData(data)
|
||||
setProjectAccess(newAccess)
|
||||
setSuccessActionMessage(t('access_updated'))
|
||||
sendMB('sharing-link-set-permissions', {
|
||||
project_id: projectId,
|
||||
access_level: newAccess.split('.')[0],
|
||||
...reqBody,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -122,6 +128,12 @@ function ProjectAccess({
|
||||
).then(data => {
|
||||
setSharingLinkData(data)
|
||||
setSuccessActionMessage(t('access_updated'))
|
||||
sendMB('sharing-link-set-permissions', {
|
||||
project_id: projectId,
|
||||
access_level: projectAccess?.split('.')[0],
|
||||
privileges: eventKey,
|
||||
subscriptionId: data.subscriptionId,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user