Skip to content

Commit

Permalink
Move telemetry event
Browse files Browse the repository at this point in the history
  • Loading branch information
julieg18 committed Jun 30, 2023
1 parent 9daac17 commit f7974bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
12 changes: 6 additions & 6 deletions extension/src/plots/webview/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,6 @@ export class WebviewMessages {
}

private async exportPlotAsRawData(plotId: string, data?: PlainObject) {
sendTelemetryEvent(
EventName.VIEWS_PLOTS_EXPORT_PLOT_AS_RAW_DATA,
undefined,
undefined
)

const file = await window.showSaveDialog({
defaultUri: Uri.file('data.json'),
filters: { JSON: ['json'] }
Expand All @@ -360,6 +354,12 @@ export class WebviewMessages {
return
}

sendTelemetryEvent(
EventName.VIEWS_PLOTS_EXPORT_PLOT_AS_RAW_DATA,
undefined,
undefined
)

const selectedRevisions = this.plots.getSelectedRevisionDetails()

this.plots.saveAsPlotRawData(selectedRevisions, plotId, file.path, data)
Expand Down
7 changes: 1 addition & 6 deletions extension/src/test/suite/plots/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,7 @@ suite('Plots Test Suite', () => {

expect(mockWriteJson).not.to.be.calledOnce
expect(mockOpenFile).not.to.be.calledOnce
expect(mockSendTelemetryEvent).to.be.called
expect(mockSendTelemetryEvent).to.be.calledWithExactly(
EventName.VIEWS_PLOTS_EXPORT_PLOT_AS_RAW_DATA,
undefined,
undefined
)
expect(mockSendTelemetryEvent).not.to.be.called

const exportFileEvent = new Promise(resolve =>
mockShowSaveDialog.onSecondCall().callsFake(() => {
Expand Down

0 comments on commit f7974bb

Please sign in to comment.