From 422e4a74167fbc468dd8a1270a70fab2d3f17b1d Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Fri, 27 Aug 2021 17:36:00 +0200 Subject: [PATCH] SONAR-13876 Explicit line of code is for main branch in project info drawer --- .../projectInformation/meta/MetaSize.tsx | 5 ++- .../__snapshots__/MetaSize-test.tsx.snap | 34 +++++++++++++++---- .../resources/org/sonar/l10n/core.properties | 1 + 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx index eb48b01b034..ebafe436f72 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx @@ -39,7 +39,10 @@ export default function MetaSize({ component, measures }: MetaSizeProps) { return ( <> -

{localizeMetric(MetricKey.ncloc)}

+
+

{localizeMetric(MetricKey.ncloc)}

+ ({translate('project.info.main_branch')}) +
{ncloc ? ( <> diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaSize-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaSize-test.tsx.snap index ecea37594c9..a4394d3d0b3 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaSize-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/__snapshots__/MetaSize-test.tsx.snap @@ -2,9 +2,20 @@ exports[`should render correctly: application 1`] = ` -

- metric.ncloc.name -

+
+

+ metric.ncloc.name +

+ + ( + project.info.main_branch + ) + +
@@ -47,9 +58,20 @@ exports[`should render correctly: application 1`] = ` exports[`should render correctly: project 1`] = ` -

- metric.ncloc.name -

+
+

+ metric.ncloc.name +

+ + ( + project.info.main_branch + ) + +
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index f7b92e4fc46..ac4f56e3c04 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -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 #------------------------------------------------------------------------------ # -- 2.39.5