diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2022-07-26 15:18:29 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-07-28 20:02:56 +0000 |
commit | 50f44189509bc32a1d5665a0d2572068c29c8703 (patch) | |
tree | c95feaf63310b9551daf7bf04af29f3338e0cd4b | |
parent | 5abc3f4b6b5b5a68c1e21f4f1afc3f55186328fc (diff) | |
download | sonarqube-50f44189509bc32a1d5665a0d2572068c29c8703.tar.gz sonarqube-50f44189509bc32a1d5665a0d2572068c29c8703.zip |
SONAR-16703 [891680] Purpose of link is not clear in context
3 files changed, 20 insertions, 5 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 0e0c64abac6..640038b0fc4 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 @@ -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"> 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 a4394d3d0b3..c9cbdc417a8 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 @@ -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" 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 744b543192d..34094e1bfa8 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -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 #------------------------------------------------------------------------------ # |