Skip to content

Commit 8b13516

Browse files
authored
Emit telemetry event on "Run job with input folder" checkbox click (#523)
* emit on package_input_folder click * remove unnecessary onChange event inline typing
1 parent dbeb34f commit 8b13516

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/input-folder-checkbox.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { ChangeEvent } from 'react';
2-
import { useTranslator } from '../hooks';
2+
import { useEventLogger, useTranslator } from '../hooks';
33

44
import {
55
Checkbox,
@@ -13,6 +13,7 @@ export function PackageInputFolderControl(props: {
1313
inputFile: string;
1414
}): JSX.Element {
1515
const trans = useTranslator('jupyterlab');
16+
const log = useEventLogger();
1617
const inputFilePath = props.inputFile.split('/');
1718
inputFilePath.pop();
1819

@@ -33,7 +34,14 @@ export function PackageInputFolderControl(props: {
3334
<FormGroup>
3435
<FormControlLabel
3536
control={
36-
<Checkbox onChange={props.onChange} name={'packageInputFolder'} />
37+
<Checkbox
38+
onChange={event => {
39+
const checkboxEvent = event.target.checked ? 'check' : 'uncheck';
40+
log(`create-job.options.package_input_folder.${checkboxEvent}`);
41+
props.onChange(event);
42+
}}
43+
name={'packageInputFolder'}
44+
/>
3745
}
3846
label={trans.__('Run job with input folder')}
3947
aria-describedby="jp-package-input-folder-helper-text"

0 commit comments

Comments
 (0)