Skip to content

Commit

Permalink
feat(app): allow custom tiprack selection in deck cal & pipette offse…
Browse files Browse the repository at this point in the history
…t cal (#7155)

* feat(app): allow custom tiprack selection in deck cal & pipette offset cal

closes #7087

* link choose tiprack screen in intro

* render selected tiprack in intro screen

* add uri param to tip len cal and new selector

* add recalibrate pip offset intent

* fix flow & test errors

* reformat intro screen continue button

* add tests

* fix css lint error

* add cancel button

* conditionally show dropdown labels

* warn about override tip length cal in tlc

* show previously chosen tiprack as default

* use pip offset tiprack hash to check tip length data

* match selector-class-pattern

* fix broken tests
  • Loading branch information
ahiuchingau authored Jan 5, 2021
1 parent c0c9225 commit c8fc9f2
Show file tree
Hide file tree
Showing 18 changed files with 775 additions and 50 deletions.
1 change: 1 addition & 0 deletions app/src/calibration/api-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export type TipLengthCalibration = {|
source: CalibrationSource,
status: IndividualCalibrationStatus,
id: string,
uri?: string | null,
|}

export type AllTipLengthCalibrations = {|
Expand Down
19 changes: 19 additions & 0 deletions app/src/calibration/tip-length/selectors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @flow
import { createSelector } from 'reselect'
import { head } from 'lodash'

import type { State } from '../../types'
Expand All @@ -16,6 +17,24 @@ export const getTipLengthCalibrations: (
return calibrations
}

export const getTipLengthForPipetteAndTiprackByUri: (
state: State,
robotName: string | null,
pipetteSerial: string,
tiprackUri: string
) => TipLengthCalibration | null = createSelector(
getTipLengthCalibrations,
(allCalibrations, pipetteSerial, tipRackUri) => {
return (
head(
allCalibrations.filter(
cal => cal.pipette === pipetteSerial && cal.uri === tipRackUri
)
) || null
)
}
)

export const filterTipLengthForPipetteAndTiprack: (
allCalibrations: Array<TipLengthCalibration>,
pipetteSerial: string | null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
SaveZPoint,
SaveXYPoint,
CompleteConfirmation,
INTENT_PIPETTE_OFFSET,
INTENT_CALIBRATE_PIPETTE_OFFSET,
} from '../../CalibrationPanels'

import type { PipetteOffsetCalibrationStep } from '../../../sessions/types'
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('CalibratePipetteOffset', () => {
dispatchRequests={dispatchRequests}
showSpinner={showSpinner}
isJogging={isJogging}
intent={INTENT_PIPETTE_OFFSET}
intent={INTENT_CALIBRATE_PIPETTE_OFFSET}
/>,
{
wrappingComponent: Provider,
Expand Down
1 change: 1 addition & 0 deletions app/src/components/CalibratePipetteOffset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export function CalibratePipetteOffset(
sessionType={session.sessionType}
shouldPerformTipLength={shouldPerformTipLength}
intent={intent}
robotName={robotName}
/>
</ModalPage>
{showConfirmExit && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { PipetteOffsetIntent } from '../CalibrationPanels/types'

import { Portal } from '../portal'
import { CalibratePipetteOffset } from '../CalibratePipetteOffset'
import { INTENT_PIPETTE_OFFSET } from '../CalibrationPanels'
import { INTENT_CALIBRATE_PIPETTE_OFFSET } from '../CalibrationPanels'
import { pipetteOffsetCalibrationStarted } from '../../analytics'

// pipette calibration commands for which the full page spinner should not appear
Expand Down Expand Up @@ -121,7 +121,7 @@ export function useCalibratePipetteOffset(
}, [shouldClose, onComplete])

const [intent, setIntent] = React.useState<PipetteOffsetIntent>(
INTENT_PIPETTE_OFFSET
INTENT_CALIBRATE_PIPETTE_OFFSET
)

const {
Expand All @@ -133,7 +133,7 @@ export function useCalibratePipetteOffset(
const handleStartPipOffsetCalSession: Invoker = (props = {}) => {
const {
overrideParams = ({}: $Shape<PipetteOffsetCalibrationSessionParams>),
withIntent = INTENT_PIPETTE_OFFSET,
withIntent = INTENT_CALIBRATE_PIPETTE_OFFSET,
} = props
setIntent(withIntent)
dispatchRequests(
Expand Down Expand Up @@ -173,7 +173,7 @@ export function useCalibratePipetteOffset(
<SpinnerModalPage
titleBar={{
title:
intent === INTENT_PIPETTE_OFFSET
intent === INTENT_CALIBRATE_PIPETTE_OFFSET
? PIPETTE_OFFSET_TITLE
: TIP_LENGTH_TITLE,
back: {
Expand Down
Loading

0 comments on commit c8fc9f2

Please sign in to comment.