File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,31 @@ import {AppSettingContext} from 'src/shared/contexts/app'
77
88// Constants
99import { TIME_ZONES } from 'src/shared/constants/timeZones'
10+ import { TimeZone } from 'src/types'
11+ import { event } from 'src/cloud/utils/reporting'
1012
1113const TimeZoneDropdown : FC = ( ) => {
1214 const { timeZone, setTimeZone} = useContext ( AppSettingContext )
1315
16+ const onSelect = ( zone : TimeZone ) => {
17+ let loc = 'other'
18+ if ( window . location . pathname . includes ( 'notebook' ) ) {
19+ loc = 'notebooks'
20+ } else if ( window . location . pathname . includes ( 'data-explorer' ) ) {
21+ loc = 'data explorer'
22+ } else if ( window . location . pathname . includes ( 'dashboard' ) ) {
23+ loc = 'dashboard'
24+ }
25+
26+ event ( 'user selected new timezone' , { location : loc } )
27+ setTimeZone ( zone )
28+ }
29+
1430 return (
1531 < SelectDropdown
1632 options = { TIME_ZONES . map ( tz => tz . timeZone ) }
1733 selectedOption = { timeZone }
18- onSelect = { setTimeZone }
34+ onSelect = { onSelect }
1935 buttonIcon = { IconFont . Annotate_New }
2036 style = { { width : '115px' } }
2137 />
You can’t perform that action at this time.
0 commit comments