1- import React , { FunctionComponent , useCallback , useMemo , useRef , useState , useEffect } from 'react' ;
1+ import React , { FunctionComponent , useCallback , useMemo , useRef , useState } from 'react' ;
22import { VscError , VscWarning , VscInfo , VscLightbulb , VscSearch , VscClose , VscSettingsGear } from 'react-icons/vsc' ;
33import { useModal } from '@ebay/nice-modal-react' ;
44import { DiagnosticSeverity } from '@asyncapi/parser' ;
@@ -11,7 +11,6 @@ import { debounce } from '../../helpers';
1111import { useDocumentsState , useSettingsState } from '../../state' ;
1212
1313import type { Diagnostic } from '@asyncapi/parser' ;
14- import { trackEvent } from '@/helpers/analytics' ;
1514
1615interface ProblemsTabProps { }
1716
@@ -208,10 +207,6 @@ export const ProblemsTabContent: FunctionComponent<ProblemsTabProps> = () => {
208207 const [ search , setSearch ] = useState < string > ( '' ) ;
209208 const inputRef = useRef < HTMLInputElement > ( null ) ;
210209
211- useEffect ( ( ) => {
212- trackEvent ( 'Diagnostics' , 'panel_opened' , 'Problems tab opened' ) ;
213- } , [ ] ) ;
214-
215210 const setActiveFn = useCallback ( ( severity : DiagnosticSeverity ) => {
216211 setActive ( acc => {
217212 if ( acc . some ( s => s === severity ) ) {
@@ -241,19 +236,11 @@ export const ProblemsTabContent: FunctionComponent<ProblemsTabProps> = () => {
241236 < SeverityButtons active = { active } setActive = { setActiveFn } />
242237 < div className = 'ml-2 flex-1 flex flex-row items-center justify-center rounded-md border border-transparent shadow-xs px-2 py-1 bg-gray-700 text-xs font-medium' >
243238 < VscSearch />
244- < input ref = { inputRef } placeholder = 'Filter diagnostics...' className = 'w-full bg-gray-700 border-transparent ml-2 focus:border-transparent focus:ring-0 focus:outline-none' onChange = { debounce ( ( e ) => {
245- setSearch ( e . target . value )
246- if ( e . target . value . length > 2 || e . target . value . length === 0 ) {
247- trackEvent ( 'Diagnostics' , 'search' , `Search term: "${ e . target . value } "` ) ;
248- }
249- } , 250 ) } />
239+ < input ref = { inputRef } placeholder = 'Filter diagnostics...' className = 'w-full bg-gray-700 border-transparent ml-2 focus:border-transparent focus:ring-0 focus:outline-none' onChange = { debounce ( ( e ) => setSearch ( e . target . value ) , 250 ) } />
250240 < button type = 'button' className = { `hover:bg-gray-900 rounded-sm border border-transparent ${ search ? 'opacity-100' : 'opacity-0' } ` } onClick = { ( ) => {
251241 if ( inputRef . current ) {
252242 inputRef . current . value = '' ;
253243 }
254- if ( search ) {
255- trackEvent ( 'Diagnostics' , 'search_clear' , 'Search cleared' ) ;
256- }
257244 setSearch ( '' ) ;
258245 } } >
259246 < VscClose />
@@ -263,14 +250,7 @@ export const ProblemsTabContent: FunctionComponent<ProblemsTabProps> = () => {
263250 < button
264251 type = "button"
265252 className = { 'justify-center border border-transparent shadow-xs px-2 py-1 ml-2 text-xs rounded-md font-medium text-white hover:bg-gray-900 focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-gray-700' }
266- onClick = { ( ) => {
267- trackEvent (
268- 'Diagnostics' ,
269- 'settings_open' ,
270- 'Opened governance settings'
271- ) ;
272- modal . show ( { activeTab : 'governance' } )
273- } }
253+ onClick = { ( ) => modal . show ( { activeTab : 'governance' } ) }
274254 >
275255 < VscSettingsGear className = 'w-4 h-4' />
276256 </ button >
@@ -294,23 +274,14 @@ export const ProblemsTabContent: FunctionComponent<ProblemsTabProps> = () => {
294274 < td className = "px-2 py-1 text-right" > < SeverityIcon severity = { severity } /> </ td >
295275 < td
296276 className = "px-2 py-1 cursor-pointer"
297- onClick = { ( ) => {
298- trackEvent ( 'Diagnostics' , 'diagnostic_click' , `Clicked on diagnostic at line ${ range . start . line + 1 } ` ) ;
277+ onClick = { ( ) =>
299278 navigationSvc . scrollToEditorLine (
300279 range . start . line + 1 ,
301280 range . start . character + 1 ,
302281 )
303282 }
304- }
305283 onKeyDown = { ( e ) => {
306284 if ( e . key === 'Enter' ) {
307- trackEvent (
308- 'Diagnostics' ,
309- 'diagnostic_click' ,
310- `Clicked on diagnostic at line ${
311- range . start . line + 1
312- } `
313- ) ;
314285 navigationSvc . scrollToEditorLine (
315286 range . start . line + 1 ,
316287 range . start . character + 1 ,
0 commit comments