]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21112 Drop 'issue' and 'rule' word repetition in CCT badges
author7PH <benjamin.raymond@sonarsource.com>
Tue, 28 Nov 2023 16:39:03 +0000 (17:39 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 1 Dec 2023 20:02:43 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/coding-rules/utils-tests.tsx
server/sonar-web/src/main/js/apps/issues/__tests__/IssueHeader-it.tsx
server/sonar-web/src/main/js/apps/quality-profiles/changelog/__tests__/ChangelogContainer-it.tsx
server/sonar-web/src/main/js/components/shared/CleanCodeAttributePill.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index b2bb9d640028200924bb641cd17f2a4a079737d1..b668e0fab23ecf481d0ddf202019dab9666a812f 100644 (file)
@@ -114,7 +114,7 @@ const selectors = {
   cancelButton: byRole('button', { name: 'cancel' }),
   removeButton: byRole('button', { name: 'remove' }),
   ruleCleanCodeAttributeCategory: (category: CleanCodeAttributeCategory) =>
-    byText(`rule.clean_code_attribute_category.${category}.title_short`),
+    byText(`rule.clean_code_attribute_category.${category}`),
   ruleCleanCodeAttribute: (attribute: CleanCodeAttribute) =>
     byText(new RegExp(`rule\\.clean_code_attribute\\.${attribute}$`)),
   ruleSoftwareQuality: (quality: SoftwareQuality) => byText(`software_quality.${quality}`),
index 23d7d74101e5e7f95530bb4854707040d9955bb8..e15e23d32235cd3c228746f88cb85dce03680ce5 100644 (file)
@@ -52,7 +52,7 @@ it('renders correctly', async () => {
 
   // CCT attribute
   const cctBadge = byText(
-    `issue.clean_code_attribute_category.${issue.cleanCodeAttributeCategory}.title_short`,
+    `issue.clean_code_attribute_category.${issue.cleanCodeAttributeCategory}`,
   ).get();
   expect(cctBadge).toBeInTheDocument();
   await expect(cctBadge).toHaveATooltipWithContent(
index b2e05bc57ec7e11e47bda3f48263fcb3d952ac31..7a9fa5131f106ec1c0f8a1d41f91b2f192141cf8 100644 (file)
@@ -92,7 +92,7 @@ it('should see the changelog', async () => {
     'April 23, 2019',
     'System',
     'quality_profiles.changelog.DEACTIVATED',
-    'Rule 0issue.clean_code_attribute_category.RESPONSIBLE.title_shortsoftware_quality.SECURITYsoftware_quality.MAINTAINABILITY',
+    'Rule 0issue.clean_code_attribute_category.RESPONSIBLEsoftware_quality.SECURITYsoftware_quality.MAINTAINABILITY',
     [/quality_profiles.deprecated_severity_set_to severity.MAJOR/],
   );
   ui.checkRow(
@@ -100,7 +100,7 @@ it('should see the changelog', async () => {
     '',
     '',
     '',
-    'Rule 1issue.clean_code_attribute_category.RESPONSIBLE.title_shortsoftware_quality.SECURITYsoftware_quality.MAINTAINABILITY',
+    'Rule 1issue.clean_code_attribute_category.RESPONSIBLEsoftware_quality.SECURITYsoftware_quality.MAINTAINABILITY',
     [
       /quality_profiles.deprecated_severity_set_to severity.CRITICAL/,
       /quality_profiles.changelog.cca_and_category_changed.*COMPLETE.*INTENTIONAL.*LAWFUL.*RESPONSIBLE/,
index c1c7883a8adcd19a0d62b787b6bc9e9fa4a5282a..95c7d81dc861b4f1d9021f4145e0e8fa851493da 100644 (file)
@@ -31,7 +31,7 @@ export interface Props {
   cleanCodeAttribute?: CleanCodeAttribute;
 }
 
-export function CleanCodeAttributePill(props: Props) {
+export function CleanCodeAttributePill(props: Readonly<Props>) {
   const { className, cleanCodeAttributeCategory, cleanCodeAttribute, type = 'issue' } = props;
 
   return (
@@ -65,12 +65,7 @@ export function CleanCodeAttributePill(props: Props) {
     >
       <Pill variant="neutral" data-guiding-id="issue-1" className={className}>
         <span className={classNames({ 'sw-font-semibold': !!cleanCodeAttribute })}>
-          {translate(
-            type,
-            'clean_code_attribute_category',
-            cleanCodeAttributeCategory,
-            'title_short',
-          )}
+          {translate(type, 'clean_code_attribute_category', cleanCodeAttributeCategory)}
         </span>
         {cleanCodeAttribute && (
           <span> | {translate(type, 'clean_code_attribute', cleanCodeAttribute)}</span>
index 8a2ae88b08bd4b38bf9bbe90782330ba9c2f144a..b3d5b50819f83e2964900656d51b5edc493b1a07 100644 (file)
@@ -995,19 +995,15 @@ issue.impact.severity.tooltip=This issue has a {severity} impact on the {quality
 issue.clean_code_attribute_category.CONSISTENT=Consistency
 issue.clean_code_attribute_category.CONSISTENT.title=This is a consistency issue.
 issue.clean_code_attribute_category.CONSISTENT.advice=To be consistent, the code needs to be written in a uniform and conventional way.
-issue.clean_code_attribute_category.CONSISTENT.title_short=Consistency issue
 issue.clean_code_attribute_category.INTENTIONAL=Intentionality
 issue.clean_code_attribute_category.INTENTIONAL.title=This is an intentionality issue.
 issue.clean_code_attribute_category.INTENTIONAL.advice=To be intentional, the code content needs to be precise and purposeful.
-issue.clean_code_attribute_category.INTENTIONAL.title_short=Intentionality issue
 issue.clean_code_attribute_category.ADAPTABLE=Adaptability
 issue.clean_code_attribute_category.ADAPTABLE.title=This is an adaptability issue.
 issue.clean_code_attribute_category.ADAPTABLE.advice=To be adaptable, the code needs to be structured to be easy to evolve and develop with confidence.
-issue.clean_code_attribute_category.ADAPTABLE.title_short=Adaptability issue
 issue.clean_code_attribute_category.RESPONSIBLE=Responsibility
 issue.clean_code_attribute_category.RESPONSIBLE.title=This is a responsibility issue.
 issue.clean_code_attribute_category.RESPONSIBLE.advice=To be responsible, the code must take into account its ethical obligations on data and potential impact of societal norms.
-issue.clean_code_attribute_category.RESPONSIBLE.title_short=Responsibility issue
 
 issue.clean_code_attribute=Clean Code Attribute
 issue.clean_code_attribute.CLEAR=Not clear
@@ -2475,16 +2471,12 @@ rule.impact.severity.tooltip=Issues found for this rule will have a {severity} i
 
 rule.clean_code_attribute_category.CONSISTENT=Consistency
 rule.clean_code_attribute_category.CONSISTENT.title=This is a consistency rule.
-rule.clean_code_attribute_category.CONSISTENT.title_short=Consistency rule
 rule.clean_code_attribute_category.INTENTIONAL=Intentionality
 rule.clean_code_attribute_category.INTENTIONAL.title=This is an intentionality rule.
-rule.clean_code_attribute_category.INTENTIONAL.title_short=Intentionality rule
 rule.clean_code_attribute_category.ADAPTABLE=Adaptability
 rule.clean_code_attribute_category.ADAPTABLE.title=This is an adaptability rule.
-rule.clean_code_attribute_category.ADAPTABLE.title_short=Adaptability rule
 rule.clean_code_attribute_category.RESPONSIBLE=Responsibility
 rule.clean_code_attribute_category.RESPONSIBLE.title=This is a responsibility rule.
-rule.clean_code_attribute_category.RESPONSIBLE.title_short=Responsibility rule
 
 rule.clean_code_attribute.CLEAR=Clear
 rule.clean_code_attribute.CLEAR.title=This is an intentionality rule, the code should be clear.