diff --git a/app/package.json b/app/package.json index cf047a00aa8..b6d9cb73266 100644 --- a/app/package.json +++ b/app/package.json @@ -16,10 +16,6 @@ "url": "https://github.com/Opentrons/opentrons/issues" }, "homepage": "https://github.com/Opentrons/opentrons", - "devDependencies": { - "flow-bin": "^0.110.1", - "flow-typed": "^2.6.2" - }, "dependencies": { "@opentrons/components": "3.15.2", "@opentrons/shared-data": "3.15.2", diff --git a/app/src/analytics/make-event.js b/app/src/analytics/make-event.js index c50e80221c9..1d864ec546d 100644 --- a/app/src/analytics/make-event.js +++ b/app/src/analytics/make-event.js @@ -47,8 +47,8 @@ export function makeEvent( return getProtocolAnalyticsData(state).then(data => ({ name: 'protocolUploadRequest', properties: { - ...data, ...getRobotAnalyticsData(state), + ...data, }, })) } @@ -63,8 +63,8 @@ export function makeEvent( return getProtocolAnalyticsData(state).then(data => ({ name: 'protocolUploadResponse', properties: { - ...data, ...getRobotAnalyticsData(state), + ...data, success: actionType === 'robot:SESSION_RESPONSE', error: (actionPayload.error && actionPayload.error.message) || '', }, @@ -76,8 +76,8 @@ export function makeEvent( return getProtocolAnalyticsData(state).then(data => ({ name: 'runStart', properties: { - ...data, ...getRobotAnalyticsData(state), + ...data, }, })) } @@ -94,8 +94,8 @@ export function makeEvent( return getProtocolAnalyticsData(state).then(data => ({ name: 'runFinish', properties: { - ...data, ...getRobotAnalyticsData(state), + ...data, runTime, success, error, diff --git a/app/src/buildroot/reducer.js b/app/src/buildroot/reducer.js index 3e0049605ea..e8f33f8cea6 100644 --- a/app/src/buildroot/reducer.js +++ b/app/src/buildroot/reducer.js @@ -81,6 +81,7 @@ export function buildrootReducer( case Constants.BR_STATUS: { const { stage, progress, message } = action.payload + const currentError = state.session?.error || null return { ...state, @@ -88,7 +89,7 @@ export function buildrootReducer( ...state.session, stage, progress: typeof progress === 'number' ? progress : null, - error: stage === Constants.ERROR ? message : state.session?.error, + error: stage === Constants.ERROR ? message : currentError, }, } } diff --git a/app/src/components/CalibrateDeck/AttachTip.js b/app/src/components/CalibrateDeck/AttachTip.js index 1c4c9a119fd..ae100cb5b92 100644 --- a/app/src/components/CalibrateDeck/AttachTip.js +++ b/app/src/components/CalibrateDeck/AttachTip.js @@ -1,19 +1,14 @@ // @flow import * as React from 'react' -import type { PipetteModelSpecs } from '@opentrons/shared-data' import type { CalibrateDeckStartedProps, CalibrationStep } from './types' import { PrimaryButton } from '@opentrons/components' import styles from './styles.css' -type Props = CalibrateDeckStartedProps & { +type Props = {| + ...CalibrateDeckStartedProps, proceed: () => mixed, -} - -type DiagramProps = { - calibrationStep: CalibrationStep, - pipette: PipetteModelSpecs, -} +|} type Channels = 'single' | 'multi' @@ -72,7 +67,7 @@ export default function AttachTipModal(props: Props) { ) } -function getDiagramSrc(props: DiagramProps): string { +function getDiagramSrc(props: Props): string { const { calibrationStep, pipette } = props const channelsKey = pipette.channels === 8 ? 'multi' : 'single' diff --git a/app/src/components/CalibrateDeck/ClearDeckAlert.js b/app/src/components/CalibrateDeck/ClearDeckAlert.js index 5e64a547b74..55de9c9d4b8 100644 --- a/app/src/components/CalibrateDeck/ClearDeckAlert.js +++ b/app/src/components/CalibrateDeck/ClearDeckAlert.js @@ -8,7 +8,7 @@ import ClearDeckAlertModal from '../ClearDeckAlertModal' import type { Dispatch } from '../../types' import type { CalibrateDeckProps } from './types' -type OP = $Exact +type OP = CalibrateDeckProps type DP = {| onContinue: () => mixed, diff --git a/app/src/components/CalibrateDeck/ConfirmPosition.js b/app/src/components/CalibrateDeck/ConfirmPosition.js index 6a1d618a9bc..2a15546b149 100644 --- a/app/src/components/CalibrateDeck/ConfirmPosition.js +++ b/app/src/components/CalibrateDeck/ConfirmPosition.js @@ -5,9 +5,10 @@ import { PrimaryButton } from '@opentrons/components' import JogControls from '../JogControls' import Instructions from './Instructions' -type Props = CalibrateDeckStartedProps & { +type Props = {| + ...CalibrateDeckStartedProps, proceed: () => mixed, -} +|} export default function ConfirmPosition(props: Props) { return ( diff --git a/app/src/components/CalibrateDeck/InstructionsModal.js b/app/src/components/CalibrateDeck/InstructionsModal.js index 8d9658aa960..06e487a9414 100644 --- a/app/src/components/CalibrateDeck/InstructionsModal.js +++ b/app/src/components/CalibrateDeck/InstructionsModal.js @@ -16,11 +16,11 @@ import ConfirmPosition from './ConfirmPosition' import type { Dispatch } from '../../types' import type { CalibrateDeckStartedProps } from './types' -type OP = $Exact +type OP = CalibrateDeckStartedProps type DP = {| proceed: () => mixed |} -type Props = { ...OP, ...DP } +type Props = {| ...OP, ...DP |} const TITLE = 'Deck Calibration' diff --git a/app/src/components/CalibrateDeck/types.js b/app/src/components/CalibrateDeck/types.js index 61095581f4d..22fa707d34d 100644 --- a/app/src/components/CalibrateDeck/types.js +++ b/app/src/components/CalibrateDeck/types.js @@ -33,12 +33,12 @@ export type DP = {| back: () => mixed, |} -export type CalibrateDeckProps = { ...OP, ...SP, ...DP } +export type CalibrateDeckProps = {| ...OP, ...SP, ...DP |} -export type CalibrateDeckStartedProps = { - ...$Exact, +export type CalibrateDeckStartedProps = {| + ...CalibrateDeckProps, exitUrl: string, mount: Mount, pipette: PipetteModelSpecs, calibrationStep: CalibrationStep, -} +|} diff --git a/app/src/components/CalibrateLabware/ConfirmPositionContents.js b/app/src/components/CalibrateLabware/ConfirmPositionContents.js index 1442b13feb7..a07043a8143 100644 --- a/app/src/components/CalibrateLabware/ConfirmPositionContents.js +++ b/app/src/components/CalibrateLabware/ConfirmPositionContents.js @@ -23,7 +23,7 @@ type DP = {| jog: Jog, |} -type Props = { ...OP, ...DP } +type Props = {| ...OP, ...DP |} export default connect( null, @@ -32,6 +32,7 @@ export default connect( function ConfirmPositionContents(props: Props) { const { + jog, onConfirmClick, labware, calibrator, @@ -49,7 +50,7 @@ function ConfirmPositionContents(props: Props) { {...{ labware, calibrator, calibrateToBottom, useCenteredTroughs }} buttonText={confirmButtonText} /> - + {confirmButtonText} diff --git a/app/src/components/CalibrateLabware/ProceedToRun.js b/app/src/components/CalibrateLabware/ProceedToRun.js index af94ec238ea..cc448ad4dfd 100644 --- a/app/src/components/CalibrateLabware/ProceedToRun.js +++ b/app/src/components/CalibrateLabware/ProceedToRun.js @@ -34,7 +34,6 @@ function ProceedToRun(props: Props) { }, [sessionModules]) const handleClick = () => { - // $FlowFixMe: robotActions.returnTip is not typed returnTip() if (mustPrepForRun) { setRunPrepModalOpen(true) diff --git a/app/src/components/CalibratePanel/LabwareList.js b/app/src/components/CalibratePanel/LabwareList.js index 93cac01558e..2e757233603 100644 --- a/app/src/components/CalibratePanel/LabwareList.js +++ b/app/src/components/CalibratePanel/LabwareList.js @@ -24,12 +24,12 @@ type SP = {| type DP = {| dispatch: Dispatch |} -type Props = { +type Props = {| labware: Array, modulesBySlot: { [Slot]: SessionModule }, disabled: boolean, setLabware: (labware: Labware) => mixed, -} +|} export default withRouter<{||}, _>( connect( @@ -54,7 +54,6 @@ function LabwareList(props: Props) { modulesBySlot[lw.slot].name } isDisabled={disabled} - confirmed={lw.confirmed} onClick={() => setLabware(lw)} /> ))} diff --git a/app/src/components/CalibratePanel/LabwareListItem.js b/app/src/components/CalibratePanel/LabwareListItem.js index c5a591a5e58..b91e2038ca9 100644 --- a/app/src/components/CalibratePanel/LabwareListItem.js +++ b/app/src/components/CalibratePanel/LabwareListItem.js @@ -14,7 +14,7 @@ import type { Labware } from '../../robot' import { THERMOCYCLER } from '../../modules' type LabwareListItemProps = {| - ...$Exact, + ...Labware, moduleName?: ModuleType, isDisabled: boolean, onClick: () => mixed, diff --git a/app/src/components/ConnectPanel/UnreachableRobotItem.js b/app/src/components/ConnectPanel/UnreachableRobotItem.js index 57d475fbca9..85e51fd979b 100644 --- a/app/src/components/ConnectPanel/UnreachableRobotItem.js +++ b/app/src/components/ConnectPanel/UnreachableRobotItem.js @@ -24,11 +24,7 @@ export default function UnreachableRobotItem(props: UnreachableRobot) { disabled hoverTooltipHandlers={hoverTooltipHandlers} > - +

{displayName}

)} diff --git a/app/src/components/ReviewDeck/Prompt.js b/app/src/components/ReviewDeck/Prompt.js index a84a832f15e..119349a5344 100644 --- a/app/src/components/ReviewDeck/Prompt.js +++ b/app/src/components/ReviewDeck/Prompt.js @@ -9,13 +9,14 @@ import { selectors as robotSelectors, type Labware } from '../../robot' import styles from './styles.css' type Props = {| - ...$Exact, + ...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) const labwareTitle = definition ? getLabwareDisplayName(definition) : name return ( diff --git a/app/src/components/RobotSettings/SelectNetwork/SelectKey.js b/app/src/components/RobotSettings/SelectNetwork/SelectKey.js index 819ecc94d25..5da39723dfd 100644 --- a/app/src/components/RobotSettings/SelectNetwork/SelectKey.js +++ b/app/src/components/RobotSettings/SelectNetwork/SelectKey.js @@ -40,7 +40,6 @@ export default class SelectKey extends React.Component { event.target.value = '' // $FlowFixMe: see TODO and HACK in app/src/http-api-client/networking.js this.props.addKey(file).then(success => { - // $FlowFixMe: ditto this.props.onValueChange(this.props.name, success.payload.response.id) }) } diff --git a/app/src/components/RobotSettings/SelectNetwork/fields.js b/app/src/components/RobotSettings/SelectNetwork/fields.js index 9a8668bf1a4..d5a0a1969e9 100644 --- a/app/src/components/RobotSettings/SelectNetwork/fields.js +++ b/app/src/components/RobotSettings/SelectNetwork/fields.js @@ -31,13 +31,13 @@ type PasswordFieldProps = { toggleShowPassword: (name: string) => mixed, } -type SelectOptionFieldProps = { +type SelectOptionFieldProps = {| ...BaseFieldProps, options: Array, placeholder?: string, - onValueChange?: (name: string, value: ?string) => mixed, + onValueChange: (name: string, value: ?string) => mixed, onLoseFocus?: (name: string) => mixed, -} +|} const SHOW_PASSWORD_LABEL = 'Show password' const FIELD_ID_PREFIX = '__ConnectForm__' diff --git a/app/src/components/TipProbe/types.js b/app/src/components/TipProbe/types.js index 9708326fe23..c378ea15989 100644 --- a/app/src/components/TipProbe/types.js +++ b/app/src/components/TipProbe/types.js @@ -1,7 +1,7 @@ // @flow import type { Pipette } from '../../robot' -export type TipProbeProps = $Exact +export type TipProbeProps = Pipette export type TipProbeState = | 'unprobed' diff --git a/app/src/components/calibrate-pipettes/Pipettes.js b/app/src/components/calibrate-pipettes/Pipettes.js index dd64a8f2c86..eeb8a2d1836 100644 --- a/app/src/components/calibrate-pipettes/Pipettes.js +++ b/app/src/components/calibrate-pipettes/Pipettes.js @@ -6,6 +6,7 @@ import { PIPETTE_MOUNTS } from '../../pipettes' import { InstrumentGroup } from '@opentrons/components' import styles from './styles.css' +import type { InstrumentInfoProps } from '@opentrons/components' import type { Pipette, TiprackByMountMap } from '../../robot/types' import type { Mount } from '../../pipettes/types' @@ -19,7 +20,12 @@ type Props = {| export default function Pipettes(props: Props) { const { currentMount, pipettes, tipracksByMount } = props - const infoByMount = PIPETTE_MOUNTS.reduce((result, mount) => { + const infoByMount = PIPETTE_MOUNTS.reduce< + $Shape<{| + left?: InstrumentInfoProps, + right?: InstrumentInfoProps, + |}> + >((result, mount) => { const pipette = pipettes.find(p => p.mount === mount) const tiprack = tipracksByMount[mount] const pipetteConfig = pipette?.modelSpecs diff --git a/app/src/discovery/types.js b/app/src/discovery/types.js index f7bbf2c7e93..e0adc2cec14 100644 --- a/app/src/discovery/types.js +++ b/app/src/discovery/types.js @@ -16,37 +16,37 @@ export type ReachableStatus = 'reachable' export type UnreachableStatus = 'unreachable' // service with a known IP address -export type ResolvedRobot = { +export type ResolvedRobot = {| ...$Exact, ip: $NonMaybeType<$PropertyType>, local: $NonMaybeType<$PropertyType>, ok: $NonMaybeType<$PropertyType>, serverOk: $NonMaybeType<$PropertyType>, displayName: string, -} +|} // fully connectable robot -export type Robot = { +export type Robot = {| ...$Exact, ok: true, health: $NonMaybeType<$PropertyType>, status: ConnectableStatus, connected: boolean, -} +|} // robot with a known IP (i.e. advertising over mDNS) but unconnectable -export type ReachableRobot = { +export type ReachableRobot = {| ...$Exact, ok: false, status: ReachableStatus, -} +|} // robot with an unknown IP -export type UnreachableRobot = { +export type UnreachableRobot = {| ...$Exact, displayName: string, status: UnreachableStatus, -} +|} export type ViewableRobot = Robot | ReachableRobot diff --git a/app/src/http-api-client/calibration.js b/app/src/http-api-client/calibration.js index f59cc5cc761..26b9f9e7615 100644 --- a/app/src/http-api-client/calibration.js +++ b/app/src/http-api-client/calibration.js @@ -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 export type DeckCalCommandState = ApiCall type RobotCalState = { - 'calibration/deck/start'?: DeckCalStartState, - 'calibration/deck'?: DeckCalCommandState, + [string]: any, } 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, diff --git a/app/src/http-api-client/reducer.js b/app/src/http-api-client/reducer.js index 77e5fe74efb..b274ecd003f 100644 --- a/app/src/http-api-client/reducer.js +++ b/app/src/http-api-client/reducer.js @@ -1,5 +1,6 @@ // @flow // generic api reducer +// DEPRECATED(mc, 2020-01-13) import isEmpty from 'lodash/isEmpty' import reduce from 'lodash/reduce' import { normalizeRobots } from '../discovery/reducer' @@ -7,10 +8,9 @@ import { normalizeRobots } from '../discovery/reducer' import type { Service } from '@opentrons/discovery-client' import type { State, Action } from '../types' import type { BaseRobot } from '../robot' -import type { NetworkingState } from './networking' export type RobotApiState = $Shape<{| - ...NetworkingState, + [path: string]: any, |}> type ApiState = { [name: string]: ?RobotApiState } @@ -117,7 +117,7 @@ export function getRobotApiState( return state.superDeprecatedRobotApi.api[props.name] || {} } -function getUpdateInfo(state: ApiState, action: *): * { +function getUpdateInfo(state: ApiState, action: any): any { const { path, robot: { name }, diff --git a/app/src/logger.js b/app/src/logger.js index 6805c23f07d..a7e6c635eed 100644 --- a/app/src/logger.js +++ b/app/src/logger.js @@ -13,28 +13,38 @@ export type LogLevel = | 'debug' | 'silly' -type Logger = { [level: LogLevel]: (message: string, meta?: {}) => void } +export type Log = (message: string, meta?: {}) => void -const LEVELS: Array = [ - 'error', - 'warn', - 'info', - 'http', - 'verbose', - 'debug', - 'silly', -] +type Logger = {| + error: Log, + warn: Log, + info: Log, + http: Log, + verbose: Log, + debug: Log, + silly: Log, +|} + +const ERROR: 'error' = 'error' +const WARN: 'warn' = 'warn' +const INFO: 'info' = 'info' +const HTTP: 'http' = 'http' +const VERBOSE: 'verbose' = 'verbose' +const DEBUG: 'debug' = 'debug' +const SILLY: 'silly' = 'silly' export default function createLogger(filename: string): Logger { const label = `app/${filename}` - return LEVELS.reduce( - (result, level) => ({ - ...result, - [level]: (message, meta) => log(level, message, label, meta), - }), - {} - ) + return { + [ERROR]: (message, meta) => log(ERROR, message, label, meta), + [WARN]: (message, meta) => log(WARN, message, label, meta), + [INFO]: (message, meta) => log(INFO, message, label, meta), + [HTTP]: (message, meta) => log(HTTP, message, label, meta), + [VERBOSE]: (message, meta) => log(VERBOSE, message, label, meta), + [DEBUG]: (message, meta) => log(DEBUG, message, label, meta), + [SILLY]: (message, meta) => log(SILLY, message, label, meta), + } } function log(level: LogLevel, message: string, label: string, meta?: {}) { @@ -56,7 +66,7 @@ function log(level: LogLevel, message: string, label: string, meta?: {}) { } // send to main process for log file collection - remote.ipcRenderer.send('log', { level, message, label, ...meta }) + remote.ipcRenderer.send('log', { ...meta, level, message, label }) } // $FlowFixMe(BC, 2019-10-04): ref will never actually be undefined diff --git a/app/src/robot/types.js b/app/src/robot/types.js index 454c6b70b3e..42c3a74c2f7 100644 --- a/app/src/robot/types.js +++ b/app/src/robot/types.js @@ -70,7 +70,7 @@ export type Command = { } // instrument as stored in redux state -export type StatePipette = { +export type StatePipette = {| // resource ID _id: number, // robot mount instrument is installed on @@ -88,14 +88,14 @@ export type StatePipette = { tipRacks: Array, // string specified in protocol to load pipette requestedAs?: ?string, -} +|} -export type Pipette = { - ...$Exact, +export type Pipette = {| + ...StatePipette, probed: boolean, tipOn: boolean, modelSpecs: PipetteModelSpecs | null, -} +|} // labware as stored in redux state export type StateLabware = {| @@ -117,24 +117,24 @@ export type StateLabware = {| calibratorMount: ?Mount, |} -export type Labware = { +export type Labware = {| ...StateLabware, calibration: LabwareCalibrationStatus, confirmed: boolean, isMoving: boolean, definition: LabwareDefinition2 | null, -} +|} export type LabwareType = 'tiprack' | 'labware' -export type SessionModule = { +export type SessionModule = {| // resource ID _id: number, // slot module is installed in slot: Slot, // name identifier of the module name: ModuleType, -} +|} export type SessionStatus = | '' @@ -145,14 +145,14 @@ export type SessionStatus = | 'finished' | 'stopped' -export type SessionUpdate = { +export type SessionUpdate = {| state: SessionStatus, startTime: ?number, - lastCommand: ?{ + lastCommand: ?{| id: number, handledAt: number, - }, -} + |}, +|} export type TiprackByMountMap = {| left: Labware | null, diff --git a/components/package.json b/components/package.json index 816b12815a4..b0c4ee74ded 100644 --- a/components/package.json +++ b/components/package.json @@ -14,10 +14,6 @@ "url": "https://github.com/Opentrons/opentrons/issues" }, "homepage": "https://github.com/Opentrons/opentrons#readme", - "devDependencies": { - "flow-bin": "^0.110.1", - "flow-typed": "^2.6.2" - }, "peerDependencies": { "classnames": "^2.2.5", "lodash": "^4.17.4", diff --git a/components/src/buttons/IconButton.js b/components/src/buttons/IconButton.js index 68e3e1d24d4..1593e03bc28 100644 --- a/components/src/buttons/IconButton.js +++ b/components/src/buttons/IconButton.js @@ -8,20 +8,26 @@ import FlatButton from './FlatButton' import styles from './buttons.css' -type Props = ButtonProps & IconProps +type Props = {| + ...$Exact, + name: $PropertyType, + spin?: $PropertyType, +|} /** * FlatButton variant for a button that is a single icon. Takes props of * both Button _and_ Icon. Use `name` to specify icon name. */ export default function IconButton(props: Props) { + const { name, spin, ...buttonProps } = props + const iconProps = { name, spin } const className = cx(styles.button_icon, props.className, { [styles.inverted]: props.inverted, }) return ( - - + + ) } diff --git a/components/src/controls/ToggleButton.js b/components/src/controls/ToggleButton.js index a5237c7ec37..0e50eccbb5b 100644 --- a/components/src/controls/ToggleButton.js +++ b/components/src/controls/ToggleButton.js @@ -1,16 +1,17 @@ // @flow -// reusuable toggle button with on off styling for connect to robot and opt in/out +// reusable toggle button with on off styling for connect to robot and opt in/out import * as React from 'react' import cx from 'classnames' import { IconButton, type ButtonProps } from '@opentrons/components' import styles from './styles.css' -type ToggleProps = ButtonProps & { +type ToggleProps = {| + ...$Exact, toggledOn: boolean, -} +|} export default function ToggleButton(props: ToggleProps) { - const { toggledOn } = props + const { toggledOn, ...buttonProps } = props const className = cx(styles.robot_item_icon, props.className, { [styles.toggled_on]: toggledOn, [styles.toggled_off]: !toggledOn, @@ -18,5 +19,5 @@ export default function ToggleButton(props: ToggleProps) { const toggleIcon = toggledOn ? 'ot-toggle-switch-on' : 'ot-toggle-switch-off' - return + return } diff --git a/components/src/deck/RobotWorkSpace.js b/components/src/deck/RobotWorkSpace.js index c0bfe4d5901..79671f6c4c0 100644 --- a/components/src/deck/RobotWorkSpace.js +++ b/components/src/deck/RobotWorkSpace.js @@ -27,7 +27,6 @@ function RobotWorkSpace(props: Props) { // in Firefox the same fn returns a deprecated SVGMatrix. // Until Firefox fixes this and conforms to SVG2 draft, // it will suffer from inverted y behavior (ignores css transform) - // $FlowFixMe(bc, 2019-05-31): flow type svg ref const getRobotCoordsFromDOMCoords: GetRobotCoordsFromDOMCoords = (x, y) => { if (!wrapperRef.current) return { x: 0, y: 0 } const cursorPoint = wrapperRef.current.createSVGPoint() diff --git a/components/src/deck/labwareInternals/types.js b/components/src/deck/labwareInternals/types.js index 6cd92cbf976..38eeb2a2d64 100644 --- a/components/src/deck/labwareInternals/types.js +++ b/components/src/deck/labwareInternals/types.js @@ -8,4 +8,4 @@ export type WellMouseEvent = {| export type WellFill = { [wellName: string]: string } // Use this like a Set! -export type WellGroup = { [wellName: string]: null } +export type WellGroup = $Shape<{| [wellName: string]: null |}> diff --git a/components/src/forms/InputField.js b/components/src/forms/InputField.js index d84d268fda6..781242b1806 100644 --- a/components/src/forms/InputField.js +++ b/components/src/forms/InputField.js @@ -6,7 +6,7 @@ import styles from './forms.css' // TODO: Ian 2018-09-14 remove 'label' prop when IngredientPropertiesForm gets updated -type Props = { +type Props = {| /** field is disabled if value is true */ disabled?: boolean, /** change handler */ @@ -47,7 +47,7 @@ type Props = { tabIndex?: number, /** automatically focus field on render */ autoFocus?: boolean, -} +|} export default function InputField(props: Props) { const error = props.error != null diff --git a/components/src/forms/SelectField.js b/components/src/forms/SelectField.js index bdb5354bff0..c2f96058039 100644 --- a/components/src/forms/SelectField.js +++ b/components/src/forms/SelectField.js @@ -90,11 +90,9 @@ export default class SelectField extends React.Component {