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

PMM-13419 Fix tour #777

Open
wants to merge 3 commits into
base: v3
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion public/app/core/components/AppChrome/AppChromeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { css } from '@emotion/css';
import { useDialog } from '@react-aria/dialog';
import { FocusScope } from '@react-aria/focus';
import { OverlayContainer, useOverlay } from '@react-aria/overlays';
import { useTour } from '@reactour/tour';
import React, { useRef } from 'react';
import CSSTransition from 'react-transition-group/CSSTransition';

Expand Down Expand Up @@ -30,11 +31,15 @@ export function AppChromeMenu({}: Props) {
const isOpen = state.megaMenuOpen && !state.megaMenuDocked;
const onClose = () => chrome.setMegaMenuOpen(false);

// @PERCONA
const { isOpen: isTourOpen } = useTour();

const { overlayProps, underlayProps } = useOverlay(
{
isDismissable: true,
isDismissable: !isTourOpen,
isOpen: true,
onClose,
isKeyboardDismissDisabled: !!isTourOpen,
shouldCloseOnInteractOutside: (element) => {
// don't close when clicking on the menu toggle, let the toggle button handle that
// this prevents some nasty flickering when the menu is open and the toggle button is clicked
Expand Down
4 changes: 4 additions & 0 deletions public/app/percona/shared/core/hooks/tour.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useTour } from '@reactour/tour';
import { useCallback, useEffect, useMemo } from 'react';

import { useGrafana } from 'app/core/context/GrafanaContext';
import * as TourActions from 'app/percona/shared/core/reducers/tour';
import { TourStep, TourType } from 'app/percona/shared/core/reducers/tour';
import { useAppDispatch } from 'app/store/store';
Expand All @@ -14,6 +15,7 @@ const usePerconaTour = () => {
const { steps, tour } = useSelector(getTour);
const reactTour = useTour();
const tourSteps = useMemo(() => (tour ? steps[tour] : []), [tour, steps]);
const { chrome } = useGrafana();

useEffect(() => {
if (reactTour.setSteps) {
Expand All @@ -31,6 +33,8 @@ const usePerconaTour = () => {

const startTour = useCallback(
async (tour: TourType) => {
chrome.setMegaMenuOpen(true);

const firstStep = steps[tour][0];

// wait for the first step element to visible
Expand Down
4 changes: 2 additions & 2 deletions public/app/percona/tour/steps/alerting/alerting.messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const Messages = {
alert: 'Alert Groups show grouped alerts.',
grouping: "Group common alerts into a single alert group to ensure that PMM doesn't fire duplicate alerts.",
},
admin: {
title: 'Admin',
settings: {
title: 'Settings',
configure: 'Use this to configure Alertmanagers in raw JSON format.',
},
};
6 changes: 3 additions & 3 deletions public/app/percona/tour/steps/alerting/alerting.steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ export const getAlertingTourSteps = (isAdmin = false): TourStep[] => [
...(isAdmin
? [
{
selector: '[aria-label="Admin"]',
selector: '[aria-label="Settings"]',
content: (
<SidebarStep title={Messages.admin.title}>
<p>{Messages.admin.configure}</p>
<SidebarStep title={Messages.settings.title}>
<p>{Messages.settings.configure}</p>
</SidebarStep>
),
},
Expand Down
Loading