-
Notifications
You must be signed in to change notification settings - Fork 179
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
feat(app): Show connect modules modal when session modules detected #1897
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8070f6c
feat(app): Show connect modules modal when session modules detected
Kadee80 878e6e6
condition button text
Kadee80 5835225
fixup: Correct typedefs
mcous 382cf76
fixup: Fix lint
mcous 2b7eb3e
fixup: remove duplicate modal file
Kadee80 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// @flow | ||
// prompt for ReviewModulesModal of labware calibration page | ||
import * as React from 'react' | ||
|
||
import {OutlineButton, AlertItem} from '@opentrons/components' | ||
|
||
import styles from './styles.css' | ||
|
||
type Props = { | ||
modulesMissing: boolean, | ||
onClick: () => mixed, | ||
} | ||
|
||
const missingAlertProps = { | ||
type: 'warning', | ||
title: 'Module Missing', | ||
className: styles.alert | ||
} | ||
|
||
const connectedAlertProps = { | ||
type: 'success', | ||
title: 'Module succesfully detected.', | ||
className: styles.alert | ||
} | ||
|
||
export default function Prompt (props: Props) { | ||
const {modulesMissing, onClick} = props | ||
const alert = modulesMissing | ||
? <AlertItem {...missingAlertProps}/> | ||
: <AlertItem {...connectedAlertProps}/> | ||
const message = modulesMissing | ||
? 'Plug in and power up the required module via USB to your robot.' | ||
: 'Module succesfully detected.' | ||
const buttonText = modulesMissing | ||
? 'try searching for missing module' | ||
: 'continue to labware setup' | ||
return ( | ||
<div className={styles.prompt}> | ||
{alert} | ||
<p className={styles.prompt_text}> | ||
{message} | ||
</p> | ||
<OutlineButton className={styles.prompt_button} onClick={onClick} inverted> | ||
{buttonText} | ||
</OutlineButton> | ||
</div> | ||
) | ||
} |
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,17 @@ | ||
// @flow | ||
import * as React from 'react' | ||
import {Modal} from '../modals' | ||
import Prompt from './Prompt' | ||
|
||
type Props = { | ||
modulesMissing: boolean, | ||
onClick: () => mixed, | ||
} | ||
|
||
export default function ConnectModulesModal (props: Props) { | ||
return ( | ||
<Modal> | ||
<Prompt {...props}/> | ||
</Modal> | ||
) | ||
} |
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,28 @@ | ||
@import '@opentrons/components'; | ||
|
||
.alert { | ||
position: absolute; | ||
top: 3rem; | ||
left: 0; | ||
right: 0; | ||
} | ||
|
||
.prompt { | ||
padding-top: 2rem; | ||
} | ||
|
||
.prompt_text { | ||
@apply --font-header-light; | ||
|
||
font-weight: normal; | ||
margin-bottom: 1rem; | ||
text-align: center; | ||
} | ||
|
||
.prompt_button { | ||
display: block; | ||
width: auto; | ||
margin: 1rem auto; | ||
padding-left: 3rem; | ||
padding-right: 3rem; | ||
} |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// @flow | ||
// app specific modals | ||
|
||
import Modal from './Modal' | ||
import ErrorModal from './ErrorModal' | ||
|
||
export {ErrorModal} | ||
export {Modal, ErrorModal} |
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 |
---|---|---|
@@ -1,3 +1,24 @@ | ||
@import '@opentrons/components'; | ||
|
||
.modal { | ||
@apply --modal; | ||
|
||
flex-direction: column; | ||
justify-content: flex-start; | ||
padding: 4rem 2rem 2rem; | ||
} | ||
|
||
.modal * { | ||
z-index: 1; | ||
} | ||
|
||
.error_modal_message { | ||
font-style: italic; | ||
} | ||
|
||
.title_bar { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is gonna be toggled in development for much longer, maybe it should be under a feature flag instead of commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a good idea! We can do that in an upcoming PR. This ones already too big