Skip to content

feat(app): remove event tracking from aspirate tab and dispense tab #18054

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

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
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: 1 addition & 11 deletions app/src/organisms/ODD/QuickTransferFlow/Aspirate/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { useState, useEffect } from 'react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'

import { DIRECTION_COLUMN, Flex, SPACING } from '@opentrons/components'

import { ANALYTICS_QUICK_TRANSFER_ADVANCED_SETTINGS_TAB } from '/app/redux/analytics'
import { useTrackEventWithRobotSerial } from '/app/redux-resources/analytics'
import { MediumButton } from '/app/atoms/buttons'
import { AspirateSettingItem } from './AspirateSettingItem'
import { AspirateSettingDetail } from './AspirateSettingDetail'
Expand All @@ -30,14 +28,6 @@ export function Aspirate(props: AspirateProps): JSX.Element | null {
selectedSetting,
setSelectedSetting,
] = useState<AspirateSettingOption | null>(null)
const { trackEventWithRobotSerial } = useTrackEventWithRobotSerial()

useEffect(() => {
trackEventWithRobotSerial({
name: ANALYTICS_QUICK_TRANSFER_ADVANCED_SETTINGS_TAB,
properties: {},
})
}, [])

const aspirateSettingsItems = useAspirateSettingsConfig({
state,
Expand Down
12 changes: 1 addition & 11 deletions app/src/organisms/ODD/QuickTransferFlow/Dispense/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { useState, useEffect } from 'react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'

import { DIRECTION_COLUMN, Flex, SPACING } from '@opentrons/components'

import { MediumButton } from '/app/atoms/buttons'
import { ANALYTICS_QUICK_TRANSFER_ADVANCED_SETTINGS_TAB } from '/app/redux/analytics'
import { useTrackEventWithRobotSerial } from '/app/redux-resources/analytics'
import { DispenseSettingDetail } from './DispenseSettingDetail'
import { DispenseSettingItem } from './DispenseSettingItem'
import { useDispenseSettingsConfig } from './hooks/useDispenseSettingsConfig'
Expand All @@ -31,19 +29,11 @@ export function Dispense(props: DispenseProps): JSX.Element | null {
selectedSetting,
setSelectedSetting,
] = useState<DispenseSettingOption | null>(null)
const { trackEventWithRobotSerial } = useTrackEventWithRobotSerial()
const dispenseSettingsItems = useDispenseSettingsConfig({
state,
setSelectedSetting,
})

useEffect(() => {
trackEventWithRobotSerial({
name: ANALYTICS_QUICK_TRANSFER_ADVANCED_SETTINGS_TAB,
properties: {},
})
}, [])

return (
<Flex
gridGap={SPACING.spacing40}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { describe, it, vi, beforeEach, expect } from 'vitest'
import { screen } from '@testing-library/react'

import { useTrackEventWithRobotSerial } from '/app/redux-resources/analytics'
import { renderWithProviders } from '/app/__testing-utils__'
import { i18n } from '/app/i18n'

Expand All @@ -13,7 +12,6 @@ import { Aspirate } from '../../Aspirate'

import type { ComponentProps } from 'react'

vi.mock('/app/redux-resources/analytics')
vi.mock('../../Aspirate/AspirateSettingItem')
vi.mock('../../Aspirate/AspirateSettingDetail')
vi.mock('../../Aspirate/hooks/useAspirateSettingsConfig')
Expand Down Expand Up @@ -92,8 +90,6 @@ const mockAspirateSettingsItems = [
},
] as any

let mockTrackEventWithRobotSerial: any

describe('Aspirate', () => {
let props: ComponentProps<typeof Aspirate>

Expand Down Expand Up @@ -166,12 +162,6 @@ describe('Aspirate', () => {
vi.mocked(useAspirateSettingsConfig).mockReturnValue(
mockAspirateSettingsItems
)
mockTrackEventWithRobotSerial = vi.fn(
() => new Promise(resolve => resolve({}))
)
vi.mocked(useTrackEventWithRobotSerial).mockReturnValue({
trackEventWithRobotSerial: mockTrackEventWithRobotSerial,
})
})

it('renders mock components and reset button', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { describe, it, vi, beforeEach, expect } from 'vitest'
import { screen } from '@testing-library/react'

import { useTrackEventWithRobotSerial } from '/app/redux-resources/analytics'
import { renderWithProviders } from '/app/__testing-utils__'
import { i18n } from '/app/i18n'

Expand All @@ -12,7 +11,6 @@ import { Dispense } from '../../Dispense'

import type { ComponentProps } from 'react'

vi.mock('/app/redux-resources/analytics')
vi.mock('../../Dispense/DispenseSettingItem')
vi.mock('../../Dispense/DispenseSettingDetail')
vi.mock('../../Dispense/hooks/useAspirateSettingsConfig')
Expand All @@ -23,8 +21,6 @@ const render = (props: ComponentProps<typeof Dispense>) => {
})
}

let mockTrackEventWithRobotSerial: any

describe('Dispense', () => {
let props: ComponentProps<typeof Dispense>

Expand Down Expand Up @@ -94,12 +90,6 @@ describe('Dispense', () => {
vi.mocked(DispenseSettingDetail).mockReturnValue(
<div>mock DispenseSettingDetail</div>
)
mockTrackEventWithRobotSerial = vi.fn(
() => new Promise(resolve => resolve({}))
)
vi.mocked(useTrackEventWithRobotSerial).mockReturnValue({
trackEventWithRobotSerial: mockTrackEventWithRobotSerial,
})
})

it('renders mock components and reset button', () => {
Expand Down
1 change: 1 addition & 0 deletions app/src/redux/analytics/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const ANALYTICS_QUICK_TRANSFER_FLOW_STARTED = 'quickTransferFlowStarted'
export const ANALYTICS_QUICK_TRANSFER_WELL_SELECTION_DURATION =
'quickTransferWellSelectionDuration'
export const ANALYTICS_QUICK_TRANSFER_EXIT_EARLY = 'quickTransferExitEarly'
// ToDo(kk:04/11/2025) the following two tab events will be removed when ff is removed
export const ANALYTICS_QUICK_TRANSFER_ADVANCED_SETTINGS_TAB =
'quickTransferAdvancedSettingsTab'
export const ANALYTICS_QUICK_TRANSFER_TIP_MANAGEMENT_TAB =
Expand Down
Loading