Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit telemetry event on "Run job with input folder" checkbox click #523

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/components/input-folder-checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ChangeEvent } from 'react';
import { useTranslator } from '../hooks';
import { useEventLogger, useTranslator } from '../hooks';

import {
Checkbox,
Expand All @@ -13,6 +13,7 @@ export function PackageInputFolderControl(props: {
inputFile: string;
}): JSX.Element {
const trans = useTranslator('jupyterlab');
const log = useEventLogger();
const inputFilePath = props.inputFile.split('/');
inputFilePath.pop();

Expand All @@ -33,7 +34,14 @@ export function PackageInputFolderControl(props: {
<FormGroup>
<FormControlLabel
control={
<Checkbox onChange={props.onChange} name={'packageInputFolder'} />
<Checkbox
onChange={event => {
const checkboxEvent = event.target.checked ? 'check' : 'uncheck';
log(`create-job.options.package_input_folder.${checkboxEvent}`);
props.onChange(event);
}}
name={'packageInputFolder'}
/>
}
label={trans.__('Run job with input folder')}
aria-describedby="jp-package-input-folder-helper-text"
Expand Down
Loading