]> source.dussan.org Git - sonarqube.git/commitdiff
fix project header when organization is not shown
authorStas Vilchik <vilchiks@gmail.com>
Thu, 9 Feb 2017 16:16:58 +0000 (17:16 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 9 Feb 2017 16:16:58 +0000 (17:16 +0100)
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js
server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBreadcrumbs-test.js.snap

index 3f09a2c637bf8c1932f0030deb5519c38109c851..41e616e5496616d37dc93bf7bd8a094b42d85d7f 100644 (file)
@@ -36,11 +36,18 @@ class ComponentNavBreadcrumbs extends React.Component {
       return null;
     }
 
+    const displayOrganization = organization != null && shouldOrganizationBeDisplayed;
+
     const lastItem = breadcrumbs[breadcrumbs.length - 1];
 
     const items = breadcrumbs.map((item, index) => {
       return (
           <span key={item.key}>
+            {!displayOrganization && index === 0 && (
+                <span className="navbar-context-title-qualifier little-spacer-right">
+                  <QualifierIcon qualifier={lastItem.qualifier}/>
+                </span>
+            )}
             <Link to={{ pathname: '/dashboard', query: { id: item.key } }} className="link-base-color">
               {index === breadcrumbs.length - 1 ? (
                   <strong>{item.name}</strong>
@@ -57,7 +64,7 @@ class ComponentNavBreadcrumbs extends React.Component {
 
     return (
         <h2 className="navbar-context-title">
-          {organization != null && shouldOrganizationBeDisplayed && (
+          {displayOrganization && (
               <span>
                 <span className="navbar-context-title-qualifier little-spacer-right">
                   <QualifierIcon qualifier={lastItem.qualifier}/>
index 40c7c51d3b37c5732454c315c921a749279f383d..d9bd895c7b1a75c14011a8a6aa4a4a1b5ee8a6d5 100644 (file)
@@ -2,6 +2,11 @@ exports[`test should not render breadcrumbs with one element 1`] = `
 <h2
   className="navbar-context-title">
   <span>
+    <span
+      className="navbar-context-title-qualifier little-spacer-right">
+      <qualifier-icon
+        qualifier="TRK" />
+    </span>
     <Link
       className="link-base-color"
       onlyActiveOnIndex={false}