@@ -35,7 +35,7 @@ export default function GlobalContainer(props: Props) { | |||
return ( | |||
<SuggestionsProvider> | |||
{({ suggestions }) => ( | |||
<StartupModal> | |||
<StartupModal location={props.location}> | |||
<div className="global-container"> | |||
<div className="page-wrapper" id="container"> | |||
<div className="page-container"> |
@@ -42,6 +42,7 @@ interface DispatchProps { | |||
} | |||
interface OwnProps { | |||
location: { pathname: string }; | |||
children?: React.ReactNode; | |||
} | |||
@@ -120,7 +121,8 @@ export class StartupModal extends React.PureComponent<Props, State> { | |||
}; | |||
tryAutoOpenOnboarding = () => { | |||
if (this.props.currentUser.showOnboardingTutorial) { | |||
const { currentUser, location } = this.props; | |||
if (currentUser.showOnboardingTutorial && !location.pathname.startsWith('documentation')) { | |||
this.setState({ automatic: true }); | |||
this.openOnboarding(); | |||
} |
@@ -80,6 +80,14 @@ it('should render only the children', async () => { | |||
(get as jest.Mock<any>).mockReturnValueOnce('date'); | |||
(differenceInDays as jest.Mock<any>).mockReturnValueOnce(0); | |||
await shouldNotHaveModals(getWrapper()); | |||
await shouldNotHaveModals( | |||
getWrapper({ | |||
canAdmin: false, | |||
currentUser: { ...LOGGED_IN_USER, showOnboardingTutorial: true }, | |||
location: { pathname: 'documentation/index' } | |||
}) | |||
); | |||
}); | |||
it('should render license prompt', async () => { | |||
@@ -130,6 +138,7 @@ function getWrapper(props = {}) { | |||
canAdmin={true} | |||
currentEdition={EditionKey.enterprise} | |||
currentUser={LOGGED_IN_USER} | |||
location={{ pathname: 'foo/bar' }} | |||
skipOnboarding={jest.fn()} | |||
{...props}> | |||
<div /> |