Skip to content
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

fix(protocol-designer, step-generation): update prewet behavior in PD #17433

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"newLocation": "New location to move the selected labware",
"nozzles": "Partial pickup requires a tip rack directly on the deck. Full rack pickup requires the Flex 96 Tip Rack Adapter.",
"pipette": "Select the pipette you want to use",
"preWetTip": "Pre-wet by aspirating and dispensing 2/3 of the tip’s max volume",
"preWetTip": "Pre-wet by aspirating and dispensing the total aspiration volume",
"setTemperature": "Select the temperature to set your module to",
"wells": "Select wells",
"volume": "Volume to dispense in each well"
Expand Down
36 changes: 21 additions & 15 deletions protocol-designer/src/molecules/ToggleStepFormField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
ALIGN_CENTER,
Check,
COLORS,
DIRECTION_COLUMN,
Flex,
Expand All @@ -16,12 +17,13 @@
interface ToggleStepFormFieldProps {
title: string
isSelected: boolean
onLabel: string
offLabel: string
toggleUpdateValue: (value: unknown) => void
toggleValue: unknown
tooltipContent: string | null
isDisabled: boolean
isDisabled?: boolean
onLabel?: string
offLabel?: string
toggleElement?: 'toggle' | 'checkbox'
}
export function ToggleStepFormField(
props: ToggleStepFormFieldProps
Expand All @@ -34,34 +36,32 @@
toggleUpdateValue,
toggleValue,
tooltipContent,
isDisabled,
isDisabled = false,
toggleElement = 'toggle',

Check warning on line 40 in protocol-designer/src/molecules/ToggleStepFormField/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/molecules/ToggleStepFormField/index.tsx#L39-L40

Added lines #L39 - L40 were not covered by tests
} = props
const [targetProps, tooltipProps] = useHoverTooltip()

return (
<>
<ListButton
type="noActive"
padding={SPACING.spacing12}
padding={SPACING.spacing16}

Check warning on line 48 in protocol-designer/src/molecules/ToggleStepFormField/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/molecules/ToggleStepFormField/index.tsx#L48

Added line #L48 was not covered by tests
onClick={() => {
if (!isDisabled) {
toggleUpdateValue(!toggleValue)
}
}}
disabled={isDisabled}
>
{tooltipContent != null ? (
<Tooltip tooltipProps={tooltipProps}>{tooltipContent}</Tooltip>
) : null}

<Flex width="100%" flexDirection={DIRECTION_COLUMN} {...targetProps}>
<Flex width="100%" flexDirection={DIRECTION_COLUMN}>

Check warning on line 56 in protocol-designer/src/molecules/ToggleStepFormField/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/molecules/ToggleStepFormField/index.tsx#L56

Added line #L56 was not covered by tests
<Flex
justifyContent={JUSTIFY_SPACE_BETWEEN}
alignItems={ALIGN_CENTER}
>
<StyledText
desktopStyle="bodyDefaultRegular"
color={isDisabled ? COLORS.grey40 : COLORS.black90}
{...targetProps}

Check warning on line 64 in protocol-designer/src/molecules/ToggleStepFormField/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/molecules/ToggleStepFormField/index.tsx#L64

Added line #L64 was not covered by tests
>
{title}
</StyledText>
Expand All @@ -72,15 +72,21 @@
>
{isSelected ? onLabel : offLabel}
</StyledText>
<ToggleButton
disabled={isDisabled}
label={isSelected ? onLabel : offLabel}
toggledOn={isSelected}
/>
{toggleElement === 'toggle' ? (
<ToggleButton
label={isSelected ? onLabel : offLabel}
toggledOn={isSelected}

Check warning on line 78 in protocol-designer/src/molecules/ToggleStepFormField/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/molecules/ToggleStepFormField/index.tsx#L75-L78

Added lines #L75 - L78 were not covered by tests
/>
) : (
<Check color={COLORS.blue50} isChecked={isSelected} />

Check warning on line 81 in protocol-designer/src/molecules/ToggleStepFormField/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/molecules/ToggleStepFormField/index.tsx#L81

Added line #L81 was not covered by tests
)}
</Flex>
</Flex>
</Flex>
</ListButton>
{tooltipContent != null ? (
<Tooltip tooltipProps={tooltipProps}>{tooltipContent}</Tooltip>
) : null}

Check warning on line 89 in protocol-designer/src/molecules/ToggleStepFormField/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/molecules/ToggleStepFormField/index.tsx#L87-L89

Added lines #L87 - L89 were not covered by tests
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
onExit={() => {
dispatch(hoverSelection({ id: null, text: null }))
}}
width="100%"

Check warning on line 34 in protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/PipetteFields/LabwareField.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/PipetteFields/LabwareField.tsx#L34

Added line #L34 was not covered by tests
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@
</StyledText>
</Flex>
}
width="21.875rem"

Check warning on line 363 in protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepFormToolbox.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepFormToolbox.tsx#L363

Added line #L363 was not covered by tests
>
<div
ref={toolsComponentRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import {
CheckboxExpandStepFormField,
InputStepFormField,
ToggleStepFormField,
} from '../../../../../../molecules'
import {
BlowoutLocationField,
Expand Down Expand Up @@ -398,15 +399,16 @@
{t('protocol_steps:advanced_settings')}
</StyledText>
{tab === 'aspirate' ? (
<CheckboxExpandStepFormField
<ToggleStepFormField

Check warning on line 402 in protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx#L402

Added line #L402 was not covered by tests
title={i18n.format(
t('form:step_edit_form.field.preWetTip.label'),
'capitalize'
)}
checkboxValue={propsForFields.preWetTip.value}
isChecked={propsForFields.preWetTip.value === true}
checkboxUpdateValue={propsForFields.preWetTip.updateValue}
tooltipText={propsForFields.preWetTip.tooltipContent}
toggleValue={propsForFields.preWetTip.value}
isSelected={propsForFields.preWetTip.value === true}
toggleUpdateValue={propsForFields.preWetTip.updateValue}
toggleElement="checkbox"
tooltipContent={propsForFields.preWetTip.tooltipContent ?? null}

Check warning on line 411 in protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx#L407-L411

Added lines #L407 - L411 were not covered by tests
/>
) : null}
<CheckboxExpandStepFormField
Expand Down
Loading
Loading