|
|
@@ -2,11 +2,11 @@ import { memo, MouseEventHandler, 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'
|
|
|
import getMeta from '@/utils/meta'
|
|
|
import { ErrorLevel, LogEntry, SourceLocation } from '../util/types'
|
|
|
import { useAreNewErrorLogsEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
|
|
|
import NewLogEntry from '@/features/ide-redesign/components/error-logs/log-entry'
|
|
|
+import { useEditorAnalytics } from '@/shared/hooks/use-editor-analytics'
|
|
|
|
|
|
function PdfLogEntry({
|
|
|
autoExpand,
|
|
|
@@ -46,6 +46,7 @@ function PdfLogEntry({
|
|
|
id?: string
|
|
|
}) {
|
|
|
const showAiErrorAssistant = getMeta('ol-showAiErrorAssistant')
|
|
|
+ const { sendEvent } = useEditorAnalytics()
|
|
|
|
|
|
if (ruleId && HumanReadableLogsHints[ruleId]) {
|
|
|
const hint = HumanReadableLogsHints[ruleId]
|
|
|
@@ -64,10 +65,10 @@ function PdfLogEntry({
|
|
|
const parts = sourceLocation?.file?.split('.')
|
|
|
const extension =
|
|
|
parts?.length && parts?.length > 1 ? parts.pop() : ''
|
|
|
- sendMB('log-entry-link-click', { level, ruleId, extension })
|
|
|
+ sendEvent('log-entry-link-click', { level, ruleId, extension })
|
|
|
}
|
|
|
},
|
|
|
- [level, onSourceLocationClick, ruleId, sourceLocation]
|
|
|
+ [level, onSourceLocationClick, ruleId, sourceLocation, sendEvent]
|
|
|
)
|
|
|
|
|
|
const newErrorlogs = useAreNewErrorLogsEnabled()
|
|
|
@@ -88,7 +89,7 @@ function PdfLogEntry({
|
|
|
contentDetails={contentDetails}
|
|
|
entryAriaLabel={entryAriaLabel}
|
|
|
sourceLocation={sourceLocation}
|
|
|
- onSourceLocationClick={onSourceLocationClick}
|
|
|
+ onSourceLocationClick={handleLogEntryLinkClick}
|
|
|
showSourceLocationLink={showSourceLocationLink}
|
|
|
extraInfoURL={extraInfoURL}
|
|
|
/>
|