Skip to content

Commit

Permalink
Revert "disable onboarding (#1211)"
Browse files Browse the repository at this point in the history
This reverts commit 858a836.
  • Loading branch information
cescoferraro committed Oct 3, 2022
1 parent d7cdfd5 commit 2ffa133
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion web/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Cypress.Commands.add('cancelOnBoarding', () => {
const parsedValue = value ? JSON.parse(value) : undefined;

if (!parsedValue || parsedValue.trace === false) {
// cy.get('[data-cy=no-thanks]').click();
cy.get('[data-cy=no-thanks]').click();
}
});

Expand Down
30 changes: 25 additions & 5 deletions web/src/components/Header/HeaderMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
import {useTour} from '@reactour/tour';
import {Popover, Typography} from 'antd';
import {useMemo} from 'react';
import {useLocation, useParams} from 'react-router-dom';

import {DOCUMENTATION_URL, GITHUB_URL} from 'constants/Common.constants';
import {useLocation} from 'react-router-dom';
import {useGuidedTour} from 'providers/GuidedTour/GuidedTour.provider';
import HomeAnalyticsService from 'services/Analytics/HomeAnalytics.service';
import * as S from './Header.styled';
import {ShowOnboardingContent} from './ShowOnboardingContent';

const {onGuidedTourClick} = HomeAnalyticsService;

const HeaderMenu = () => {
const {pathname} = useLocation();
const params = useParams();
const {setIsOpen} = useTour();
const {isTriggerVisible, onCloseTrigger, setIsTriggerVisible} = useGuidedTour();

const content = useMemo(
() =>
ShowOnboardingContent(
onGuidedTourClick,
() => setIsOpen(true),
() => onCloseTrigger()
),
[onCloseTrigger, setIsOpen]
);

return (
<Popover
arrowContent={null}
content={() => null}
content={content}
title={() => <Typography.Title level={2}>Take a quick tour of Tracetest?</Typography.Title>}
visible={false}
visible={isTriggerVisible}
>
<S.NavMenu
selectedKeys={[pathname]}
Expand All @@ -39,9 +59,9 @@ const HeaderMenu = () => {
},
{
key: 'Onboarding',
disabled: true,
disabled: !params.runId,
label: (
<a key="guidedTour" aria-disabled>
<a key="guidedTour" onClick={() => setIsTriggerVisible(!isTriggerVisible)}>
Show Onboarding
</a>
),
Expand Down

0 comments on commit 2ffa133

Please sign in to comment.