]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22287 Fix a11y issues in project's Quality Profile page
author7PH <benjamin.raymond@sonarsource.com>
Wed, 14 Aug 2024 15:05:31 +0000 (17:05 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 20 Aug 2024 20:02:56 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx
server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/projectQualityProfilesApp-it.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index c256af2ee11aad943ea356134d1d3e194b31c17a..788c1c708cb2a7d40f938ef6c8092910d4e15cfc 100644 (file)
@@ -42,7 +42,7 @@ import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip';
 import { Profile } from '../../api/quality-profiles';
 import Suggestions from '../../components/embed-docs-modal/Suggestions';
 import { DocLink } from '../../helpers/doc-links';
-import { translate } from '../../helpers/l10n';
+import { translate, translateWithParameters } from '../../helpers/l10n';
 import { getRulesUrl } from '../../helpers/urls';
 import { Component } from '../../types/types';
 import BuiltInQualityProfileBadge from '../quality-profiles/components/BuiltInQualityProfileBadge';
@@ -150,7 +150,10 @@ export default function ProjectQualityProfilesAppRenderer(
                         <ActionCell>
                           <InteractiveIcon
                             Icon={PencilIcon}
-                            aria-label={translate('project_quality_profile.change_profile')}
+                            aria-label={translateWithParameters(
+                              'project_quality_profile.change_profile_x',
+                              profile.languageName,
+                            )}
                             onClick={() => {
                               props.onOpenSetProfileModal(projectProfile);
                             }}
index 778d5ed87dfdbb210fa49e194e57febce910e9f3..ad7168e7f2b2865d3f9d824fd79f5f48d56f2fb3 100644 (file)
@@ -126,7 +126,6 @@ const ui = {
     name: 'project_quality_profile.always_use_specific',
   }),
   buttonSave: byRole('button', { name: 'save' }),
-  buttonChangeProfile: byRole('button', { name: 'project_quality_profile.change_profile' }),
   htmlLanguage: byText('HTML'),
   htmlProfile: byText('html profile'),
   cssLanguage: byText('CSS'),
@@ -199,7 +198,7 @@ it('should be able to add and change profile for languages', async () => {
   expect(ui.builtInTag.query()).not.toBeInTheDocument();
 
   await user.click(
-    htmlRow.byRole('button', { name: 'project_quality_profile.change_profile' }).get(),
+    htmlRow.byRole('button', { name: 'project_quality_profile.change_profile_x.HTML' }).get(),
   );
 
   //Opens modal to change profile
index 3995b5b280cd50d9494311d9b6b627d6de5e6a15..fdc05423c42e2f6ac860f016d8e9362ac08d02d6 100644 (file)
@@ -2046,7 +2046,7 @@ project_quality_profile.add_language_modal.choose_profile=Choose a profile
 project_quality_profile.add_language_modal.no_active_rules=this profile has no active rules
 project_quality_profile.add_language_modal.profile_unavailable_no_active_rules=This profile has no active rules, and cannot be used. Please enable at least 1 rule before using this profile.
 project_quality_profile.add_language_modal.go_to_profile=Go to Quality Profile
-project_quality_profile.change_profile=Change profile
+project_quality_profile.change_profile_x=Change {x} profile
 
 #------------------------------------------------------------------------------
 #