From da6de7bbb256588d59aeb2029fa3df283531dedb Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 23 Jan 2024 09:25:00 +0000 Subject: [PATCH] Add event tracking for log entry source link click (#16600) GitOrigin-RevId: a4b4a3f5cf4cbf6ac93ef9a8637028726f6cf161 --- .../js/features/pdf-preview/components/pdf-log-entry.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.jsx b/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.jsx index 100dd0f1f2..08f97c32d6 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.jsx +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.jsx @@ -4,6 +4,7 @@ import { memo, useCallback } from 'react' import PreviewLogEntryHeader from '../../preview/components/preview-log-entry-header' import PdfLogEntryContent from './pdf-log-entry-content' import HumanReadableLogsHints from '../../../ide/human-readable-logs/HumanReadableLogsHints' +import { sendMB } from '@/infrastructure/event-tracking' function PdfLogEntry({ ruleId, @@ -33,8 +34,12 @@ function PdfLogEntry({ event => { event.preventDefault() onSourceLocationClick(sourceLocation) + + const parts = sourceLocation?.file?.split('.') + const extension = parts?.length > 1 ? parts.pop() : '' + sendMB('log-entry-link-click', { level, ruleId, extension }) }, - [onSourceLocationClick, sourceLocation] + [level, onSourceLocationClick, ruleId, sourceLocation] ) return (