From c29f800ba50fc3642046ca6a4ce44205f32f0e23 Mon Sep 17 00:00:00 2001 From: Jamey Huffnagle Date: Thu, 19 Dec 2024 11:17:19 -0500 Subject: [PATCH] robotType for calibration download analytics --- .../AdvancedTabSlideouts/DeviceResetSlideout.tsx | 5 ++++- .../RobotSettingsCalibration/CalibrationDataDownload.tsx | 6 +++++- .../__tests__/CalibrationDataDownload.test.tsx | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/organisms/Desktop/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx b/app/src/organisms/Desktop/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx index 763ca9f0cb2..bf963b22f29 100644 --- a/app/src/organisms/Desktop/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx +++ b/app/src/organisms/Desktop/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx @@ -20,6 +20,7 @@ import { LegacyStyledText, TYPOGRAPHY, } from '@opentrons/components' +import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data' import { Slideout } from '/app/atoms/Slideout' import { Divider } from '/app/atoms/structure' @@ -107,7 +108,9 @@ export function DeviceResetSlideout({ e.preventDefault() doTrackEvent({ name: ANALYTICS_CALIBRATION_DATA_DOWNLOADED, - properties: {}, + properties: { + robotType: isFlex ? FLEX_ROBOT_TYPE : OT2_ROBOT_TYPE, + }, }) saveAs( new Blob([ diff --git a/app/src/organisms/Desktop/RobotSettingsCalibration/CalibrationDataDownload.tsx b/app/src/organisms/Desktop/RobotSettingsCalibration/CalibrationDataDownload.tsx index 4731df09ae4..83aeddf3e35 100644 --- a/app/src/organisms/Desktop/RobotSettingsCalibration/CalibrationDataDownload.tsx +++ b/app/src/organisms/Desktop/RobotSettingsCalibration/CalibrationDataDownload.tsx @@ -17,6 +17,8 @@ import { useInstrumentsQuery, useModulesQuery, } from '@opentrons/react-api-client' +import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data' + import { TertiaryButton } from '/app/atoms/buttons' import { useDeckCalibrationData, @@ -72,7 +74,9 @@ export function CalibrationDataDownload({ e.preventDefault() doTrackEvent({ name: ANALYTICS_CALIBRATION_DATA_DOWNLOADED, - properties: {}, + properties: { + robotType: isFlex ? FLEX_ROBOT_TYPE : OT2_ROBOT_TYPE, + }, }) saveAs( new Blob([ diff --git a/app/src/organisms/Desktop/RobotSettingsCalibration/__tests__/CalibrationDataDownload.test.tsx b/app/src/organisms/Desktop/RobotSettingsCalibration/__tests__/CalibrationDataDownload.test.tsx index b84b25e2e16..b50a892ca73 100644 --- a/app/src/organisms/Desktop/RobotSettingsCalibration/__tests__/CalibrationDataDownload.test.tsx +++ b/app/src/organisms/Desktop/RobotSettingsCalibration/__tests__/CalibrationDataDownload.test.tsx @@ -16,6 +16,7 @@ import { useModulesQuery, } from '@opentrons/react-api-client' import { instrumentsResponseFixture } from '@opentrons/api-client' +import { OT2_ROBOT_TYPE } from '@opentrons/shared-data' import { i18n } from '/app/i18n' import { @@ -145,7 +146,7 @@ describe('CalibrationDataDownload', () => { fireEvent.click(downloadButton) expect(mockTrackEvent).toHaveBeenCalledWith({ name: ANALYTICS_CALIBRATION_DATA_DOWNLOADED, - properties: {}, + properties: { robotType: OT2_ROBOT_TYPE }, }) })