]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21455 Always show required label on overview cards
author7PH <benjamin.raymond@sonarsource.com>
Thu, 1 Feb 2024 15:22:19 +0000 (16:22 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 1 Feb 2024 20:02:48 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelPercentCards.tsx
server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx
server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx

index b27c94833ffc7d169602de2fb79e80843980d42e..17d5cdc852064518f1484c77a0ab5b893b5c35ca 100644 (file)
@@ -32,14 +32,14 @@ interface Props {
   branch?: BranchLike;
   component: Component;
   measures: MeasureEnhanced[];
-  failedConditions: QualityGateStatusConditionEnhanced[];
+  conditions: QualityGateStatusConditionEnhanced[];
 }
 
 /**
  * Renders Coverage and Duplication cards for the Overview page.
  */
 export default function MeasuresPanelPercentCards(props: Readonly<Props>) {
-  const { useDiffMetric, branch, component, measures, failedConditions } = props;
+  const { useDiffMetric, branch, component, measures, conditions } = props;
 
   const isApp = isApplication(component.qualifier);
 
@@ -48,7 +48,7 @@ export default function MeasuresPanelPercentCards(props: Readonly<Props>) {
       <MeasuresCardPercent
         branchLike={branch}
         componentKey={component.key}
-        conditions={failedConditions}
+        conditions={conditions}
         measures={measures}
         measurementType={MeasurementType.Coverage}
         label="overview.quality_gate.coverage"
@@ -67,7 +67,7 @@ export default function MeasuresPanelPercentCards(props: Readonly<Props>) {
       <MeasuresCardPercent
         branchLike={branch}
         componentKey={component.key}
-        conditions={failedConditions}
+        conditions={conditions}
         measures={measures}
         measurementType={MeasurementType.Duplication}
         label="overview.quality_gate.duplications"
index a127bf27f2d7e0d4fbaaad730ed2bfdaf6c413a0..c1fe8cfce322ebcd147f337a4a8cc9c42634a7ec 100644 (file)
@@ -61,7 +61,6 @@ export default function NewCodeMeasuresPanel(props: Readonly<Props>) {
   const isApp = isApplication(component.qualifier);
 
   const conditions = qgStatuses?.flatMap((qg) => qg.conditions) ?? [];
-  const failedConditions = qgStatuses?.flatMap((qg) => qg.failedConditions) ?? [];
 
   const newIssues = getLeakValue(findMeasure(measures, MetricKey.new_violations));
   const newIssuesCondition = conditions.find((c) => c.metric === MetricKey.new_violations);
@@ -160,7 +159,7 @@ export default function NewCodeMeasuresPanel(props: Readonly<Props>) {
         branch={branch}
         component={component}
         measures={measures}
-        failedConditions={failedConditions}
+        conditions={conditions}
       />
 
       <MeasuresCardNumber
index 5699c44722b8743e41760d0447400181e761e0dc..bd8357db46a08fb19d4e03bb07c8f47f9f0f5f1c 100644 (file)
@@ -57,7 +57,6 @@ export default function OverallCodeMeasuresPanel(props: Readonly<OverallCodeMeas
 
   const isApp = isApplication(component.qualifier);
   const conditions = qgStatuses?.flatMap((qg) => qg.conditions) ?? [];
-  const failedConditions = qgStatuses?.flatMap((qg) => qg.failedConditions) ?? [];
   const acceptedIssues = findMeasure(measures, MetricKey.accepted_issues)?.value;
   const securityHotspots = findMeasure(measures, MetricKey.security_hotspots)?.value;
   const securityRating = findMeasure(measures, MetricKey.security_review_rating)?.value;
@@ -114,7 +113,7 @@ export default function OverallCodeMeasuresPanel(props: Readonly<OverallCodeMeas
           branch={branch}
           component={component}
           measures={measures}
-          failedConditions={failedConditions}
+          conditions={conditions}
         />
 
         <MeasuresCardNumber