From 5e864fcb4d1ab05c7501a610e6611df704608b57 Mon Sep 17 00:00:00 2001 From: 7PH Date: Wed, 14 Aug 2024 17:05:31 +0200 Subject: [PATCH] SONAR-22287 Fix a11y issues in project's Quality Profile page --- .../ProjectQualityProfilesAppRenderer.tsx | 7 +++++-- .../__tests__/projectQualityProfilesApp-it.tsx | 3 +-- .../src/main/resources/org/sonar/l10n/core.properties | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx index c256af2ee11..788c1c708cb 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx @@ -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( { props.onOpenSetProfileModal(projectProfile); }} diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/projectQualityProfilesApp-it.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/projectQualityProfilesApp-it.tsx index 778d5ed87df..ad7168e7f2b 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/projectQualityProfilesApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/projectQualityProfilesApp-it.tsx @@ -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 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 3995b5b280c..fdc05423c42 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -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 #------------------------------------------------------------------------------ # -- 2.39.5