-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): Add modules and pipettes settings page (#1785)
- Loading branch information
Showing
23 changed files
with
524 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
app/src/components/InstrumentSettings/AttachedModulesCard.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// @flow | ||
// attached modules container card | ||
import * as React from 'react' | ||
import {connect} from 'react-redux' | ||
|
||
import type {State} from '../../types' | ||
|
||
import {Card} from '@opentrons/components' | ||
import {getModulesOn} from '../../config' | ||
import ModulesCardContents from './ModulesCardContents' | ||
|
||
type Module = { | ||
slot: number, | ||
name: string, | ||
status: string, | ||
serial: number, | ||
fw_version: string | ||
} | ||
|
||
type SP = { | ||
modulesFlag: ?boolean, | ||
inProgress?: ?boolean, | ||
modules?: Array<Module>, // modulesBySlot? | ||
fetchModules?: () => mixed | ||
} | ||
|
||
type Props = SP | ||
|
||
const TITLE = 'Modules' | ||
|
||
export default connect(mapStateToProps, null)(AttachedModulesCard) | ||
|
||
// TODO (ka 2018-6-29): change this to a refresh card once we have endpoints | ||
function AttachedModulesCard (props: Props) { | ||
if (props.modulesFlag) { | ||
return ( | ||
<Card | ||
title={TITLE} | ||
column | ||
> | ||
<ModulesCardContents /> | ||
</Card> | ||
) | ||
} | ||
return null | ||
} | ||
|
||
function mapStateToProps (state: State): SP { | ||
return { | ||
modulesFlag: getModulesOn(state) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
app/src/components/InstrumentSettings/ModulesCardContents.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// @flow | ||
import * as React from 'react' | ||
import styles from './styles.css' | ||
|
||
type Props = { | ||
modules?: any | ||
} | ||
|
||
export default function ModulesCardContents (props: Props) { | ||
return ( | ||
<React.Fragment> | ||
<p className={styles.modules_description}>No modules detected.</p> | ||
|
||
<p className={styles.modules_description}>Connect a module to your robot via USB, then power it on. | ||
Press the refresh icon to the top to detect your module.</p> | ||
</React.Fragment> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// @flow | ||
// robot status panel with connect button | ||
import * as React from 'react' | ||
import type {Robot} from '../../robot' | ||
|
||
import AttachedPipettesCard from './AttachedPipettesCard' | ||
import AttachedModulesCard from './AttachedModulesCard' | ||
import {CardContainer, CardRow} from '../layout' | ||
|
||
type Props = Robot | ||
|
||
export default function InstrumentSettings (props: Props) { | ||
return ( | ||
<CardContainer> | ||
<CardRow> | ||
<AttachedPipettesCard {...props} /> | ||
</CardRow> | ||
<CardRow> | ||
<AttachedModulesCard {...props} /> | ||
</CardRow> | ||
</CardContainer> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* stylesheet for InstrumentSettings components */ | ||
@import '@opentrons/components'; | ||
|
||
.pipette_card { | ||
display: flex; | ||
position: relative; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: space-between; | ||
height: 4rem; | ||
padding-top: 1rem; | ||
width: 49.5%; | ||
|
||
& > a { | ||
width: 8rem; | ||
} | ||
} | ||
|
||
.pipette_diagram { | ||
height: 100%; | ||
padding: 0 0 0.5rem; | ||
text-align: center; | ||
|
||
& * { | ||
height: 100%; | ||
width: auto; | ||
} | ||
} | ||
|
||
.image { | ||
height: 8rem; | ||
width: 2.25rem; | ||
margin-top: -3rem; | ||
border: 1px solid var(--c-light-gray); | ||
} | ||
|
||
.right { | ||
& > div { | ||
order: 2; | ||
} | ||
|
||
& > .image { | ||
order: 1; | ||
} | ||
|
||
& > a { | ||
order: 3; | ||
} | ||
} | ||
|
||
.modules_description { | ||
@apply --font-body-2-dark; | ||
|
||
margin: 0.5rem 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.