]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-23250 Rename softwareQualityImpact to impacts
authorViktor Vorona <viktor.vorona@sonarsource.com>
Fri, 11 Oct 2024 07:05:24 +0000 (09:05 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 16 Oct 2024 20:03:02 +0000 (20:03 +0000)
server/sonar-web/src/main/js/api/mocks/CodingRulesServiceMock.ts
server/sonar-web/src/main/js/api/quality-profiles.ts
server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx

index 27e43c8dee564973163045090c1fa0f3575bdabe..6d14b4948c0a6bed1accdecf8a14034b870cf0e4 100644 (file)
@@ -607,10 +607,10 @@ export default class CodingRulesServiceMock {
       ) &&
       (!data.severity || currentActivation.severity === data.severity) &&
       currentActivation.prioritizedRule === data.prioritizedRule &&
-      (!data.softwareQualityImpact ||
+      (!data.impacts ||
         isEqual(
           currentActivation.impacts,
-          Object.entries(data.softwareQualityImpact).map(([softwareQuality, severity]) => ({
+          Object.entries(data.impacts).map(([softwareQuality, severity]) => ({
             softwareQuality,
             severity,
           })),
@@ -623,8 +623,8 @@ export default class CodingRulesServiceMock {
     const inheritedImpacts =
       this.rulesActivations[data.rule]?.find(({ qProfile }) => qProfile === data.key)?.impacts ??
       [];
-    const severity = data.softwareQualityImpact
-      ? MQRtoStandardSeverityMap[data.softwareQualityImpact[SoftwareQuality.Maintainability]]
+    const severity = data.impacts
+      ? MQRtoStandardSeverityMap[data.impacts[SoftwareQuality.Maintainability]]
       : data.severity;
     const impacts = data.severity
       ? [
@@ -642,7 +642,7 @@ export default class CodingRulesServiceMock {
               StandardtoMQRSeverityMap[data.severity as keyof typeof StandardtoMQRSeverityMap],
           },
         ]
-      : Object.entries(data.softwareQualityImpact ?? {}).map(
+      : Object.entries(data.impacts ?? {}).map(
           ([softwareQuality, severity]: [SoftwareQuality, SoftwareImpactSeverity]) => ({
             softwareQuality,
             severity,
index 124b2b0abe060f0fad8db9183f1c172bb46a34ca..f8ed8782c794d939794210c50fbcde435b7a174e 100644 (file)
@@ -326,25 +326,23 @@ export function bulkDeactivateRules(data: BulkActivateParameters) {
 }
 
 export interface ActivateRuleParameters {
+  impacts?: Record<SoftwareQuality, SoftwareImpactSeverity>;
   key: string;
   params?: Record<string, string>;
   prioritizedRule?: boolean;
   reset?: boolean;
   rule: string;
   severity?: string;
-  softwareQualityImpact?: Record<SoftwareQuality, SoftwareImpactSeverity>;
 }
 
 export function activateRule(data: ActivateRuleParameters) {
   const params =
     data.params && map(data.params, (value, key) => `${key}=${csvEscape(value)}`).join(';');
-  const softwareQualityImpact =
-    data.softwareQualityImpact &&
-    map(data.softwareQualityImpact, (value, key) => `${key}=${value}`).join(';');
+  const impacts = data.impacts && map(data.impacts, (value, key) => `${key}=${value}`).join(';');
   return post('/api/qualityprofiles/activate_rule', {
     ...data,
     params,
-    softwareQualityImpact,
+    impacts,
   }).catch(throwGlobalError);
 }
 
index 6c439093d7c6197524530cef04aef36ad3c4073f..d4ab8d8557dacea1732369b9a8d0d7f003bd7ad2 100644 (file)
@@ -128,7 +128,7 @@ export default function ActivationFormModal(props: Readonly<Props>) {
       rule: rule.key,
       severity: !isMQRMode ? severity : undefined,
       prioritizedRule,
-      softwareQualityImpact: isMQRMode
+      impacts: isMQRMode
         ? (Object.fromEntries(impacts) as Record<SoftwareQuality, SoftwareImpactSeverity>)
         : undefined,
     };