From a14fca9514e6b8fe3bc4ee292f1beab277620d18 Mon Sep 17 00:00:00 2001 From: Ian London Date: Tue, 26 Mar 2019 17:24:37 -0400 Subject: [PATCH] feat(protocol-designer): assorted form tweaks (#3260) * add/update change tip, touch tip, & well order tooltips * shuffle advanced settings fields around --- .../components/StepEditForm/StepEditForm.css | 2 - .../fields/ChangeTip/ChangeTip.js | 15 +++++-- .../StepEditForm/fields/TipPosition/index.js | 4 +- .../StepEditForm/fields/WellOrder/index.js | 45 +++++++++++-------- .../src/components/StepEditForm/forms/Mix.js | 1 + .../forms/MoveLiquid/SourceDestFields.js | 39 +++++++++------- .../src/components/StepEditForm/utils.js | 4 +- .../src/localization/en/application.json | 1 + .../src/localization/en/form.json | 20 ++++----- .../src/localization/en/tooltip.json | 5 ++- 10 files changed, 82 insertions(+), 54 deletions(-) diff --git a/protocol-designer/src/components/StepEditForm/StepEditForm.css b/protocol-designer/src/components/StepEditForm/StepEditForm.css index 427d229694d..b0150fc0359 100644 --- a/protocol-designer/src/components/StepEditForm/StepEditForm.css +++ b/protocol-designer/src/components/StepEditForm/StepEditForm.css @@ -58,8 +58,6 @@ border: none; overflow: auto; outline: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; box-shadow: none; resize: none; } diff --git a/protocol-designer/src/components/StepEditForm/fields/ChangeTip/ChangeTip.js b/protocol-designer/src/components/StepEditForm/fields/ChangeTip/ChangeTip.js index 08203ca58b7..09e1559a845 100644 --- a/protocol-designer/src/components/StepEditForm/fields/ChangeTip/ChangeTip.js +++ b/protocol-designer/src/components/StepEditForm/fields/ChangeTip/ChangeTip.js @@ -18,11 +18,20 @@ const ChangeTipField = (props: Props) => { const {name, disabledOptions} = props const options = props.options.map((value) => { - const toolTip = i18n.t(`form.step_edit_form.field.change_tip.option_tooltip.${value}`) + const tooltip = ( +
+ {i18n.t(`form.step_edit_form.field.change_tip.option_tooltip.${value}`)} +
+ ) + const option = i18n.t(`form.step_edit_form.field.change_tip.option.${value}`) const label = ( - - {(hoverTooltipHandlers) =>
{option}
} + {(hoverTooltipHandlers) =>
{option}
}
) return { diff --git a/protocol-designer/src/components/StepEditForm/fields/TipPosition/index.js b/protocol-designer/src/components/StepEditForm/fields/TipPosition/index.js index 54ffb3006b8..75a3d6d1aaf 100644 --- a/protocol-designer/src/components/StepEditForm/fields/TipPosition/index.js +++ b/protocol-designer/src/components/StepEditForm/fields/TipPosition/index.js @@ -49,7 +49,7 @@ class TipPositionInput extends React.Component { const isTouchTipField = getIsTouchTipField(this.props.fieldName) const Wrapper = ({children, hoverTooltipHandlers}) => isTouchTipField - ? {children} + ?
{children}
: { readOnly onClick={this.handleOpen} value={String(value)} - units="mm" /> + units={i18n.t('application.units.millimeter')} /> )}
diff --git a/protocol-designer/src/components/StepEditForm/fields/WellOrder/index.js b/protocol-designer/src/components/StepEditForm/fields/WellOrder/index.js index e9bdd54a696..271dcd20010 100644 --- a/protocol-designer/src/components/StepEditForm/fields/WellOrder/index.js +++ b/protocol-designer/src/components/StepEditForm/fields/WellOrder/index.js @@ -1,15 +1,18 @@ // @flow import * as React from 'react' import {connect} from 'react-redux' -import {FormGroup} from '@opentrons/components' +import {HoverTooltip, FormGroup} from '@opentrons/components' import cx from 'classnames' +import i18n from '../../../../localization' import {selectors as stepFormSelectors} from '../../../../step-forms' -import styles from './WellOrderInput.css' -import stepEditStyles from '../../StepEditForm.css' -import WellOrderModal from './WellOrderModal' import ZIG_ZAG_IMAGE from '../../../../images/zig_zag_icon.svg' +import WellOrderModal from './WellOrderModal' + import type {BaseState} from '../../../../types' +import stepEditStyles from '../../StepEditForm.css' +import styles from './WellOrderInput.css' + type OP = { className?: ?string, label?: string, @@ -30,20 +33,26 @@ class WellOrderInput extends React.Component { [stepEditStyles.no_label]: !this.props.label, }) return ( - - - - + + {(hoverTooltipHandlers) => +
+ + + + +
+ } +
) } } diff --git a/protocol-designer/src/components/StepEditForm/forms/Mix.js b/protocol-designer/src/components/StepEditForm/forms/Mix.js index c62cf2511e5..ac17db2a6e0 100644 --- a/protocol-designer/src/components/StepEditForm/forms/Mix.js +++ b/protocol-designer/src/components/StepEditForm/forms/Mix.js @@ -97,6 +97,7 @@ class MixForm extends React.Component { diff --git a/protocol-designer/src/components/StepEditForm/forms/MoveLiquid/SourceDestFields.js b/protocol-designer/src/components/StepEditForm/forms/MoveLiquid/SourceDestFields.js index 5fb4d08c557..c8c8a2b3983 100644 --- a/protocol-designer/src/components/StepEditForm/forms/MoveLiquid/SourceDestFields.js +++ b/protocol-designer/src/components/StepEditForm/forms/MoveLiquid/SourceDestFields.js @@ -29,6 +29,24 @@ function SourceDestFields (props: Props) { const {className, focusHandlers, prefix} = props const addFieldNamePrefix = makeAddFieldNamePrefix(prefix) + const mixFields = ( + + + + + ) + return (
@@ -48,6 +66,7 @@ function SourceDestFields (props: Props) { label={i18n.t('form.step_edit_form.field.preWetTip.label')} className={styles.small_field} /> + {mixFields} } + + {prefix === 'dispense' && mixFields} + - - - - + {prefix === 'dispense' &&