-
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): Add attached modules card UI to instrument settings page #1854
Conversation
return ( | ||
<React.Fragment> | ||
{props.modules.map((mod) => ( | ||
<ModuleItem {...mod} /> |
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.
Do we need key={index}
?
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.
yes good catch. saw the warning and then forgot to slug it in
|
||
// TODO (ka 2018-7-10): replace with design assets onces available | ||
const MODULE_IMGS = { | ||
'Temperature Module': 'http://via.placeholder.com/100x75', |
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.
What, no http://placekitten.com?
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.
I will placecage in a pinch
return ( | ||
<div className={styles.module_update}> | ||
<OutlineButton | ||
disabled={!!availableUpdate} |
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.
This disabled logic should be switched
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.
good catch reversing now
Codecov Report
@@ Coverage Diff @@
## edge #1854 +/- ##
==========================================
+ Coverage 33.76% 33.85% +0.09%
==========================================
Files 391 396 +5
Lines 6380 6428 +48
==========================================
+ Hits 2154 2176 +22
- Misses 4226 4252 +26
Continue to review full report at Codecov.
|
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.
Looks good 👍 I just had a couple of small comments
fetchModules?: () => mixed | ||
} | ||
|
||
type Props = SP | ||
|
||
const TITLE = 'Modules' | ||
|
||
const MODULE_DATA = [ |
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.
Could this name forecast that it is temporary stub data more? e.g. STUBBED_MODULE_DATA
. especially next to TITLE
it looks like a permanent constant
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.
👍
export default function ModuleItem (props: Module) { | ||
return ( | ||
<div className={styles.module_item}> | ||
<ModuleImage {...props}/> |
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.
Is it true that these child components are receiving a lot of extra props because of these spreads? Is there any reason you're not explicitly passing down the props that they'll need. e.g. <ModuleUpdate availableUpdate={props.availableUpdate} />
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.
happy to be more specific. will change now
import styles from './styles.css' | ||
|
||
type Props = { | ||
availableUpdate?: ?string |
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.
I don't see availableUpdate
in the stubbed modules. Is it a version string in the case that there is an available update and undefined if not? If that's the case, could it be called availableUpdateVersion
?
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.
Currently, everything is just stubbed out. Not sure where the firmware update will come from yet. In robot it was a ?string with the version if a new one is available
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.
availableUpdate
will likely come from a selector based on whatever firmware files we have bundled in that version of the app
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.
🐧
import styles from './styles.css' | ||
|
||
type Props = { | ||
availableUpdate?: ?string |
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.
availableUpdate
will likely come from a selector based on whatever firmware files we have bundled in that version of the app
overview
This PR closes #1735 (assuming wiring up to API endpoint is its own ticket once the endpoint exists)
changelog
review requests
Keeping this as a WIP while waiting for pending modules image assets. ModuleItems currently just uses a placehold.it image. Once we have those, another styling pass before ready for review.
I pulled
ModuleItem
and its atoms along withNoModulesMessage
into a/ModuleItem
directory because instrumentSettings was getting a little cluttered.Also worth noting, since the endpoint does not exist and is not wired mapStateToProps is rendering mock data.
Modules is still behind a feature flag so run
OT_APP_MODULES=1 make dev
to view it inInstrumentSettings