]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18874 Fix missing aria label in marketplace changelog expand button
author7PH <benjamin.raymond@sonarsource.com>
Wed, 22 Mar 2023 16:35:58 +0000 (17:35 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 27 Mar 2023 20:03:02 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/marketplace/__tests__/PluginUpdates-test.tsx
server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/PluginUpdates-test.tsx.snap
server/sonar-web/src/main/js/apps/marketplace/components/PluginAvailable.tsx
server/sonar-web/src/main/js/apps/marketplace/components/PluginChangeLogButton.tsx
server/sonar-web/src/main/js/apps/marketplace/components/PluginInstalled.tsx
server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx
server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdates.tsx
server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginAvailable-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index dbbb96e1f531f07424063946d6e0754c71fe61e9..7f9cf9c1d0dca3d0743fd7b21743072bab673c4e 100644 (file)
@@ -47,5 +47,5 @@ it('should render correctly', () => {
 });
 
 function shallowRender(props: Partial<PluginUpdatesProps> = {}) {
-  return shallow<PluginUpdatesProps>(<PluginUpdates {...props} />);
+  return shallow<PluginUpdatesProps>(<PluginUpdates pluginName="Xoo" {...props} />);
 }
index 99c865c7a3633823012159ec53dd57208ddcfc1a..a23a7b78f58a9cb9b1e17f2461d2d00375529dcb 100644 (file)
@@ -15,6 +15,7 @@ exports[`should render correctly: with status 1`] = `
   >
     <PluginUpdateItem
       key="1.3"
+      pluginName="Xoo"
       release={
         {
           "date": "2012-02-10",
@@ -34,6 +35,7 @@ exports[`should render correctly: with status 1`] = `
     />
     <PluginUpdateItem
       key="1.1"
+      pluginName="Xoo"
       release={
         {
           "date": "2012-02-01",
@@ -53,6 +55,7 @@ exports[`should render correctly: with status 1`] = `
     />
     <PluginUpdateItem
       key="1.2"
+      pluginName="Xoo"
       release={
         {
           "date": "2012-02-02",
index 7edf3741525cc91b8c45c433c2b656353977225b..1b9fc1a0226de4008388912c41718e45453571a8 100644 (file)
@@ -49,7 +49,11 @@ export default function PluginAvailable(props: PluginAvailableProps) {
             </div>
             <div>
               {plugin.release.description}
-              <PluginChangeLogButton release={plugin.release} update={plugin.update} />
+              <PluginChangeLogButton
+                pluginName={plugin.name}
+                release={plugin.release}
+                update={plugin.update}
+              />
               {plugin.update.requires.length > 0 && (
                 <p className="little-spacer-top">
                   <strong>
index ae2f7fec3cd1ab6db397879b6ecdd807ed3d88fa..f1b073ecaa3655373188e1954e4a0ea9007a8a5b 100644 (file)
@@ -21,21 +21,30 @@ import * as React from 'react';
 import { ButtonLink } from '../../../components/controls/buttons';
 import Dropdown from '../../../components/controls/Dropdown';
 import EllipsisIcon from '../../../components/icons/EllipsisIcon';
+import { translateWithParameters } from '../../../helpers/l10n';
 import { Release, Update } from '../../../types/plugins';
 import PluginChangeLog from './PluginChangeLog';
 
 interface Props {
+  pluginName: string;
   release: Release;
   update: Update;
 }
 
-export default function PluginChangeLogButton({ release, update }: Props) {
+export default function PluginChangeLogButton({ pluginName, release, update }: Props) {
   return (
     <Dropdown
       className="display-inline-block little-spacer-left"
       overlay={<PluginChangeLog release={release} update={update} />}
     >
-      <ButtonLink className="js-changelog">
+      <ButtonLink
+        className="js-changelog"
+        aria-label={translateWithParameters(
+          'marketplace.show_plugin_changelog',
+          pluginName,
+          release.version
+        )}
+      >
         <EllipsisIcon />
       </ButtonLink>
     </Dropdown>
index 91247ed02c66bd1dd8566aed10728474a0b8a1e9..5c7dff86a53d976114522cbd3913c1a0e4bf193b 100644 (file)
@@ -46,7 +46,7 @@ export default function PluginInstalled({ plugin, readOnly, refreshPending, stat
             </strong>
             {translate('marketplace._installed')}
           </li>
-          <PluginUpdates updates={plugin.updates} />
+          <PluginUpdates pluginName={plugin.name} updates={plugin.updates} />
         </ul>
       </td>
 
index e132a21bf2ea9f9ad21d547f76f5d3caa41ecec3..d8e50710ab6b02e159c219dbec8872387c564799 100644 (file)
@@ -24,6 +24,7 @@ import { Release, Update } from '../../../types/plugins';
 import PluginChangeLogButton from './PluginChangeLogButton';
 
 interface Props {
+  pluginName: string;
   update: Update;
   release: Release;
 }
@@ -64,7 +65,11 @@ export default class PluginUpdateItem extends React.PureComponent<Props, State>
         </div>
         <div>
           {release.description}
-          <PluginChangeLogButton release={release} update={update} />
+          <PluginChangeLogButton
+            pluginName={this.props.pluginName}
+            release={release}
+            update={update}
+          />
         </div>
       </li>
     );
index ace41f38af1307f0e03e991c6063e44ac14b9cc6..424590c611b777e8f192688ab0670bf6356b7fe0 100644 (file)
@@ -23,10 +23,11 @@ import { Update } from '../../../types/plugins';
 import PluginUpdateItem from './PluginUpdateItem';
 
 export interface PluginUpdatesProps {
+  pluginName: string;
   updates?: Update[];
 }
 
-export default function PluginUpdates({ updates }: PluginUpdatesProps) {
+export default function PluginUpdates({ pluginName, updates }: PluginUpdatesProps) {
   if (!updates || updates.length <= 0) {
     return null;
   }
@@ -38,6 +39,7 @@ export default function PluginUpdates({ updates }: PluginUpdatesProps) {
           update.release ? (
             <PluginUpdateItem
               key={update.release.version}
+              pluginName={pluginName}
               release={update.release}
               update={update}
             />
index 65fa8c941d5d092ca76e8a4e2a75af62c6a62c3a..51aa9ac7916be024ad1e55b6cfed045e0e27fc05 100644 (file)
@@ -36,6 +36,7 @@ exports[`should render correctly: default 1`] = `
         </div>
         <div>
           <PluginChangeLogButton
+            pluginName="Sonar Foo"
             release={
               {
                 "date": "2020-01-01",
@@ -153,6 +154,7 @@ exports[`should render correctly: has requirements 1`] = `
         </div>
         <div>
           <PluginChangeLogButton
+            pluginName="Sonar Foo"
             release={
               {
                 "date": "2020-01-01",
@@ -307,6 +309,7 @@ exports[`should render correctly: has requirements, some of them already met 1`]
         </div>
         <div>
           <PluginChangeLogButton
+            pluginName="Sonar Foo"
             release={
               {
                 "date": "2020-01-01",
@@ -486,6 +489,7 @@ exports[`should render correctly: read only 1`] = `
         </div>
         <div>
           <PluginChangeLogButton
+            pluginName="Sonar Foo"
             release={
               {
                 "date": "2020-01-01",
index d7ca7d522f7ba04a583a6476a4e1486ef07f06ba..1f5cbd144dd78b812c370b1f60773b7d3e4dd007 100644 (file)
@@ -3109,6 +3109,7 @@ marketplace.update_status.INCOMPATIBLE=Incompatible
 marketplace.update_status.REQUIRES_SYSTEM_UPGRADE=Requires system update
 marketplace.update_status.DEPS_REQUIRE_SYSTEM_UPGRADE=Some of dependencies requires system update
 marketplace.installing_this_plugin_will_also_install_x=Installing this plugin will also install: {0}
+marketplace.show_plugin_changelog=See {0} {1} changelog
 marketplace.update_to_x=Update to {0}
 marketplace.uninstall=Uninstall
 marketplace.i_accept_the=I accept the