Skip to content

Commit 5dd891b

Browse files
author
Alejandro Fernández Gómez
committed
Use an anchor point for the step
1 parent a0b0fba commit 5dd891b

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

  • x-pack/plugins/observability/public/pages/overview

x-pack/plugins/observability/public/pages/overview/index.tsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -286,18 +286,7 @@ function PageHeader({
286286
onTimeRangeRefresh,
287287
}: PageHeaderProps) {
288288
const { relativeStart, relativeEnd, refreshInterval, refreshPaused } = useDatePickerContext();
289-
290-
const guidedSetupButton = useMemo(
291-
() => (
292-
<EuiButton color="text" iconType="wrench" onClick={handleGuidedSetupClick}>
293-
<FormattedMessage
294-
id="xpack.observability.overview.guidedSetupButton"
295-
defaultMessage="Guided setup"
296-
/>
297-
</EuiButton>
298-
),
299-
[handleGuidedSetupClick]
300-
);
289+
const buttonRef = useRef();
301290

302291
return (
303292
<EuiFlexGroup wrap gutterSize="s" justifyContent="flexEnd">
@@ -316,8 +305,22 @@ function PageHeader({
316305
/>
317306
</EuiFlexItem>
318307
<EuiFlexItem grow={false} style={{ alignItems: 'flex-end' }}>
308+
<EuiButton
309+
// @ts-expect-error the EUI verson that kibana uses right now doesn't have the correct types
310+
buttonRef={buttonRef}
311+
color="text"
312+
iconType="wrench"
313+
onClick={handleGuidedSetupClick}
314+
>
315+
<FormattedMessage
316+
id="xpack.observability.overview.guidedSetupButton"
317+
defaultMessage="Guided setup"
318+
/>
319+
</EuiButton>
319320
{showTour ? (
320321
<EuiTourStep
322+
// @ts-expect-error the EUI verson that kibana uses right now doesn't have the correct types
323+
anchor={() => buttonRef.current}
321324
isStepOpen
322325
title={i18n.translate('xpack.observability.overview.guidedSetupTourTitle', {
323326
defaultMessage: 'Guided setup is always available',
@@ -342,12 +345,8 @@ function PageHeader({
342345
/>
343346
</EuiButtonEmpty>
344347
}
345-
>
346-
{guidedSetupButton}
347-
</EuiTourStep>
348-
) : (
349-
guidedSetupButton
350-
)}
348+
/>
349+
) : null}
351350
</EuiFlexItem>
352351
</EuiFlexGroup>
353352
);

0 commit comments

Comments
 (0)