]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12590 Don't show New Code Period menu entry for portfolios or applications
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Mon, 21 Oct 2019 10:19:19 +0000 (12:19 +0200)
committerSonarTech <sonartech@sonarsource.com>
Mon, 28 Oct 2019 19:21:09 +0000 (20:21 +0100)
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx
server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMenu-test.tsx.snap

index 83bd2377ccc8069e34eafc316cb8796072f6770e..aa133ded13d0a36f11002622b8d551bc68fe78ea 100644 (file)
@@ -274,6 +274,9 @@ export class ComponentNavMenu extends React.PureComponent<Props> {
   }
 
   renderBaselineLink() {
+    if (!this.getConfiguration().showSettings || this.isApplication() || this.isPortfolio()) {
+      return null;
+    }
     return (
       <li key="baseline">
         <Link
index b505a2dd16c4076eee1102fae5d976d0a5019b38..025e537c34566ee1b9e68d79662cb59946304d77 100644 (file)
@@ -319,23 +319,6 @@ exports[`should work for all qualifiers 2`] = `
       <ul
         className="menu"
       >
-        <li>
-          <Link
-            activeClassName="active"
-            onlyActiveOnIndex={false}
-            style={Object {}}
-            to={
-              Object {
-                "pathname": "/project/baseline",
-                "query": Object {
-                  "id": "foo",
-                },
-              }
-            }
-          >
-            project_baseline.page
-          </Link>
-        </li>
         <li>
           <Link
             activeClassName="active"
@@ -451,35 +434,6 @@ exports[`should work for all qualifiers 3`] = `
       project_activity.page
     </Link>
   </li>
-  <Dropdown
-    data-test="administration"
-    overlay={
-      <ul
-        className="menu"
-      >
-        <li>
-          <Link
-            activeClassName="active"
-            onlyActiveOnIndex={false}
-            style={Object {}}
-            to={
-              Object {
-                "pathname": "/project/baseline",
-                "query": Object {
-                  "id": "foo",
-                },
-              }
-            }
-          >
-            project_baseline.page
-          </Link>
-        </li>
-      </ul>
-    }
-    tagName="li"
-  >
-    <Component />
-  </Dropdown>
 </NavBarTabs>
 `;
 
@@ -578,23 +532,6 @@ exports[`should work for all qualifiers 4`] = `
       <ul
         className="menu"
       >
-        <li>
-          <Link
-            activeClassName="active"
-            onlyActiveOnIndex={false}
-            style={Object {}}
-            to={
-              Object {
-                "pathname": "/project/baseline",
-                "query": Object {
-                  "id": "foo",
-                },
-              }
-            }
-          >
-            project_baseline.page
-          </Link>
-        </li>
         <li>
           <Link
             activeClassName="active"