Skip to content

Commit 8e6792e

Browse files
committed
fix(protocol-designer): fix advanced settings tooltips
This PR fixes a bug where tooltip.json was not retrieved in the StepFormToolbox translation, used to get tooltip content in `propsForFields`. It also grabs the translation from that tooltip file in `makeSingleEditFieldProps` tooltip utilities. Closes RQA-4254
1 parent 49cde9d commit 8e6792e

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

protocol-designer/src/components/molecules/CheckboxExpandStepFormField/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export function CheckboxExpandStepFormField(
3535
disabled = false,
3636
} = fieldProps
3737

38-
const [targetProps, tooltipProps] = useHoverTooltip()
38+
const [targetProps, tooltipProps] = useHoverTooltip({
39+
placement: 'top-start',
40+
})
3941
return (
4042
<>
4143
<ListButton
@@ -53,15 +55,14 @@ export function CheckboxExpandStepFormField(
5355
width="100%"
5456
flexDirection={DIRECTION_COLUMN}
5557
gridGap={SPACING.spacing8}
58+
{...targetProps}
5659
>
5760
<Flex
5861
justifyContent={JUSTIFY_SPACE_BETWEEN}
5962
alignItems={ALIGN_CENTER}
6063
>
6164
<>
62-
<StyledText desktopStyle="bodyDefaultRegular" {...targetProps}>
63-
{title}
64-
</StyledText>
65+
<StyledText desktopStyle="bodyDefaultRegular">{title}</StyledText>
6566
<Btn
6667
data-testid={testId}
6768
onClick={() => {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export function StepFormToolbox(props: StepFormToolboxProps): JSX.Element {
140140
'application',
141141
'shared',
142142
'protocol_steps',
143+
'tooltip',
143144
])
144145
const dispatch = useDispatch()
145146
const { makeSnackbar } = useKitchen()

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,17 @@ export const getVisibleProfileFormLevelErrors = (args: {
193193
})
194194
}
195195
export const getFieldDefaultTooltip = (name: string, t: any): string =>
196-
name != null ? t(`step_fields.defaults.${name}`) : ''
196+
name != null ? t(`tooltip:step_fields.defaults.${name}`) : ''
197197
export const getFieldIndeterminateTooltip = (name: string, t: any): string =>
198-
name != null ? t(`step_fields.indeterminate.${name}`) : ''
198+
name != null ? t(`tooltip:step_fields.indeterminate.${name}`) : ''
199199
export const getSingleSelectDisabledTooltip = (
200200
name: string,
201201
stepType: string,
202202
t: any
203203
): string =>
204204
name != null
205-
? t(`step_fields.${stepType}.disabled.${name}`)
206-
: t(`step_fields.${stepType}.disabled.$generic`)
205+
? t(`tooltip:step_fields.${stepType}.disabled.${name}`)
206+
: t(`tooltip:step_fields.${stepType}.disabled.$generic`)
207207

208208
export const getFieldCaptions = (
209209
name: string,

0 commit comments

Comments
 (0)