-
Notifications
You must be signed in to change notification settings - Fork 178
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
fix(app): refactor Flex pipette card to reference /instruments #14702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me!
transformOrigin="20% -10%" | ||
/> | ||
<Flex | ||
alignItems={ALIGN_CENTER} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a separate bug, right? Like it's logically equivalent with the new transformOrigin
at the standard viewpoint size, but it reflows better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this code wasn't hit previously because we weren't using InstrumentCard
for pipettes - so I pulled the logic from what was actually being hit which lived here https://github.com/Opentrons/opentrons/blame/edge/app/src/organisms/Devices/PipetteCard/index.tsx#L261 and was recently updated by Nick to fix a styling bug
isEstopNotDisengaged, | ||
}: FlexPipetteCardProps): JSX.Element { | ||
const { t, i18n } = useTranslation(['device_details', 'shared']) | ||
const host = useHost() as HostConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to type this? isn't host already type HostConfig
?
// this gives the instruments endpoint time to start reporting | ||
// a good instrument | ||
React.useEffect(() => { | ||
if (attachedPipette?.ok === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
if (attachedPipette?.ok === false) { | |
if (!attachedPipette?.ok) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be explicit -- we don't want to enter this if statement if attachedPipette
is null or undefined, only if it does exist and ok
is false
import { DropTipWizard } from '../../../DropTipWizard' | ||
|
||
import type { PipetteData } from '@opentrons/api-client' | ||
import { mockLeftSpecs } from '../../../../redux/pipettes/__fixtures__' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import can go higher
pipetteSpecs={pipetteModelSpecs} | ||
mount={mount} | ||
transform="scale(0.3)" | ||
transformOrigin={'20% 52%'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
transformOrigin={'20% 52%'} | |
transformOrigin="20% 52%" |
{attachedPipette?.ok && showAboutPipetteSlideout && ( | ||
<AboutPipetteSlideout | ||
pipetteId={attachedPipette.serialNumber} | ||
pipetteName={pipetteDisplayName ?? attachedPipette.instrumentName} | ||
firmwareVersion={attachedPipette.firmwareVersion} | ||
isExpanded={showAboutPipetteSlideout} | ||
onCloseClick={() => setShowAboutPipetteSlideout(false)} | ||
/> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, to keep the same pattern for easier readability:
{attachedPipette?.ok && showAboutPipetteSlideout && ( | |
<AboutPipetteSlideout | |
pipetteId={attachedPipette.serialNumber} | |
pipetteName={pipetteDisplayName ?? attachedPipette.instrumentName} | |
firmwareVersion={attachedPipette.firmwareVersion} | |
isExpanded={showAboutPipetteSlideout} | |
onCloseClick={() => setShowAboutPipetteSlideout(false)} | |
/> | |
)} | |
{attachedPipette?.ok && showAboutPipetteSlideout ? ( | |
<AboutPipetteSlideout | |
pipetteId={attachedPipette.serialNumber} | |
pipetteName={pipetteDisplayName ?? attachedPipette.instrumentName} | |
firmwareVersion={attachedPipette.firmwareVersion} | |
isExpanded={showAboutPipetteSlideout} | |
onCloseClick={() => setShowAboutPipetteSlideout(false)} | |
/> | |
) : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm, just left some cleanup comments
8454264
to
5292830
Compare
fix RQA-2433
Overview
Currently, the pipette cards on the desktop app for Flex reference
/pipettes
while those on ODD reference/instruments
. This has caused confusion because occasionally the pipettes would be visible on desktop but not ODD. Seth made a change in #14608 that makes the/instruments
response report cached data like/pipettes
does, which should have eliminated this discrepancy. This PR ensures that by using/instruments
as the one source of truth for pipettes on Flex.Test Plan
Smoke test pipette cards and all possible overflow menu actions for both Flex and OT-2 pipettes. This includes OT-2 pipette settings, attach, detach, and calibrate flows, drop tip wizard, and the about pipette menu.
Changelog
FlexPipetteCard
and pull allFlex
specific logic out ofPipetteCard
into here.PipetteCard
andPipetteOverflowMenu
, removing allFlex
logic which has been moved toFlexPipetteCard
and some leftover OT-2 calibration logic that is no longer used since we only allow pipette cal from the calibration dashboard now.InstrumentsAndModules
only enableusePipettesQuery
for OT-2 anduseInstrumentsQuery
for Flex. DisplayPipetteCard
orFlexPipetteCard
accordingly.Review requests
Look through the code - did I miss anything? And test this out if you can!
Risk assessment
Medium