Add telemetry to track execute cell from <Prompt/> (#15)

This commit is contained in:
Tanuj Mittal
2020-06-02 10:46:12 -07:00
committed by GitHub
parent a6c44e0e69
commit ab3486bd05
4 changed files with 51 additions and 7 deletions

View File

@@ -1,8 +1,9 @@
import { actions, ContentRef, selectors } from "@nteract/core";
import React from "react";
import { connect } from "react-redux";
import { Dispatch } from "redux";
import { ContentRef, selectors, actions } from "@nteract/core";
import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants";
import * as cdbActions from "../NotebookComponent/actions";
import { CdbAppState } from "../NotebookComponent/types";
export interface PassedPromptProps {
@@ -83,7 +84,15 @@ const mapDispatchToProps = (
dispatch: Dispatch,
{ id, contentRef }: { id: string; contentRef: ContentRef }
): DispatchProps => ({
executeCell: () => dispatch(actions.executeCell({ id, contentRef })),
executeCell: () => {
dispatch(actions.executeCell({ id, contentRef }));
dispatch(
cdbActions.traceNotebookTelemetry({
action: Action.ExecuteCellPromptBtn,
actionModifier: ActionModifiers.Mark
})
);
},
stopExecution: () => dispatch(actions.interruptKernel({}))
});