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): Fix modules not populating the modules card #3278

Merged
merged 2 commits into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion api/src/opentrons/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, module, context=None):
self.id = id(module)
if isinstance(module, labware.ModuleGeometry):
self.name = module.load_name
self.slow = module.parent
self.slot = module.parent
else:
self.name = module.get_name()
self.slot = module.parent.get_name()
Expand Down
10 changes: 8 additions & 2 deletions app/src/components/InstrumentSettings/ModulesCardContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ import * as React from 'react'
import type {Module} from '../../http-api-client'
import ModuleItem, {NoModulesMessage} from '../ModuleItem'

import filter from 'lodash/filter'

type Props = {
modules: ?Array<Module>,
showThermo: boolean,
}

export default function ModulesCardContents (props: Props) {
const {modules, showThermo} = props
if (!modules || !modules[0] || !showThermo) return <NoModulesMessage />
const {showThermo} = props
const modules = filter(props.modules, m => {
return showThermo || m.name !== 'thermocycler'
})

if (modules.length === 0) return <NoModulesMessage />

return (
<React.Fragment>
Expand Down