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,5 +1,6 @@
import { ContentRef } from "@nteract/core";
import { CellId } from "@nteract/commutable";
import { ContentRef } from "@nteract/core";
import { Action } from "../../../Shared/Telemetry/TelemetryConstants";
export const CLOSE_NOTEBOOK = "CLOSE_NOTEBOOK";
export interface CloseNotebookAction {
@@ -81,3 +82,24 @@ export const setHoveredCell = (payload: { cellId: CellId }): SetHoveredCellActio
payload
};
};
export const TRACE_NOTEBOOK_TELEMETRY = "TRACE_NOTEBOOK_TELEMETRY";
export interface TraceNotebookTelemetryAction {
type: "TRACE_NOTEBOOK_TELEMETRY";
payload: {
action: Action;
actionModifier?: string;
data?: any;
};
}
export const traceNotebookTelemetry = (payload: {
action: Action;
actionModifier?: string;
data?: any;
}): TraceNotebookTelemetryAction => {
return {
type: TRACE_NOTEBOOK_TELEMETRY,
payload
};
};