-
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): Allow valid pipette+ model names for display images #3413
Conversation
@@ -21,7 +21,7 @@ type Props = { | |||
} | |||
|
|||
// TODO(mc, 2018-03-30): volume and channels should come from the API | |||
const RE_CHANNELS = /p\d+_(single|multi)/ | |||
const RE_CHANNELS = /p(\d+|\+\d+)_(single|multi)/ |
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.
Given the TODO above, could we address the underlying problem rather than continue to rely on this regex?
// ...
import { getPipetteModelSpecs } from '@opentrons/shared-data'
// ...
export default function PipetteInfo(props: Props) {
const { mount, model, name, onChangeClick, showSettings } = props
const label = LABEL_BY_MOUNT[mount]
const pipette = model ? getPipetteModelSpecs(model) : null
const channels = pipette?.channels
// ...
return (
// ...
<div className={styles.image}>
{channels && (
<InstrumentDiagram
channels={channels}
className={styles.pipette_diagram}
/>
)}
</div>
// ...
)
Codecov Report
@@ Coverage Diff @@
## edge #3413 +/- ##
==========================================
- Coverage 52.59% 51.58% -1.01%
==========================================
Files 775 800 +25
Lines 22980 23711 +731
==========================================
+ Hits 12086 12232 +146
- Misses 10894 11479 +585
Continue to review full report at Codecov.
|
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.
💸
overview
Closes #3340. Due to the format of the pipette+ model names, images were not automatically being displayed on the instruments card.
changelog
attached instruments card
review requests
@mcous I see that you made a note that volumes and channels should come from API, should that be the correct implementation here or is changing the expression sufficient?