Skip to content
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

Merged
merged 2 commits into from
May 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions app/src/components/InstrumentSettings/InstrumentInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import cx from 'classnames'

import type { Mount } from '../../robot'

import { getPipetteModelSpecs } from '@opentrons/shared-data'
import {
LabeledValue,
OutlineButton,
Expand All @@ -20,9 +21,6 @@ type Props = {
showSettings: boolean,
}

// TODO(mc, 2018-03-30): volume and channels should come from the API
const RE_CHANNELS = /p\d+_(single|multi)/

const LABEL_BY_MOUNT = {
left: 'Left pipette',
right: 'Right pipette',
Expand All @@ -31,8 +29,8 @@ const LABEL_BY_MOUNT = {
export default function PipetteInfo(props: Props) {
const { mount, model, name, onChangeClick, showSettings } = props
const label = LABEL_BY_MOUNT[mount]
const channelsMatch = model && model.match(RE_CHANNELS)
const channels = channelsMatch && channelsMatch[1]
const pipette = model ? getPipetteModelSpecs(model) : null
const channels = pipette?.channels
const direction = model ? 'change' : 'attach'

const changeUrl = `/robots/${name}/instruments/pipettes/change/${mount}`
Expand Down Expand Up @@ -62,7 +60,7 @@ export default function PipetteInfo(props: Props) {
<div className={styles.image}>
{channels && (
<InstrumentDiagram
channels={channels === 'multi' ? 8 : 1}
channels={channels}
className={styles.pipette_diagram}
/>
)}
Expand Down