-
Notifications
You must be signed in to change notification settings - Fork 180
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
refactor(js): Fix a variety of type definitions that will break in future Flow versions #4749
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,12 +24,12 @@ type SP = {| | |
|
||
type DP = {| dispatch: Dispatch |} | ||
|
||
type Props = { | ||
type Props = {| | ||
labware: Array<Labware>, | ||
modulesBySlot: { [Slot]: SessionModule }, | ||
disabled: boolean, | ||
setLabware: (labware: Labware) => mixed, | ||
} | ||
|} | ||
|
||
export default withRouter<{||}, _>( | ||
connect<Props, _, SP, {||}, State, Dispatch>( | ||
|
@@ -54,7 +54,6 @@ function LabwareList(props: Props) { | |
modulesBySlot[lw.slot].name | ||
} | ||
isDisabled={disabled} | ||
confirmed={lw.confirmed} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
onClick={() => setLabware(lw)} | ||
/> | ||
))} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,7 @@ export default function UnreachableRobotItem(props: UnreachableRobot) { | |
disabled | ||
hoverTooltipHandlers={hoverTooltipHandlers} | ||
> | ||
<Icon | ||
name={'alert-circle'} | ||
className={styles.robot_item_icon} | ||
disabled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
/> | ||
<Icon name={'alert-circle'} className={styles.robot_item_icon} /> | ||
<p className={styles.link_text}>{displayName}</p> | ||
</RobotLink> | ||
)} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,14 @@ import { selectors as robotSelectors, type Labware } from '../../robot' | |
import styles from './styles.css' | ||
|
||
type Props = {| | ||
...$Exact<Labware>, | ||
...Labware, | ||
onClick: () => void, | ||
|} | ||
|
||
export default function Prompt(props: Props) { | ||
const { name, definition, slot, onClick } = props | ||
const labwareType = robotSelectors.labwareType(props) | ||
const { onClick, ...labware } = props | ||
const { name, definition, slot } = labware | ||
const labwareType = robotSelectors.labwareType(labware) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change was driven by switching |
||
const labwareTitle = definition ? getLabwareDisplayName(definition) : name | ||
|
||
return ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// @flow | ||
// http api client module for /calibration/** | ||
// DEPRECATED(mc, 2020-01-13) | ||
import { createSelector } from 'reselect' | ||
|
||
import type { OutputSelector } from 'reselect' | ||
|
@@ -68,8 +69,7 @@ export type DeckCalStartState = ApiCall<DeckStartRequest, DeckStartResponse> | |
export type DeckCalCommandState = ApiCall<DeckCalRequest, DeckCalResponse> | ||
|
||
type RobotCalState = { | ||
'calibration/deck/start'?: DeckCalStartState, | ||
'calibration/deck'?: DeckCalCommandState, | ||
[string]: any, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The typing on this state was an illusion and this file is super deprecated, so this just makes the danger more explicit. Unit tests are already in place for this state |
||
} | ||
|
||
type CalState = { | ||
|
@@ -82,7 +82,7 @@ const DECK_START: 'calibration/deck/start' = 'calibration/deck/start' | |
// TODO(mc, 2018-07-05): flow helper until we have one reducer, since | ||
// p === 'constant' checks but p === CONSTANT does not, even if | ||
// CONSTANT is defined as `const CONSTANT: 'constant' = 'constant'` | ||
function getCalPath(p: string): ?CalPath { | ||
function getCalPath(p: string): string | null { | ||
if (p === 'calibration/deck/start' || p === 'calibration/deck') return p | ||
|
||
return null | ||
|
@@ -158,7 +158,7 @@ export function calibrationReducer(state: ?CalState, action: Action): CalState { | |
} | ||
|
||
if (path === DECK_START) { | ||
stateByName[DECK] = { | ||
stateByName[(DECK: string)] = { | ||
request: null, | ||
response: null, | ||
error: null, | ||
|
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.
<JogControls>
only takes the one prop, so this code change is safe