Skip to content

Commit

Permalink
Revert "feat(app): add privacy policy acknowledgement screen on ODD (#…
Browse files Browse the repository at this point in the history
…14435)"

This reverts commit 67579f4.
  • Loading branch information
b-cooper committed Feb 21, 2024
1 parent 5e588d1 commit 5b70a9c
Show file tree
Hide file tree
Showing 18 changed files with 227 additions and 161 deletions.
7 changes: 0 additions & 7 deletions app/src/App/OnDeviceDisplayApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { ConnectViaWifi } from '../pages/ConnectViaWifi'
import { EmergencyStop } from '../pages/EmergencyStop'
import { NameRobot } from '../pages/NameRobot'
import { NetworkSetupMenu } from '../pages/NetworkSetupMenu'
import { PrivacyPolicy } from '../pages/PrivacyPolicy'
import { ProtocolSetup } from '../pages/ProtocolSetup'
import { RobotDashboard } from '../pages/RobotDashboard'
import { RobotSettingsDashboard } from '../pages/RobotSettingsDashboard'
Expand Down Expand Up @@ -196,12 +195,6 @@ export const onDeviceDisplayRoutes: RouteProps[] = [
name: 'Emergency Stop',
path: '/emergency-stop',
},
{
Component: PrivacyPolicy,
exact: true,
name: 'Privacy Policy',
path: '/privacy-policy',
},
{
Component: DeckConfigurationEditor,
exact: true,
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions app/src/assets/localization/en/device_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"about_calibration_description": "For the robot to move accurately and precisely, you need to calibrate it. Positional calibration happens in three parts: deck calibration, pipette offset calibration and tip length calibration.",
"about_calibration_description_ot3": "<block>For the robot to move accurately and precisely, you need to calibrate it. Pipette and gripper calibration is an automated process that uses a calibration probe or pin.</block><block>After calibration is complete, you can save the calibration data to your computer as a JSON file.</block>",
"about_calibration_title": "About Calibration",
"acknowledge_privacy_policy": "Acknowledge Privacy Policy",
"advanced": "Advanced",
"agree": "I agree",
"alpha_description": "Warning: alpha releases are feature-complete but may contain significant bugs.",
"alternative_security_types": "Alternative security types",
"alternative_security_types_description": "The Opentrons App supports connecting Flex to various enterprise access points. Connect via USB and finish setup in the app.",
Expand Down Expand Up @@ -208,7 +206,6 @@
"pipette_offset_calibration_recommended": "Pipette Offset calibration recommended",
"pipette_offset_calibrations_history": "See all Pipette Offset Calibration history",
"pipette_offset_calibrations_title": "Pipette Offset Calibrations",
"privacy_policy_description": "<block>By proceeding you are agreeing to share robot usage data. Opentrons uses this data to improve our products and services.</block><block>To read more about our data collection policies, visit our Privacy Policy.</block>",
"problem_during_update": "This update is taking longer than usual.",
"proceed_without_updating": "Proceed without update",
"protocol_run_history": "Protocol run History",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function ConfirmRobotName({
}
return (
<>
<StepMeter totalSteps={5} currentStep={5} />
<StepMeter totalSteps={6} currentStep={6} />
<Flex
padding={`${SPACING.spacing32} ${SPACING.spacing40} ${SPACING.spacing40}`}
flexDirection={DIRECTION_COLUMN}
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/ConnectViaEthernet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function ConnectViaEthernet(): JSX.Element {

return (
<>
<StepMeter totalSteps={5} currentStep={1} />
<StepMeter totalSteps={6} currentStep={2} />
<Flex
margin={`${SPACING.spacing32} ${SPACING.spacing40} ${SPACING.spacing40}`}
flexDirection={DIRECTION_COLUMN}
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/ConnectViaUSB/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function ConnectViaUSB(): JSX.Element {

return (
<>
<StepMeter totalSteps={5} currentStep={1} />
<StepMeter totalSteps={6} currentStep={2} />
<Flex
flexDirection={DIRECTION_COLUMN}
gridGap={SPACING.spacing32}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('ConnectViaWifi', () => {
render()
screen.getByTestId('StepMeter_StepMeterContainer')
const bar = screen.getByTestId('StepMeter_StepMeterBar')
expect(bar).toHaveStyle('width: 20%')
expect(bar).toHaveStyle('width: 33.33333333333333%')
})

it('should render Searching for networks', () => {
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/ConnectViaWifi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function ConnectViaWifi(): JSX.Element {

return (
<>
<StepMeter totalSteps={5} currentStep={1} />
<StepMeter totalSteps={6} currentStep={2} />
<Flex
flexDirection={DIRECTION_COLUMN}
// subtract height of StepMeter
Expand Down
15 changes: 2 additions & 13 deletions app/src/pages/EmergencyStop/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { useHistory } from 'react-router-dom'
import { useSelector } from 'react-redux'

import {
Icon,
Expand All @@ -15,10 +14,6 @@ import {
TYPOGRAPHY,
} from '@opentrons/components'
import { useEstopQuery } from '@opentrons/react-api-client'
import {
getAnalyticsOptInSeen,
getAnalyticsOptedIn,
} from '../../redux/analytics'

import { StyledText } from '../../atoms/text'
import { MediumButton } from '../../atoms/buttons'
Expand All @@ -31,8 +26,6 @@ const ESTOP_STATUS_REFETCH_INTERVAL_MS = 10000
export function EmergencyStop(): JSX.Element {
const { i18n, t } = useTranslation(['device_settings', 'shared'])
const history = useHistory()
const seenOptIn = useSelector(getAnalyticsOptInSeen)
const optedIn = useSelector(getAnalyticsOptedIn)

// Note here the touchscreen app is using status since status is linked to EstopPhysicalStatuses
// left notPresent + right disengaged => disengaged
Expand All @@ -45,7 +38,7 @@ export function EmergencyStop(): JSX.Element {

return (
<>
<StepMeter totalSteps={5} currentStep={2} />
<StepMeter totalSteps={6} currentStep={4} />
<Flex
flexDirection={DIRECTION_COLUMN}
gridGap={SPACING.spacing32}
Expand Down Expand Up @@ -105,11 +98,7 @@ export function EmergencyStop(): JSX.Element {
flex="1"
buttonText={i18n.format(t('shared:continue'), 'capitalize')}
disabled={!isEstopConnected}
onClick={() => {
seenOptIn && optedIn
? history.push('/robot-settings/rename-robot')
: history.push('/privacy-policy')
}}
onClick={() => history.push('/robot-settings/rename-robot')}
/>
</Flex>
</>
Expand Down
7 changes: 7 additions & 0 deletions app/src/pages/NameRobot/__tests__/NameRobot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,11 @@ describe('NameRobot', () => {
screen.getByText('Enter up to 17 characters (letters and numbers only)')
screen.getByText('Confirm')
})

it('should call a mock function when tapping back button', () => {
mockuseIsUnboxingFlowOngoing.mockReturnValue(false)
render()
fireEvent.click(screen.getByTestId('name_back_button'))
expect(mockPush).toHaveBeenCalledWith('/robot-settings')
})
})
18 changes: 16 additions & 2 deletions app/src/pages/NameRobot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
COLORS,
TYPOGRAPHY,
Icon,
Btn,
} from '@opentrons/components'
import { useUpdateRobotNameMutation } from '@opentrons/react-api-client'

Expand Down Expand Up @@ -152,7 +153,7 @@ export function NameRobot(): JSX.Element {
) : (
<>
{isUnboxingFlowOngoing ? (
<StepMeter totalSteps={5} currentStep={4} />
<StepMeter totalSteps={6} currentStep={5} />
) : null}
<Flex
flexDirection={DIRECTION_COLUMN}
Expand All @@ -167,7 +168,20 @@ export function NameRobot(): JSX.Element {
}
position={POSITION_RELATIVE}
>
<Flex position={POSITION_ABSOLUTE} left="0"></Flex>
<Flex position={POSITION_ABSOLUTE} left="0">
<Btn
data-testid="name_back_button"
onClick={() => {
if (isUnboxingFlowOngoing) {
history.push('/emergency-stop')
} else {
history.push('/robot-settings')
}
}}
>
<Icon name="back" size="3rem" color={COLORS.black90} />
</Btn>
</Flex>
<Flex marginLeft={isUnboxingFlowOngoing ? '0' : '4rem'}>
<StyledText as="h2" fontWeight={TYPOGRAPHY.fontWeightBold}>
{isUnboxingFlowOngoing
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/NetworkSetupMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function NetworkSetupMenu(): JSX.Element {

return (
<>
<StepMeter totalSteps={5} currentStep={1} />
<StepMeter totalSteps={6} currentStep={1} />
<Flex
padding={`${SPACING.spacing32} ${SPACING.spacing60} ${SPACING.spacing60}`}
flexDirection={DIRECTION_COLUMN}
Expand Down
106 changes: 0 additions & 106 deletions app/src/pages/PrivacyPolicy/index.tsx

This file was deleted.

91 changes: 91 additions & 0 deletions app/src/pages/RobotDashboard/AnalyticsOptInModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { useDispatch, useSelector } from 'react-redux'

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

import { SmallButton } from '../../atoms/buttons'
import { StyledText } from '../../atoms/text'
import { Modal } from '../../molecules/Modal'
import { updateConfigValue } from '../../redux/config'
import { getLocalRobot } from '../../redux/discovery'
import { updateSetting } from '../../redux/robot-settings'

import type { Dispatch } from '../../redux/types'

export const ROBOT_ANALYTICS_SETTING_ID = 'disableLogAggregation'

interface AnalyticsOptInModalProps {
setShowAnalyticsOptInModal: (showAnalyticsOptInModal: boolean) => void
}

export function AnalyticsOptInModal({
setShowAnalyticsOptInModal,
}: AnalyticsOptInModalProps): JSX.Element {
const { t } = useTranslation(['app_settings', 'shared'])
const dispatch = useDispatch<Dispatch>()

const localRobot = useSelector(getLocalRobot)
const robotName = localRobot?.name != null ? localRobot.name : 'no name'

const handleCloseModal = (): void => {
dispatch(
updateConfigValue(
'onDeviceDisplaySettings.unfinishedUnboxingFlowRoute',
null
)
)
setShowAnalyticsOptInModal(false)
}

const handleOptIn = (): void => {
dispatch(updateSetting(robotName, ROBOT_ANALYTICS_SETTING_ID, false))
dispatch(updateConfigValue('analytics.optedIn', true))
handleCloseModal()
}

const handleOptOut = (): void => {
dispatch(updateSetting(robotName, ROBOT_ANALYTICS_SETTING_ID, true))
dispatch(updateConfigValue('analytics.optedIn', false))
handleCloseModal()
}

return (
<Modal modalSize="medium" header={{ title: t('want_to_help_out') }}>
<Flex flexDirection={DIRECTION_COLUMN}>
<Flex
flexDirection={DIRECTION_COLUMN}
gridGap={SPACING.spacing12}
paddingBottom={SPACING.spacing32}
>
<StyledText as="p" color={COLORS.grey60}>
{t('opt_in_description')}
</StyledText>
</Flex>
<Flex
flexDirection={DIRECTION_ROW}
gridGap={SPACING.spacing8}
width="100%"
>
<SmallButton
flex="1"
buttonText={t('opt_out')}
buttonType="secondary"
onClick={handleOptOut}
/>
<SmallButton
flex="1"
buttonText={t('opt_in')}
onClick={handleOptIn}
/>
</Flex>
</Flex>
</Modal>
)
}
Loading

0 comments on commit 5b70a9c

Please sign in to comment.