Skip to content

Commit

Permalink
reformat deck configuration setup list on desktop and remove moam hel…
Browse files Browse the repository at this point in the history
…p for flex
  • Loading branch information
b-cooper committed Apr 2, 2024
1 parent 1977256 commit 746600e
Show file tree
Hide file tree
Showing 12 changed files with 327 additions and 333 deletions.
1 change: 1 addition & 0 deletions app/src/assets/localization/en/device_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"deck_fixture_setup_modal_bottom_description_desktop": "For detailed instructions for different types of fixtures, scan the QR code or go to the link below.",
"deck_fixture_setup_modal_bottom_description": "For details on installing different fixture types, scan the QR code or search for “deck configuration” on support.opentrons.com",
"deck_fixture_setup_modal_top_description": "First, unscrew and remove the deck slot where you'll install a fixture. Then put the fixture in place and attach it as needed.",
"deck_hardware": "deck hardware",
"deck_slot": "deck slot {{slot}}",
"delete_run": "Delete protocol run record",
"detach_gripper": "Detach gripper",
Expand Down
2 changes: 2 additions & 0 deletions app/src/assets/localization/en/protocol_setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"deck_conflict_info_thermocycler": "<block>Update the deck configuration by removing the fixtures in locations <strong>A1 and B1</strong>. Either remove the fixtures from the deck configuration or update the protocol.</block>",
"deck_conflict_info": "<block>Update the deck configuration by removing the <strong>{{currentFixture}}</strong> in location <strong>{{cutout}}</strong>. Either remove the fixture from the deck configuration or update the protocol.</block>",
"deck_conflict": "Deck location conflict",
"deck_hardware": "Deck hardware",
"deck_map": "Deck Map",
"default_values": "Default values",
"example": "Example",
Expand Down Expand Up @@ -260,6 +261,7 @@
"updated": "Updated",
"usb_connected_no_port_info": "USB Port Connected",
"usb_port_connected": "USB Port {{port}}",
"usb_port_number": "USB-{{port}}",
"value": "Value",
"values_are_view_only": "Values are view-only",
"view_current_offsets": "View current offsets",
Expand Down
21 changes: 5 additions & 16 deletions app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
SINGLE_LEFT_CUTOUTS,
getDeckDefFromRobotType,
FLEX_ROBOT_TYPE,
SINGLE_CENTER_CUTOUTS,
getFixtureGroupForCutoutFixture,
} from '@opentrons/shared-data'

Expand All @@ -46,7 +45,7 @@ import { AddFixtureModal } from './AddFixtureModal'
import { useIsRobotViewable, useRunStatuses } from '../Devices/hooks'
import { useIsEstopNotDisengaged } from '../../resources/devices/hooks/useIsEstopNotDisengaged'

import type { CutoutConfig, CutoutFixtureId, CutoutId, DeckConfiguration } from '@opentrons/shared-data'
import type { CutoutFixtureId, CutoutId } from '@opentrons/shared-data'

const DECK_CONFIG_REFETCH_INTERVAL = 5000
const RUN_REFETCH_INTERVAL = 5000
Expand All @@ -62,7 +61,7 @@ function getDisplayLocationForFixtureGroup(cutouts: CutoutId[]): string {
export function DeviceDetailsDeckConfiguration({
robotName,
}: DeviceDetailsDeckConfigurationProps): JSX.Element | null {
const { t } = useTranslation('device_details')
const { t, i18n } = useTranslation('device_details')
const [
showSetupInstructionsModal,
setShowSetupInstructionsModal,
Expand Down Expand Up @@ -184,11 +183,7 @@ export function DeviceDetailsDeckConfiguration({
width="100%"
borderBottom={BORDERS.lineBorder}
>
<StyledText
as="h3"
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
id="DeckConfiguration_title"
>
<StyledText as="h3" fontWeight={TYPOGRAPHY.fontWeightSemiBold}>
{`${robotName} ${t('deck_configuration')}`}
</StyledText>
<Link
Expand Down Expand Up @@ -226,9 +221,7 @@ export function DeviceDetailsDeckConfiguration({
) : null}
<Flex css={DECK_CONFIG_SECTION_STYLE}>
<Flex
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
marginLeft={`-${SPACING.spacing32}`}
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
marginTop={`-${SPACING.spacing6}`}
flexDirection={DIRECTION_COLUMN}
>
Expand All @@ -254,7 +247,7 @@ export function DeviceDetailsDeckConfiguration({
css={TYPOGRAPHY.labelSemiBold}
>
<StyledText flex="1 0 30px">{t('location')}</StyledText>
<StyledText flex="9 1 0">{t('fixture')}</StyledText>
<StyledText flex="9 1 0">{i18n.format(t('deck_hardware'), 'capitalize')}</StyledText>
</Flex>
{fixtureDisplayList.length > 0 ? (
fixtureDisplayList.map(({ displayLocation, displayName }) => (
Expand Down Expand Up @@ -296,11 +289,7 @@ export function DeviceDetailsDeckConfiguration({
paddingBottom={SPACING.spacing24}
width="100%"
>
<StyledText
as="p"
color={COLORS.grey40}
id="InstrumentsAndModules_offline"
>
<StyledText as="p" color={COLORS.grey40}>
{t('offline_deck_configuration')}
</StyledText>
</Flex>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
import * as React from 'react'
import { createPortal } from 'react-dom'
import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
import {
ALIGN_FLEX_END,
ALIGN_STRETCH,
Box,
DIRECTION_COLUMN,
DIRECTION_ROW,
Flex,
Icon,
JUSTIFY_SPACE_BETWEEN,
Link,
PrimaryButton,
SPACING,
StyledText,
TYPOGRAPHY,
} from '@opentrons/components'
import { getTopPortalEl } from '../../../../App/portal'
import { Banner } from '../../../../atoms/Banner'
import { LegacyModal } from '../../../../molecules/LegacyModal'
import { getIsOnDevice } from '../../../../redux/config'
import { Modal } from '../../../../molecules/Modal'
import multipleModuleHelp from '../../../../assets/images/Moam_modal_image.png'
import multipleModuleHelpOdd from '../../../../assets/images/on-device-display/multiple_modules_modal.png'

const HOW_TO_MULTIPLE_MODULES_HREF =
'https://support.opentrons.com/s/article/Using-modules-of-the-same-type-on-the-OT-2'

export function OT2MultipleModulesHelp(): JSX.Element {
const { t } = useTranslation(['protocol_setup', 'shared'])
const [
showMultipleModulesModal,
setShowMultipleModulesModal,
] = React.useState<boolean>(false)

const onCloseClick = () => setShowMultipleModulesModal(false)
const isOnDevice = useSelector(getIsOnDevice)
return (
<>
<Box marginTop={SPACING.spacing8}>
<Banner
iconMarginRight={SPACING.spacing16}
iconMarginLeft={SPACING.spacing8}
size={SPACING.spacing20}
type="informing"
onCloseClick={() => setShowMultipleModulesModal(true)}
closeButton={
<StyledText
as="p"
textDecoration={TYPOGRAPHY.textDecorationUnderline}
marginRight={SPACING.spacing8}
>
{t('learn_more')}
</StyledText>
}
>
<Flex flexDirection={DIRECTION_COLUMN}>
<StyledText css={TYPOGRAPHY.pSemiBold}>
{t('multiple_modules')}
</StyledText>
<StyledText as="p">{t('view_moam')}</StyledText>
</Flex>
</Banner>
</Box>
{
showMultipleModulesModal ?
createPortal(
isOnDevice ? (
<Modal
onOutsideClick={onCloseClick}
modalSize="large"
header={{
title: t('multiple_modules_modal'),
hasExitIcon: true,
onClick: onCloseClick,
}}
>
<Flex
flexDirection={DIRECTION_ROW}
justifyContent={JUSTIFY_SPACE_BETWEEN}
gridGap={SPACING.spacing40}
>
<StyledText as="p">{t('multiple_of_most_modules')}</StyledText>
<img
width="428px"
height="404px"
src={multipleModuleHelpOdd}
style={{ flex: '1 0 0', alignSelf: ALIGN_STRETCH }}
alt="2 temperature modules plugged into the usb ports"
/>
</Flex>
</Modal>
) : (
<LegacyModal
title={t('multiple_modules_modal')}
onClose={onCloseClick}
width="44.75rem"
>
<Flex flexDirection={DIRECTION_COLUMN}>
<Flex flexDirection={DIRECTION_ROW}>
<Flex flexDirection={DIRECTION_COLUMN} marginRight="3.625rem">
<StyledText as="p" marginBottom={SPACING.spacing16}>
{t('multiple_modules_explanation')}
</StyledText>
<Link
external
css={TYPOGRAPHY.linkPSemiBold}
href={HOW_TO_MULTIPLE_MODULES_HREF}
target="_blank"
rel="noopener noreferrer"
marginBottom={SPACING.spacing16}
>
{t('multiple_modules_learn_more')}
<Icon
name="open-in-new"
marginLeft={SPACING.spacing4}
size="0.625rem"
/>
</Link>
<StyledText
css={TYPOGRAPHY.pSemiBold}
marginBottom={SPACING.spacing4}
>
{t('example')}
</StyledText>

<StyledText as="p">{t('multiple_modules_example')}</StyledText>
</Flex>
<img
height="100%"
width="288px"
src={multipleModuleHelp}
style={{ marginBottom: SPACING.spacing16 }}
alt="2 temperature modules plugged into the usb ports"
/>
</Flex>
<PrimaryButton
onClick={onCloseClick}
textTransform={TYPOGRAPHY.textTransformCapitalize}
alignSelf={ALIGN_FLEX_END}
>
{t('shared:close')}
</PrimaryButton>
</Flex>
</LegacyModal>
),
getTopPortalEl()
) : null
}
</>
)
}
Loading

0 comments on commit 746600e

Please sign in to comment.