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 1 commit
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
2 changes: 1 addition & 1 deletion app/src/components/InstrumentSettings/InstrumentInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)/
Copy link
Contributor

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>
    // ...
  )


const LABEL_BY_MOUNT = {
left: 'Left pipette',
Expand Down