Skip to content

Commit

Permalink
refactor(app): Add thermocycler to attached modules card behind flag (#…
Browse files Browse the repository at this point in the history
…3220)

closes #3061
  • Loading branch information
Kadee80 authored Mar 25, 2019
1 parent 916a10c commit 7d09d0a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions app/src/components/InstrumentSettings/AttachedModulesCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {connect} from 'react-redux'
import {RefreshCard} from '@opentrons/components'
import {fetchModules, makeGetRobotModules} from '../../http-api-client'
import ModulesCardContents from './ModulesCardContents'
import {getConfig} from '../../config'

import type {State, Dispatch} from '../../types'
import type {Module} from '../../http-api-client'
Expand All @@ -16,6 +17,7 @@ type OP = Robot
type SP = {|
modules: ?Array<Module>,
refreshing: boolean,
__featureEnabled: boolean,
|}

type DP = {|refresh: () => mixed|}
Expand All @@ -38,7 +40,10 @@ function AttachedModulesCard (props: Props) {
refresh={props.refresh}
column
>
<ModulesCardContents modules={props.modules} />
<ModulesCardContents
modules={props.modules}
showThermo={props.__featureEnabled}
/>
</RefreshCard>
)
}
Expand All @@ -50,10 +55,10 @@ function makeSTP (): (state: State, ownProps: OP) => SP {
const modulesCall = getRobotModules(state, ownProps)
const modulesResponse = modulesCall.response
const modules = modulesResponse && modulesResponse.modules

return {
modules: modules,
refreshing: modulesCall.inProgress,
__featureEnabled: !!getConfig(state).devInternal?.enableThermocycler,
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions app/src/components/InstrumentSettings/ModulesCardContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import ModuleItem, {NoModulesMessage} from '../ModuleItem'

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

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

return (
<React.Fragment>
{props.modules.map((mod, index) => (
<ModuleItem module={mod} key={index}/>
{modules.map((mod, index) => (
<ModuleItem module={mod} key={index} />
))}
</React.Fragment>
)
Expand Down
3 changes: 2 additions & 1 deletion app/src/components/ModuleItem/ModuleImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function ModuleImage (props: Props) {
const imgSrc = getModuleImg(props.name)
return (
<div className={styles.module_image_wrapper}>
<img src={imgSrc} className={styles.module_image}/>
<img src={imgSrc} className={styles.module_image} />
</div>
)
}
Expand All @@ -23,4 +23,5 @@ function getModuleImg (name: string) {
const MODULE_IMGS = {
tempdeck: require('./images/[email protected]'),
magdeck: require('./images/[email protected]'),
thermocycler: require('./images/[email protected]'),
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export type Config = {
devInternal?: {
allPipetteConfig?: boolean,
manualIp?: boolean,
enableThermocycler?: boolean,
},
}

Expand Down

0 comments on commit 7d09d0a

Please sign in to comment.