]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16703 [891680] Purpose of link is not clear in context
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Tue, 26 Jul 2022 13:18:29 +0000 (15:18 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 28 Jul 2022 20:02:56 +0000 (20:02 +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 0e0c64abac6609be20d6d5f333d64628b36c130a..640038b0fc4a144e4c9571930e1da9012deeb705 100644 (file)
@@ -20,7 +20,7 @@
 import * as React from 'react';
 import DrilldownLink from '../../../../../../components/shared/DrilldownLink';
 import SizeRating from '../../../../../../components/ui/SizeRating';
-import { translate } from '../../../../../../helpers/l10n';
+import { translate, translateWithParameters } from '../../../../../../helpers/l10n';
 import { formatMeasure, localizeMetric } from '../../../../../../helpers/measures';
 import { ComponentQualifier } from '../../../../../../types/component';
 import { MetricKey } from '../../../../../../types/metrics';
@@ -45,10 +45,16 @@ export default function MetaSize({ component, measures }: MetaSizeProps) {
         <span className="spacer-left small">({translate('project.info.main_branch')})</span>
       </div>
       <div className="display-flex-center">
-        {ncloc ? (
+        {ncloc && ncloc.value ? (
           <>
             <DrilldownLink className="huge" component={component.key} metric={MetricKey.ncloc}>
-              {formatMeasure(ncloc.value, 'SHORT_INT')}
+              <span
+                aria-label={translateWithParameters(
+                  'project.info.see_more_info_on_x_locs',
+                  ncloc.value
+                )}>
+                {formatMeasure(ncloc.value, 'SHORT_INT')}
+              </span>
             </DrilldownLink>
 
             <span className="spacer-left">
index a4394d3d0b39ec4a559861efdf00532ed5f951b5..c9cbdc417a8b6258bf83d8de224d83b24a2ffca3 100644 (file)
@@ -24,7 +24,11 @@ exports[`should render correctly: application 1`] = `
       component="my-project"
       metric="ncloc"
     >
-      1
+      <span
+        aria-label="project.info.see_more_info_on_x_locs.1.0"
+      >
+        1
+      </span>
     </DrilldownLink>
     <span
       className="spacer-left"
@@ -80,7 +84,11 @@ exports[`should render correctly: project 1`] = `
       component="my-project"
       metric="ncloc"
     >
-      1
+      <span
+        aria-label="project.info.see_more_info_on_x_locs.1.0"
+      >
+        1
+      </span>
     </DrilldownLink>
     <span
       className="spacer-left"
index 744b543192d8946adb14f12312d496262d228a6b..34094e1bfa85e0af94fc1700c39acbee42dd970a 100644 (file)
@@ -1574,6 +1574,7 @@ project.info.quality_gate=Quality Gate used
 project.info.to_notifications=Set notifications
 project.info.notifications=Set notifications
 project.info.main_branch=Main branch
+project.info.see_more_info_on_x_locs=See more information on your {0} lines of code
 
 #------------------------------------------------------------------------------
 #