Skip to content

Commit

Permalink
add touch tip & well order tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
IanLondon committed Mar 26, 2019
1 parent 8ff5837 commit 014393f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TipPositionInput extends React.Component<OP & SP, TipPositionInputState> {
const isTouchTipField = getIsTouchTipField(this.props.fieldName)

const Wrapper = ({children, hoverTooltipHandlers}) => isTouchTipField
? <React.Fragment>{children}</React.Fragment>
? <div {...hoverTooltipHandlers}>{children}</div>
: <FormGroup
label={i18n.t('form.step_edit_form.field.tip_position.label')}
disabled={disabled}
Expand Down Expand Up @@ -82,7 +82,7 @@ class TipPositionInput extends React.Component<OP & SP, TipPositionInputState> {
readOnly
onClick={this.handleOpen}
value={String(value)}
units="mm" />
units={i18n.t('application.units.millimeter')} />
</Wrapper>
)}
</HoverTooltip>
Expand Down
1 change: 1 addition & 0 deletions protocol-designer/src/components/StepEditForm/forms/Mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class MixForm extends React.Component<Props, State> {
<CheckboxRowField
className={styles.small_field}
label={i18n.t('form.step_edit_form.field.touchTip.label')}
tooltipComponent={i18n.t('tooltip.step_fields.defaults.mix_touchTip_checkbox')}
name={'mix_touchTip_checkbox'}
>
<TipPositionField fieldName={'mix_touchTip_mmFromBottom'} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function SourceDestFields (props: Props) {
}
<CheckboxRowField
name={addFieldNamePrefix('touchTip_checkbox')}
tooltipComponent={i18n.t(`tooltip.step_fields.${addFieldNamePrefix('touchTip_checkbox')}`)}
label={i18n.t('form.step_edit_form.field.touchTip.label')}
className={styles.small_field}
>
Expand Down
4 changes: 1 addition & 3 deletions protocol-designer/src/components/StepEditForm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ export function getTooltipForField (stepType: ?string, name: string): ?React.Nod
: name

// specificity cascade for names.
// first level: try getting from step_fields.moveLiquid, fallback to step_fields.default
// first level: "disabled" wins out if disabled arg is true
// second level: prefix. "aspirate_foo" wins over "foo"
const text: string = i18n.t([
`tooltip.step_fields.${stepType}.${name}`,
`tooltip.step_fields.${stepType}.${nameWithoutPrefix}`,
`tooltip.step_fields.defaults.${name}`,
`tooltip.step_fields.defaults.${nameWithoutPrefix}`,
'',
Expand Down
1 change: 1 addition & 0 deletions protocol-designer/src/localization/en/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"pause": "pause"
},
"units": {
"millimeter": "mm",
"microliter": "μL",
"microliterPerSec": "μL/s",
"times": "x",
Expand Down
2 changes: 1 addition & 1 deletion protocol-designer/src/localization/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"tip_position": {"label": "tip position"},
"volume": {"label": "volume"},
"well_order": {
"label": "Well Order",
"label": "Well order",
"option": {
"l2r": "Left to right",
"r2l": "Right to left",
Expand Down
5 changes: 4 additions & 1 deletion protocol-designer/src/localization/en/tooltip.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
"changeTip": "Choose when the robot picks up fresh tips",
"preWetTip": "Pre-wet pipette tip by aspirating and dispensing 2/3 of the tip's max volume",
"tipPosition": "Distance from the bottom of the well",
"touchTip_checkbox": "Touch tip to 4 sides of the well",

"aspirate_touchTip_checkbox": "Touch tip to each side of well after aspirating",
"dispense_touchTip_checkbox": "Touch tip to each side of well after dispensing",
"mix_touchTip_checkbox": "Touch tip to each side of the well after mixing",

"volume": "Volume to dispense in each well"
}
Expand Down

0 comments on commit 014393f

Please sign in to comment.