aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2020-10-01 11:42:37 +0200
committersonartech <sonartech@sonarsource.com>2020-10-02 20:07:42 +0000
commit2010ef3ed9580c990d7202c182f915edb3cc6053 (patch)
treeb7aa03fc8c374acf8cbff58c2994874555ee10fe /server/sonar-web
parentcacdd3c3a1e622322be8095398c0d868e0961b35 (diff)
downloadsonarqube-2010ef3ed9580c990d7202c182f915edb3cc6053.tar.gz
sonarqube-2010ef3ed9580c990d7202c182f915edb3cc6053.zip
SONAR-12996 Make copy-path-to-clipboard button more accessible
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx6
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap3
2 files changed, 8 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
index 48b0b8d0b00..20ccd738614 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
@@ -149,7 +149,11 @@ export default class SourceViewerHeader extends React.PureComponent<Props, State
<QualifierIcon qualifier={q} /> <span>{collapsedDirFromPath(path)}</span>
<span className="component-name-file">{fileFromPath(path)}</span>
<span className="nudged-up spacer-left">
- <ClipboardIconButton className="button-link link-no-underline" copyValue={path} />
+ <ClipboardIconButton
+ aria-label={translate('component_viewer.copy_path_to_clipboard')}
+ className="button-link link-no-underline"
+ copyValue={path}
+ />
</span>
</div>
</div>
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap
index 6e53dad11aa..eaf213f5dcf 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap
@@ -45,6 +45,7 @@ exports[`should render correctly for a regular file 1`] = `
className="nudged-up spacer-left"
>
<ClipboardIconButton
+ aria-label="component_viewer.copy_path_to_clipboard"
className="button-link link-no-underline"
copyValue="foo/bar.ts"
/>
@@ -165,6 +166,7 @@ exports[`should render correctly for a unit test 1`] = `
className="nudged-up spacer-left"
>
<ClipboardIconButton
+ aria-label="component_viewer.copy_path_to_clipboard"
className="button-link link-no-underline"
copyValue="foo/bar.ts"
/>
@@ -303,6 +305,7 @@ exports[`should render correctly if issue details are passed 1`] = `
className="nudged-up spacer-left"
>
<ClipboardIconButton
+ aria-label="component_viewer.copy_path_to_clipboard"
className="button-link link-no-underline"
copyValue="foo/bar.ts"
/>