File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/components/RJST/Lenses/types Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { useEffect } from 'react' ;
22import { faTable } from '@fortawesome/free-solid-svg-icons/faTable' ;
33import type { LensTemplate } from '..' ;
44import type { CollectionLensRendererProps } from '.' ;
@@ -226,6 +226,20 @@ const TableRenderer = <T extends { id: number }>({
226226 setShowAddTagDialog ( false ) ;
227227 } ;
228228
229+ useEffect ( ( ) => {
230+ analytics . webTracker ?. track ( 'View table - columns' , {
231+ current_url : location . origin + location . pathname ,
232+ resource : model . resource ,
233+ columns : Object . fromEntries (
234+ columns . map ( ( col ) => [ col . field , col . selected ] ) ,
235+ ) ,
236+ } ) ;
237+
238+ // This analytics event should only be fired on page load,
239+ // so we make sure the useEffect only runs on mount.
240+ // eslint-disable-next-line react-hooks/exhaustive-deps
241+ } , [ ] ) ;
242+
229243 return (
230244 < >
231245 < Table
You can’t perform that action at this time.
0 commit comments