]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12996 Make copy-path-to-clipboard button more accessible
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Thu, 1 Oct 2020 09:42:37 +0000 (11:42 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 2 Oct 2020 20:07:42 +0000 (20:07 +0000)
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 48b0b8d0b00949dd9a2d57c0207c88316b093da4..20ccd738614144da4158fbacc7b58bf14dd6ccae 100644 (file)
@@ -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>
index 6e53dad11aa6bf6b090dcc499cb68dc4740e55ca..eaf213f5dcf4a4d6803d384c6eb6cc171c1264da 100644 (file)
@@ -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"
           />
index 16c432c77d0c2c1126d59969347df5d199923943..c035b92189693606cbdc84c63b2b1204554fe04d 100644 (file)
@@ -2518,6 +2518,7 @@ component_viewer.show_details=Show Measures
 component_viewer.file_measures=File measures
 component_viewer.show_all_measures=Show all measures
 component_viewer.no_component=The component has been removed or never existed.
+component_viewer.copy_path_to_clipboard=Copy the file path to the clipboard
 
 source_viewer.view_all_issues=See all issues in this file
 source_viewer.covered=Covered by the following tests