From 7cb0bfa0d208b8c1f3d8a8290d8f084b2123abe3 Mon Sep 17 00:00:00 2001 From: Andrey Luiz Date: Wed, 1 Nov 2023 15:27:12 +0100 Subject: [PATCH] SONAR-20909 Add permanent link to documentation on Sonar Way Quality Gate (#9799) --- .../components/DetailsHeader.tsx | 43 +++++++++++++------ .../components/__tests__/QualityGate-it.tsx | 1 + .../resources/org/sonar/l10n/core.properties | 3 +- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx index 79957e5340f..8a80d6826c7 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx @@ -27,6 +27,7 @@ import { ItemButton, ItemDangerButton, ItemDivider, + LightLabel, SubTitle, } from 'design-system'; import { countBy } from 'lodash'; @@ -105,20 +106,34 @@ export default function DetailsHeader({ {qualityGate.isBuiltIn && ( -

- - {translate('clean_as_you_code')} - - ), - }} - /> -

+ <> + + + {translate('clean_as_you_code')} + + ), + }} + /> + + + + {translate('learn_more')} + + ), + }} + /> + + )} {actionsCount === 1 && ( diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGate-it.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGate-it.tsx index ee43cfe93fb..ce39c5ec511 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGate-it.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGate-it.tsx @@ -82,6 +82,7 @@ it('should render the built-in quality gate properly', async () => { await user.click(builtInQualityGate); }); + expect(await screen.findByText(/quality_gates.is_built_in.cayc.description/)).toBeInTheDocument(); expect(await screen.findByText(/quality_gates.is_built_in.description/)).toBeInTheDocument(); }); 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 73e397be9d9..fe1d5567495 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2127,7 +2127,8 @@ quality_gates.copy=Copy Quality Gate quality_gates.cannot_set_default_no_cayc=You must make this quality gate Clean as You Code compliant to make this the default quality gate. quality_gates.cannot_copy_no_cayc=You must make this quality gate Clean as You Code compliant to copy. quality_gates.is_default_no_conditions=This is the default quality gate, but it has no configured conditions. Please configure at least 1 condition for this quality gate. -quality_gates.is_built_in.description=The only quality gate you need to practice {link} +quality_gates.is_built_in.description=Sonar Way is recommended for most projects. {link} +quality_gates.is_built_in.cayc.description=The only quality gate you need to practice {link} quality_gates.conditions=Conditions quality_gates.conditions.help=Your project will fail the Quality Gate if it crosses any metric thresholds set for New Code or Overall Code. quality_gates.conditions.help.link=See also: Clean as You Code -- 2.39.5