]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22728 Hide new rating measures if the main ones are not computed + Enable real...
authorViktor Vorona <viktor.vorona@sonarsource.com>
Thu, 22 Aug 2024 08:37:18 +0000 (10:37 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 26 Aug 2024 20:03:08 +0000 (20:03 +0000)
server/sonar-web/src/main/js/queries/measures.ts

index 38ebd2c0c82b2574c76a8f4fe897c3e2e03cb59b..479370883af8ced8d934e617fa4e8ffa0297fa06 100644 (file)
@@ -30,7 +30,6 @@ import {
 import { getAllTimeMachineData } from '../api/time-machine';
 import { getNextPageParam, getPreviousPageParam } from '../helpers/react-query';
 import { getBranchLikeQuery } from '../sonar-aligned/helpers/branch-like';
-import { MetricKey } from '../sonar-aligned/types/metrics';
 import { BranchLike } from '../types/branch-like';
 import { Measure } from '../types/types';
 import { createInfiniteQueryHook, createQueryHook, StaleTime } from './common';
@@ -261,27 +260,6 @@ export const useMeasureQuery = createQueryHook(
   },
 );
 
-const PORTFOLIO_OVERVIEW_METRIC_KEYS = [
-  MetricKey.software_quality_releasability_rating_distribution,
-  MetricKey.software_quality_security_rating_distribution,
-  MetricKey.software_quality_security_review_rating_distribution,
-  MetricKey.software_quality_maintainability_rating_distribution,
-  MetricKey.software_quality_reliability_rating_distribution,
-  MetricKey.software_quality_security_rating_effort,
-  MetricKey.software_quality_security_review_rating_effort,
-  MetricKey.software_quality_maintainability_rating_effort,
-  MetricKey.software_quality_reliability_rating_effort,
-  MetricKey.last_change_on_software_quality_maintainability_rating,
-  MetricKey.last_change_on_software_quality_releasability_rating,
-  MetricKey.last_change_on_software_quality_reliability_rating,
-  MetricKey.last_change_on_software_quality_security_rating,
-  MetricKey.last_change_on_software_quality_security_review_rating,
-  MetricKey.new_software_quality_security_rating_distribution,
-  MetricKey.new_software_quality_security_review_rating_distribution,
-  MetricKey.new_software_quality_maintainability_rating_distribution,
-  MetricKey.new_software_quality_reliability_rating_distribution,
-];
-
 export const useMeasuresQuery = createQueryHook(
   ({
     componentKey,
@@ -300,11 +278,7 @@ export const useMeasuresQuery = createQueryHook(
       queryFn: async () => {
         const measures = await getMeasures({
           component: componentKey,
-          // TODO Remove once BE is ready
-          metricKeys: metricKeys
-            .split(',')
-            .filter((key) => !PORTFOLIO_OVERVIEW_METRIC_KEYS.includes(key as MetricKey))
-            .join(),
+          metricKeys,
         });
 
         const measuresMapByMetricKey = groupBy(measures, 'metric');