]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20909 Add permanent link to documentation on Sonar Way Quality Gate (#9799)
authorAndrey Luiz <andrey.luiz@sonarsource.com>
Wed, 1 Nov 2023 14:27:12 +0000 (15:27 +0100)
committersonartech <sonartech@sonarsource.com>
Wed, 1 Nov 2023 20:02:35 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/QualityGate-it.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 79957e5340f765431d182f95406028e2ef82da3d..8a80d6826c7ed627e374c500356692e0c537c9f2 100644 (file)
@@ -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({
             </div>
           </div>
           {qualityGate.isBuiltIn && (
-            <p className="sw-mt-4">
-              <FormattedMessage
-                defaultMessage="quality_gates.is_built_in.description"
-                id="quality_gates.is_built_in.description"
-                tagName="p"
-                values={{
-                  link: (
-                    <DocumentationLink to="/user-guide/clean-as-you-code/">
-                      {translate('clean_as_you_code')}
-                    </DocumentationLink>
-                  ),
-                }}
-              />
-            </p>
+            <>
+              <LightLabel className="sw-mt-2">
+                <FormattedMessage
+                  defaultMessage="quality_gates.is_built_in.cayc.description"
+                  id="quality_gates.is_built_in.cayc.description"
+                  values={{
+                    link: (
+                      <DocumentationLink to="/user-guide/clean-as-you-code/">
+                        {translate('clean_as_you_code')}
+                      </DocumentationLink>
+                    ),
+                  }}
+                />
+              </LightLabel>
+              <span className="sw-mt-9">
+                <FormattedMessage
+                  defaultMessage="quality_gates.is_built_in.description"
+                  id="quality_gates.is_built_in.description"
+                  values={{
+                    link: (
+                      <DocumentationLink to="/user-guide/quality-gates/#recommended-quality-gate">
+                        {translate('learn_more')}
+                      </DocumentationLink>
+                    ),
+                  }}
+                />
+              </span>
+            </>
           )}
         </div>
         {actionsCount === 1 && (
index ee43cfe93fb71d6bef6c9085ef7cc9bf06ae6947..ce39c5ec511622f9fe6245cfd3474cc59d5ce448 100644 (file)
@@ -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();
 });
 
index 73e397be9d95b7e6c56af734538f262eb634e913..fe1d55674955cfc11715dfd69133907b9d597ffd 100644 (file)
@@ -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