]> source.dussan.org Git - sonarqube.git/commitdiff
SONARCLOUD-174 Do not display onboarding popup on create organization page
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 20 Nov 2018 12:11:42 +0000 (13:11 +0100)
committerSonarTech <sonartech@sonarsource.com>
Tue, 20 Nov 2018 19:20:59 +0000 (20:20 +0100)
server/sonar-web/src/main/js/app/components/StartupModal.tsx
server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx
server/sonar-web/src/main/js/app/components/nav/global/GlobalNavExplore.tsx
server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx

index 3a3b19c755ad2272206d65fb122d912fce761be7..db6913074130b2d9b8d89116a21c9666c6b3e69e 100644 (file)
@@ -163,7 +163,7 @@ export class StartupModal extends React.PureComponent<Props, State> {
     const { currentUser, location } = this.props;
     if (
       currentUser.showOnboardingTutorial &&
-      !['about', 'documentation', 'onboarding', 'projects/create', 'create-organization'].some(
+      !['/about', '/documentation', '/onboarding', '/projects/create', '/create-organization'].some(
         path => location.pathname.startsWith(path)
       )
     ) {
index e04e23bbdac5e53ed1fca54c84cd12b336cb1fd1..4e4691f0d857eb2d48a57376e6b025a0e43ab1db 100644 (file)
@@ -89,7 +89,15 @@ it('should render only the children', async () => {
     getWrapper({
       canAdmin: false,
       currentUser: { ...LOGGED_IN_USER, showOnboardingTutorial: true },
-      location: { pathname: 'documentation/' }
+      location: { pathname: '/documentation/' }
+    })
+  );
+
+  await shouldNotHaveModals(
+    getWrapper({
+      canAdmin: false,
+      currentUser: { ...LOGGED_IN_USER, showOnboardingTutorial: true },
+      location: { pathname: '/create-organization' }
     })
   );
 });
index 267ec368cb187a24ccb8fb8493bfd9b5eed778f6..80bebedbd020add4af55dd54514ea89494ea259c 100644 (file)
@@ -138,7 +138,7 @@ export default class ComponentNavMenu extends React.PureComponent<Props> {
 
   renderIssuesLink() {
     const { location = { pathname: '' } } = this.props;
-    const isIssuesActive = location.pathname.startsWith('project/issues');
+    const isIssuesActive = location.pathname.startsWith('/project/issues');
     return (
       <li>
         <Link
@@ -195,6 +195,7 @@ export default class ComponentNavMenu extends React.PureComponent<Props> {
       return null;
     }
 
+    const { location = { pathname: '' } } = this.props;
     const isActive = location.pathname.startsWith('/project/security_reports');
     return (
       <Dropdown overlay={this.renderSecurityReportsLink()} tagName="li">
index 5ccdbe3ec43aae66d3c4b983d08b03701f48fcc9..ca8870ce470ae94bf22ae5d2496c146626f215e8 100644 (file)
@@ -26,8 +26,7 @@ interface Props {
 }
 
 export default function GlobalNavExplore({ location }: Props) {
-  const active = location.pathname.startsWith('explore');
-
+  const active = location.pathname.startsWith('/explore');
   return (
     <li>
       <Link
index 6ff59a0854daaf55e7f21f85f839cd73da9ba9d3..418dd16875d7a5511cd2c0431da334c437f570f1 100644 (file)
@@ -46,8 +46,8 @@ export default class GlobalNavMenu extends React.PureComponent<Props> {
     }
 
     const active =
-      this.props.location.pathname.startsWith('projects') &&
-      this.props.location.pathname !== 'projects/create';
+      this.props.location.pathname.startsWith('/projects') &&
+      this.props.location.pathname !== '/projects/create';
 
     return (
       <li>