]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13876 Explicit line of code is for main branch in project info drawer
authorMathieu Suen <mathieu.suen@sonarsource.com>
Fri, 27 Aug 2021 15:36:00 +0000 (17:36 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 30 Aug 2021 20:08:20 +0000 (20:08 +0000)
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaSize-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index eb48b01b03421d9387f43088e63a6b2e41b5646a..ebafe436f723b0c00ceb14b24e2dfaa0d1cff2b8 100644 (file)
@@ -39,7 +39,10 @@ export default function MetaSize({ component, measures }: MetaSizeProps) {
 
   return (
     <>
-      <h3>{localizeMetric(MetricKey.ncloc)}</h3>
+      <div className="display-flex-row display-inline-flex-baseline">
+        <h3>{localizeMetric(MetricKey.ncloc)}</h3>
+        <span className="spacer-left small">({translate('project.info.main_branch')})</span>
+      </div>
       <div className="display-flex-center">
         {ncloc ? (
           <>
index ecea37594c9ea7e05b0edc5ba4023b33758dd986..a4394d3d0b39ec4a559861efdf00532ed5f951b5 100644 (file)
@@ -2,9 +2,20 @@
 
 exports[`should render correctly: application 1`] = `
 <Fragment>
-  <h3>
-    metric.ncloc.name
-  </h3>
+  <div
+    className="display-flex-row display-inline-flex-baseline"
+  >
+    <h3>
+      metric.ncloc.name
+    </h3>
+    <span
+      className="spacer-left small"
+    >
+      (
+      project.info.main_branch
+      )
+    </span>
+  </div>
   <div
     className="display-flex-center"
   >
@@ -47,9 +58,20 @@ exports[`should render correctly: application 1`] = `
 
 exports[`should render correctly: project 1`] = `
 <Fragment>
-  <h3>
-    metric.ncloc.name
-  </h3>
+  <div
+    className="display-flex-row display-inline-flex-baseline"
+  >
+    <h3>
+      metric.ncloc.name
+    </h3>
+    <span
+      className="spacer-left small"
+    >
+      (
+      project.info.main_branch
+      )
+    </span>
+  </div>
   <div
     className="display-flex-center"
   >
index f7b92e4fc460d34281ace25acda960498ad69d62..ac4f56e3c04a456a98160bdf755149044b28aad0 100644 (file)
@@ -1550,6 +1550,7 @@ project.info.description=Description
 project.info.quality_gate=Quality Gate used
 project.info.to_notifications=Set notifications
 project.info.notifications=Set notifications
+project.info.main_branch=Main branch
 
 #------------------------------------------------------------------------------
 #