Skip to content

Commit

Permalink
refine tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 committed Nov 27, 2024
1 parent a6dc4bc commit 1f67cbe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion protocol-designer/src/assets/localization/en/tooltip.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
"aspirate_mix_checkbox": "Advanced setting not compatible with pipette path",
"aspirate_touchTip_checkbox": "Touch tip is not supported",
"blowout_checkbox": "Blowout already set with disposal volume",
"dispense_mix_checkbox": "Unable to mix in a waste chute or trash bin",
"dispense_mix_checkbox": "Can’t mix in trash container",
"dispense_mix_checkbox_2": "Can’t mix after dispense when distributing",
"dropTip_location": "Choose where you would like to drop tip",
"dispense_wells": "Select a destination labware in order to select wells",
"aspirate_mmFromBottom": "Tip position adjustment is not supported",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
StyledText,
Tabs,
} from '@opentrons/components'
import { getTrashOrLabware } from '@opentrons/step-generation'
import { getEnableReturnTip } from '../../../../../../feature-flags/selectors'
import {
getAdditionalEquipmentEntities,
Expand Down Expand Up @@ -61,7 +62,7 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {
tab,
setTab,
} = props
const { t, i18n } = useTranslation(['protocol_steps', 'form'])
const { t, i18n } = useTranslation(['protocol_steps', 'form', 'tooltip'])
const { path } = formData
const additionalEquipmentEntities = useSelector(
getAdditionalEquipmentEntities
Expand Down Expand Up @@ -97,6 +98,20 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {
additionalEquipmentEntities[String(propsForFields.dispense_labware.value)]
?.name === 'trashBin'

const destinationLabwareType = getTrashOrLabware(
labwares,
additionalEquipmentEntities,
formData.dispense_labware as string
)
const isDestinationTrash =
destinationLabwareType != null
? ['trashBin', 'wasteChute'].includes(destinationLabwareType)
: false
const dispenseMixDisabledTooltipText = t(
`tooltip:step_fields.moveLiquid.disabled.${
isDestinationTrash ? 'dispense_mix_checkbox' : 'dispense_mix_checkbox_2'
}`
)
const aspirateTab = {
text: t('aspirate'),
isActive: tab === 'aspirate',
Expand Down Expand Up @@ -337,10 +352,15 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {
checkboxUpdateValue={
propsForFields[`${tab}_mix_checkbox`].updateValue
}
tooltipText={propsForFields[`${tab}_mix_checkbox`].tooltipContent}
tooltipText={
tab === 'dispense'
? dispenseMixDisabledTooltipText
: propsForFields.aspirate_mix_checkbox.tooltipContent
}
disabled={
(tab === 'dispense' && formData.path === 'multiDispense') ||
(tab === 'aspirate' && formData.path === 'multiAspirate')
tab === 'dispense'
? isDestinationTrash || formData.path === 'multiDispense'
: formData.path === 'multiAspirate'
}
>
{formData[`${tab}_mix_checkbox`] === true ? (
Expand Down

0 comments on commit 1f67cbe

Please sign in to comment.