diff --git a/protocol-designer/src/components/StepEditForm/MixForm.js b/protocol-designer/src/components/StepEditForm/MixForm.js index 7003ea41a00..8f8e81787c3 100644 --- a/protocol-designer/src/components/StepEditForm/MixForm.js +++ b/protocol-designer/src/components/StepEditForm/MixForm.js @@ -59,7 +59,7 @@ const MixForm = (props: MixFormProps): React.Element => {
- +
diff --git a/protocol-designer/src/components/StepEditForm/TransferLikeForm.js b/protocol-designer/src/components/StepEditForm/TransferLikeForm.js index 66a8b85c9b0..db2eceb5da9 100644 --- a/protocol-designer/src/components/StepEditForm/TransferLikeForm.js +++ b/protocol-designer/src/components/StepEditForm/TransferLikeForm.js @@ -68,7 +68,7 @@ const TransferLikeForm = (props: TransferLikeFormProps) => {
- +
diff --git a/protocol-designer/src/components/StepEditForm/formFields.js b/protocol-designer/src/components/StepEditForm/formFields.js index bb2166087a7..2dfc43a5823 100644 --- a/protocol-designer/src/components/StepEditForm/formFields.js +++ b/protocol-designer/src/components/StepEditForm/formFields.js @@ -181,22 +181,36 @@ export const FlowRateField = () => Default Bottom, center -const CHANGE_TIP_OPTIONS = [ - {name: 'Always', value: 'always'}, - {name: 'Once', value: 'once'}, +const getChangeTipOptions = () => [ + {name: 'For each aspirate', value: 'always'}, + {name: 'Only the first aspirate', value: 'once'}, {name: 'Never', value: 'never'} ] + // NOTE: ChangeTipField not validated as of 6/27/18 so no focusHandlers needed -type ChangeTipFieldProps = {name: StepFieldName} -export const ChangeTipField = (props: ChangeTipFieldProps) => ( - ( - - ) => { updateValue(e.currentTarget.value) } } /> - - )} /> -) +type ChangeTipFieldProps = {name: StepFieldName, stepType: StepType} +export const ChangeTipField = (props: ChangeTipFieldProps) => { + const {name, stepType} = props + let options = getChangeTipOptions() + // Override change tip option names for certain step types + switch (stepType) { + case 'consolidate': + options[0].name = 'For each dispense' + break + case 'mix': + options[0].name = 'For each well' + break + } + return ( + ( + + ) => { updateValue(e.currentTarget.value) } } /> + + )} /> + ) +} diff --git a/protocol-designer/src/constants.js b/protocol-designer/src/constants.js index 246cc9fbe0f..ce14a12b765 100644 --- a/protocol-designer/src/constants.js +++ b/protocol-designer/src/constants.js @@ -47,3 +47,5 @@ export const FIXED_TRASH_ID: 'trashId' = 'trashId' export const START_TERMINAL_TITLE = 'STARTING DECK STATE' export const END_TERMINAL_TITLE = 'FINAL DECK STATE' + +export const DEFAULT_CHANGE_TIP_OPTION: 'always' = 'always' diff --git a/protocol-designer/src/steplist/fieldLevel/index.js b/protocol-designer/src/steplist/fieldLevel/index.js index 70ed5ea19eb..ef322cf1d7f 100644 --- a/protocol-designer/src/steplist/fieldLevel/index.js +++ b/protocol-designer/src/steplist/fieldLevel/index.js @@ -21,8 +21,6 @@ export type { StepFieldName } -const DEFAULT_CHANGE_TIP_OPTION: 'always' = 'always' - const hydrateLabware = (state, id) => (labwareIngredSelectors.getLabware(state)[id]) type StepFieldHelpers = { @@ -35,9 +33,6 @@ const stepFieldHelperMap: {[StepFieldName]: StepFieldHelpers} = { getErrors: composeErrors(requiredField), hydrate: hydrateLabware }, - 'changeTip': { - processValue: defaultTo(DEFAULT_CHANGE_TIP_OPTION) - }, 'dispense_delayMinutes': { processValue: composeProcessors(castToNumber, defaultTo(0)) }, diff --git a/protocol-designer/src/steplist/formProcessing.js b/protocol-designer/src/steplist/formProcessing.js index 0d04188a107..ea5afaba56b 100644 --- a/protocol-designer/src/steplist/formProcessing.js +++ b/protocol-designer/src/steplist/formProcessing.js @@ -17,9 +17,10 @@ import type { CommandCreatorData } from '../step-generation' -import {FIXED_TRASH_ID} from '../constants' - -const DEFAULT_CHANGE_TIP_OPTION: 'always' = 'always' +import { + DEFAULT_CHANGE_TIP_OPTION, + FIXED_TRASH_ID +} from '../constants' // TODO LATER Ian 2018-03-01 remove or consolidate these 2 similar types? export type ValidFormAndErrors = { @@ -55,13 +56,14 @@ export const generateNewForm = (stepId: StepIdType, stepType: StepType): BlankFo if (stepType === 'transfer' || stepType === 'consolidate' || stepType === 'mix') { return { ...baseForm, - 'aspirate_changeTip': 'once' + 'aspirate_changeTip': DEFAULT_CHANGE_TIP_OPTION } } if (stepType === 'distribute') { return { ...baseForm, + 'aspirate_changeTip': DEFAULT_CHANGE_TIP_OPTION, 'aspirate_disposalVol_checkbox': true, 'dispense_blowout_checkbox': true, 'dispense_blowout_labware': FIXED_TRASH_ID