Skip to content

Commit

Permalink
fix(app): remove subsystem update link from instrument card
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Feb 13, 2024
1 parent 8dc44b0 commit dc5f48a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 66 deletions.
3 changes: 1 addition & 2 deletions app/src/assets/localization/en/device_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
"estop_disengaged": "E-stop disengaged, but robot operation still halted.",
"estop_pressed": "E-stop pressed. Robot movement is halted.",
"failed": "failed",
"firmware_update_available_now_without_link": "Firmware update available.",
"firmware_update_available_now": "Firmware update available. <updateLink>Update now</updateLink>",
"firmware_update_needed": "Instrument firmware update needed. Start the update on the robot's touchscreen.",
"firmware_update_available": "Firmware update available.",
"firmware_update_failed": "Failed to update module firmware",
"firmware_update_installation_successful": "Installation successful",
Expand Down
21 changes: 0 additions & 21 deletions app/src/organisms/Devices/InstrumentsAndModules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {

import {
Flex,
ModalShell,
ALIGN_CENTER,
ALIGN_FLEX_START,
COLORS,
Expand All @@ -26,7 +25,6 @@ import { Banner } from '../../atoms/Banner'
import { PipetteRecalibrationWarning } from './PipetteCard/PipetteRecalibrationWarning'
import { useCurrentRunId } from '../ProtocolUpload/hooks'
import { ModuleCard } from '../ModuleCard'
import { FirmwareUpdateModal } from '../FirmwareUpdateModal'
import { useIsFlex, useIsRobotViewable, useRunStatuses } from './hooks'
import {
getIs96ChannelPipetteAttached,
Expand All @@ -42,7 +40,6 @@ import type {
BadPipette,
GripperData,
PipetteData,
Subsystem,
} from '@opentrons/api-client'

const EQUIPMENT_POLL_MS = 5000
Expand All @@ -65,10 +62,6 @@ export function InstrumentsAndModules({
const currentRunId = useCurrentRunId()
const { isRunTerminal, isRunRunning } = useRunStatuses()
const isFlex = useIsFlex(robotName)
const [
subsystemToUpdate,
setSubsystemToUpdate,
] = React.useState<Subsystem | null>(null)
const isEstopNotDisengaged = useIsEstopNotDisengaged(robotName)

const { data: attachedInstruments } = useInstrumentsQuery({
Expand Down Expand Up @@ -153,17 +146,6 @@ export function InstrumentsAndModules({
flexDirection={DIRECTION_COLUMN}
width="100%"
>
{subsystemToUpdate != null && (
<ModalShell>
<FirmwareUpdateModal
subsystem={subsystemToUpdate}
proceed={() => setSubsystemToUpdate(null)}
description={t('updating_firmware')}
proceedDescription={t('firmware_up_to_date')}
isOnDevice={false}
/>
</ModalShell>
)}
<StyledText
as="h3"
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
Expand Down Expand Up @@ -221,7 +203,6 @@ export function InstrumentsAndModules({
robotName={robotName}
pipetteIs96Channel={is96ChannelAttached}
pipetteIsBad={badLeftPipette != null}
updatePipette={() => setSubsystemToUpdate('pipette_left')}
isRunActive={currentRunId != null && isRunRunning}
isEstopNotDisengaged={isEstopNotDisengaged}
/>
Expand All @@ -233,7 +214,6 @@ export function InstrumentsAndModules({
attachedGripper?.data?.calibratedOffset?.last_modified !=
null
}
setSubsystemToUpdate={setSubsystemToUpdate}
isRunActive={currentRunId != null && isRunRunning}
isEstopNotDisengaged={isEstopNotDisengaged}
/>
Expand Down Expand Up @@ -276,7 +256,6 @@ export function InstrumentsAndModules({
robotName={robotName}
pipetteIs96Channel={false}
pipetteIsBad={badRightPipette != null}
updatePipette={() => setSubsystemToUpdate('pipette_right')}
isRunActive={currentRunId != null && isRunRunning}
isEstopNotDisengaged={isEstopNotDisengaged}
/>
Expand Down
18 changes: 1 addition & 17 deletions app/src/organisms/Devices/PipetteCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,9 @@ interface PipetteCardProps {
robotName: string
pipetteIs96Channel: boolean
pipetteIsBad: boolean
updatePipette: () => void
isRunActive: boolean
isEstopNotDisengaged: boolean
}
const BANNER_LINK_STYLE = css`
text-decoration: underline;
cursor: pointer;
margin-left: ${SPACING.spacing8};
`

const INSTRUMENT_CARD_STYLE = css`
p {
Expand All @@ -91,7 +85,6 @@ export const PipetteCard = (props: PipetteCardProps): JSX.Element => {
pipetteId,
pipetteIs96Channel,
pipetteIsBad,
updatePipette,
isRunActive,
isEstopNotDisengaged,
} = props
Expand Down Expand Up @@ -356,17 +349,8 @@ export const PipetteCard = (props: PipetteCardProps): JSX.Element => {
i18nKey={
subsystemUpdateData != null
? 'firmware_update_occurring'
: 'firmware_update_available_now'
: 'firmware_update_needed'
}
components={{
updateLink: (
<StyledText
as="p"
css={BANNER_LINK_STYLE}
onClick={updatePipette}
/>
),
}}
/>
</Banner>
}
Expand Down
35 changes: 9 additions & 26 deletions app/src/organisms/GripperCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import { GripperWizardFlows } from '../GripperWizardFlows'
import { AboutGripperSlideout } from './AboutGripperSlideout'
import { GRIPPER_FLOW_TYPES } from '../GripperWizardFlows/constants'

import type { BadGripper, GripperData, Subsystem } from '@opentrons/api-client'
import type { BadGripper, GripperData } from '@opentrons/api-client'
import type { GripperWizardFlowType } from '../GripperWizardFlows/types'

interface GripperCardProps {
attachedGripper: GripperData | BadGripper | null
isCalibrated: boolean
setSubsystemToUpdate: (subsystem: Subsystem | null) => void
isRunActive: boolean
isEstopNotDisengaged: boolean
}
Expand All @@ -42,7 +41,6 @@ const POLL_DURATION_MS = 5000
export function GripperCard({
attachedGripper,
isCalibrated,
setSubsystemToUpdate,
isRunActive,
isEstopNotDisengaged,
}: GripperCardProps): JSX.Element {
Expand Down Expand Up @@ -177,29 +175,14 @@ export function GripperCard({
type={subsystemUpdateData != null ? 'warning' : 'error'}
marginBottom={SPACING.spacing4}
>
{isEstopNotDisengaged ? (
<StyledText as="p">
{t('firmware_update_available_now_without_link')}
</StyledText>
) : (
<Trans
t={t}
i18nKey={
subsystemUpdateData != null
? 'firmware_update_occurring'
: 'firmware_update_available_now'
}
components={{
updateLink: (
<StyledText
as="p"
css={BANNER_LINK_CSS}
onClick={() => setSubsystemToUpdate('gripper')}
/>
),
}}
/>
)}
<Trans
t={t}
i18nKey={
subsystemUpdateData != null
? 'firmware_update_occurring'
: 'firmware_update_needed'
}
/>
</Banner>
}
isEstopNotDisengaged={isEstopNotDisengaged}
Expand Down

0 comments on commit dc5f48a

Please sign in to comment.