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

refactor(app): calcheck: add hover tooltip over table header #5953

Merged
merged 1 commit into from
Jun 18, 2020
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
11 changes: 10 additions & 1 deletion app/src/components/CheckCalibration/EndOfStepComparisons.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as React from 'react'

import cx from 'classnames'

import { Tooltip, useHoverTooltip, TOOLTIP_TOP } from '@opentrons/components'
import { type RobotCalibrationCheckComparison } from '../../calibration'
import { ThresholdValue } from './ThresholdValue'
import { IndividualAxisDifferenceValue } from './DifferenceValue'
Expand All @@ -18,6 +19,8 @@ type EndOfStepComparisonsProps = {|

const TOLERANCE_RANGE = 'tolerance range'
const DIFFERENCE = 'difference'
const DIFFERENCE_TOOLTIP =
'The difference between jogged tip position and saved calibration coordinate.'

const axisToIndex: { [Axis]: number } = {
x: 0,
Expand All @@ -31,13 +34,19 @@ export function EndOfStepComparison(
props: EndOfStepComparisonsProps
): React.Node {
const { thresholdVector, differenceVector } = props.comparison
const [targetProps, tooltipProps] = useHoverTooltip({
placement: TOOLTIP_TOP,
})
return (
<div className={styles.individual_step_comparison_wrapper}>
<table className={cx(styles.pipette_data_table, styles.individual_data)}>
<thead>
<tr>
<th>{TOLERANCE_RANGE}</th>
<th>{DIFFERENCE}</th>
<th>
<span {...targetProps}>{DIFFERENCE}</span>
</th>
<Tooltip {...tooltipProps}>{DIFFERENCE_TOOLTIP}</Tooltip>
</tr>
</thead>
<tbody>
Expand Down
18 changes: 16 additions & 2 deletions app/src/components/CheckCalibration/PipetteComparisons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// @flow
import * as React from 'react'
import cx from 'classnames'
import { Icon } from '@opentrons/components'
import {
Icon,
Tooltip,
useHoverTooltip,
TOOLTIP_TOP,
} from '@opentrons/components'
import { getPipetteModelSpecs } from '@opentrons/shared-data'
import type {
RobotCalibrationCheckInstrument,
Expand All @@ -21,6 +26,8 @@ const POSITION = 'position'
const STATUS = 'status'
const TOLERANCE_RANGE = 'tolerance range'
const DIFFERENCE = 'difference'
const DIFFERENCE_TOOLTIP =
'The difference between jogged tip position and saved calibration coordinate.'

const HEIGHT_CHECK_DISPLAY_NAME = 'Slot 5 Z-axis'
const POINT_ONE_CHECK_DISPLAY_NAME = 'Slot 1 X/Y-axis'
Expand All @@ -45,6 +52,10 @@ export function PipetteComparisons(props: PipetteComparisonsProps): React.Node {
const { pipette, comparisonsByStep } = props

const { displayName } = getPipetteModelSpecs(pipette.model) || {}

const [targetProps, tooltipProps] = useHoverTooltip({
placement: TOOLTIP_TOP,
})
return (
<div className={styles.pipette_data_wrapper}>
<h5 className={styles.pipette_data_header}>
Expand All @@ -58,7 +69,10 @@ export function PipetteComparisons(props: PipetteComparisonsProps): React.Node {
<th>{POSITION}</th>
<th>{STATUS}</th>
<th>{TOLERANCE_RANGE}</th>
<th>{DIFFERENCE}</th>
<th>
<span {...targetProps}>{DIFFERENCE}</span>
</th>
<Tooltip {...tooltipProps}>{DIFFERENCE_TOOLTIP}</Tooltip>
</tr>
</thead>
<tbody>
Expand Down