Skip to content

Commit

Permalink
feat(app): Implement LPC Redesign Header on ODD (#17449)
Browse files Browse the repository at this point in the history
Closes EXEC-1131
  • Loading branch information
mjhuff authored Feb 6, 2025
1 parent 94bd0e9 commit db4640f
Show file tree
Hide file tree
Showing 30 changed files with 793 additions and 610 deletions.
6 changes: 6 additions & 0 deletions app/src/assets/localization/en/labware_position_check.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
"confirm_detached": "Confirm removal",
"confirm_pick_up_tip_modal_title": "Did the pipette pick up a tip successfully?",
"confirm_pick_up_tip_modal_try_again_text": "No, try again",
"confirm_placement": "Confirm placement",
"confirm_position_and_move": "Confirm position, move to slot {{next_slot}}",
"confirm_position_and_pick_up_tip": "Confirm position, pick up tip",
"confirm_position_and_return_tip": "Confirm position, return tip to Slot {{next_slot}} and home",
"confirm_removal": "Confirm removal",
"continue": "Continue",
"default_labware_offset": "Default Labware Offset",
"detach_probe": "Remove calibration probe",
"ensure_nozzle_position_desktop": "<block>Ensure that the {{tip_type}} is centered above and level with {{item_location}}. If it isn't, use the controls below or your keyboard to jog the pipette until it is properly aligned.</block>",
"ensure_nozzle_position_odd": "<block>Ensure that the {{tip_type}} is centered above and level with {{item_location}}. If it isn't, tap <bold>Move pipette</bold> and then jog the pipette until it is properly aligned.</block>",
"exit": "Exit",
"exit_screen_confirm_exit": "Exit and discard all labware offsets",
"exit_screen_go_back": "Go back to labware position check",
"exit_screen_subtitle": "If you exit now, all labware offsets will be discarded. This cannot be undone.",
Expand Down Expand Up @@ -104,6 +108,7 @@
"robot_in_motion": "Stand back, robot is in motion.",
"run": "Run",
"run_labware_position_check": "run labware position check",
"save": "Save",
"secondary_pipette_tipracks_section": "Check tip racks with {{secondary_mount}} Pipette",
"see_how_offsets_work": "See how labware offsets work",
"select_labware_from_list": "Select a labware from the list to check its stored offset data",
Expand All @@ -115,6 +120,7 @@
"stored_offsets_for_this_protocol": "Stored Labware Offset data that applies to this protocol",
"table_view": "Table View",
"tip_rack": "tip rack",
"try_again": "Try again",
"view_current_offsets": "view current offsets",
"view_data": "View data",
"what_is_labware_offset_data": "What is labware offset data?"
Expand Down
150 changes: 0 additions & 150 deletions app/src/organisms/LabwarePositionCheck/ExitConfirmation.tsx

This file was deleted.

47 changes: 47 additions & 0 deletions app/src/organisms/LabwarePositionCheck/LPCContentContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { css } from 'styled-components'

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

import { StepMeter } from '/app/atoms/StepMeter'
// TODO(jh, 02-05-25): Move ChildNavigation to molecules.
// eslint-disable-next-line opentrons/no-imports-across-applications
import { ChildNavigation } from '/app/organisms/ODD/ChildNavigation'
import { useSelector } from 'react-redux'
import { selectStepInfo } from '/app/redux/protocol-runs'

// eslint-disable-next-line opentrons/no-imports-across-applications
import type { ChildNavigationProps } from '/app/organisms/ODD/ChildNavigation'
import type { LPCWizardContentProps } from '/app/organisms/LabwarePositionCheck/types'

type LPCContentContainerProps = LPCWizardContentProps &
Partial<ChildNavigationProps> & {
children: JSX.Element
header: string
}

export function LPCContentContainer({
children,
runId,
...rest
}: LPCContentContainerProps): JSX.Element {
const { currentStepIndex, totalStepCount } = useSelector(
selectStepInfo(runId)
)

return (
<>
<StepMeter totalSteps={totalStepCount} currentStep={currentStepIndex} />
<ChildNavigation {...rest} css={CHILD_NAV_STYLE} />
<Flex css={CHILDREN_CONTAINER_STYLE}>{children}</Flex>
</>
)
}

// TODO(jh, 02-05-25): Investigate whether we can remove the position: fixed styling from ChildNav.
const CHILD_NAV_STYLE = css`
top: ${SPACING.spacing8};
`
const CHILDREN_CONTAINER_STYLE = css`
margin-top: 7.75rem;
flex-direction: ${DIRECTION_COLUMN};
`
95 changes: 47 additions & 48 deletions app/src/organisms/LabwarePositionCheck/LPCErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,62 +22,61 @@ import {
import { i18n } from '/app/i18n'

import type { LPCWizardContentProps } from '/app/organisms/LabwarePositionCheck/types'
import { LPCContentContainer } from '/app/organisms/LabwarePositionCheck/LPCContentContainer'

const SUPPORT_EMAIL = '[email protected]'

export function LPCErrorModal({
commandUtils,
onCloseClick,
}: LPCWizardContentProps): JSX.Element {
export function LPCErrorModal(props: LPCWizardContentProps): JSX.Element {
const { t } = useTranslation(['labware_position_check', 'shared', 'branded'])
const { errorMessage, toggleRobotMoving } = commandUtils

const handleClose = (): void => {
void toggleRobotMoving(true).then(() => {
onCloseClick()
})
}
const { errorMessage, headerCommands } = props.commandUtils

return (
<ModalContainer
padding={SPACING.spacing32}
flexDirection={DIRECTION_COLUMN}
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_SPACE_BETWEEN}
gridGap={SPACING.spacing16}
<LPCContentContainer
{...props}
header={t('labware_position_check_title')}
onClickButton={headerCommands.handleClose}
buttonText={t('exit')}
>
<Icon
name="ot-alert"
size="2.5rem"
color={COLORS.red50}
aria-label="alert"
/>
<ErrorHeader>
{i18n.format(t('shared:something_went_wrong'), 'sentenceCase')}
</ErrorHeader>
<ContentWrapper>
<LegacyStyledText
as="p"
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
textAlign={TEXT_ALIGN_CENTER}
>
{t('remove_probe_before_exit')}
</LegacyStyledText>
<LegacyStyledText as="p" textAlign={TEXT_ALIGN_CENTER}>
{t('branded:help_us_improve_send_error_report', {
support_email: SUPPORT_EMAIL,
})}
</LegacyStyledText>
</ContentWrapper>
<ErrorTextArea readOnly value={errorMessage ?? ''} spellCheck={false} />
<PrimaryButton
textTransform={TEXT_TRANSFORM_CAPITALIZE}
alignSelf={ALIGN_FLEX_END}
onClick={handleClose}
<ModalContainer
padding={SPACING.spacing32}
flexDirection={DIRECTION_COLUMN}
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_SPACE_BETWEEN}
gridGap={SPACING.spacing16}
>
{t('shared:exit')}
</PrimaryButton>
</ModalContainer>
<Icon
name="ot-alert"
size="2.5rem"
color={COLORS.red50}
aria-label="alert"
/>
<ErrorHeader>
{i18n.format(t('shared:something_went_wrong'), 'sentenceCase')}
</ErrorHeader>
<ContentWrapper>
<LegacyStyledText
as="p"
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
textAlign={TEXT_ALIGN_CENTER}
>
{t('remove_probe_before_exit')}
</LegacyStyledText>
<LegacyStyledText as="p" textAlign={TEXT_ALIGN_CENTER}>
{t('branded:help_us_improve_send_error_report', {
support_email: SUPPORT_EMAIL,
})}
</LegacyStyledText>
</ContentWrapper>
<ErrorTextArea readOnly value={errorMessage ?? ''} spellCheck={false} />
<PrimaryButton
textTransform={TEXT_TRANSFORM_CAPITALIZE}
alignSelf={ALIGN_FLEX_END}
onClick={headerCommands.handleClose}
>
{t('shared:exit')}
</PrimaryButton>
</ModalContainer>
</LPCContentContainer>
)
}

Expand Down
37 changes: 37 additions & 0 deletions app/src/organisms/LabwarePositionCheck/LPCProbeNotAttached.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { useSelector } from 'react-redux'
import { useTranslation } from 'react-i18next'

import { ProbeNotAttached } from '/app/organisms/PipetteWizardFlows/ProbeNotAttached'
import { getIsOnDevice } from '/app/redux/config'
import { LPCContentContainer } from '/app/organisms/LabwarePositionCheck/LPCContentContainer'

import type { LPCWizardContentProps } from '/app/organisms/LabwarePositionCheck/types'

// TODO(jh, 02-05-25): EXEC-1190.
export function LPCProbeNotAttached(props: LPCWizardContentProps): JSX.Element {
const { t } = useTranslation('labware_position_check')
const { commandUtils } = props
const { setShowUnableToDetect, headerCommands } = commandUtils
const isOnDevice = useSelector(getIsOnDevice)

return (
<LPCContentContainer
{...props}
header={t('labware_position_check_title')}
buttonText={t('try_again')}
onClickButton={headerCommands.handleAttachProbeCheck}
secondaryButtonProps={{
buttonText: t('exit'),
buttonCategory: 'rounded',
buttonType: 'tertiaryLowLight',
onClick: headerCommands.handleNavToDetachProbe,
}}
>
<ProbeNotAttached
handleOnClick={() => null}
setShowUnableToDetect={setShowUnableToDetect}
isOnDevice={isOnDevice}
/>
</LPCContentContainer>
)
}
Loading

0 comments on commit db4640f

Please sign in to comment.