From: Viktor Vorona Date: Thu, 22 Aug 2024 08:37:18 +0000 (+0200) Subject: SONAR-22728 Hide new rating measures if the main ones are not computed + Enable real... X-Git-Tag: 10.7.0.96327~178 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6947be9b109ce78551a168c150977c3d3cdbf0be;p=sonarqube.git SONAR-22728 Hide new rating measures if the main ones are not computed + Enable real BE call --- diff --git a/server/sonar-web/src/main/js/queries/measures.ts b/server/sonar-web/src/main/js/queries/measures.ts index 38ebd2c0c82..479370883af 100644 --- a/server/sonar-web/src/main/js/queries/measures.ts +++ b/server/sonar-web/src/main/js/queries/measures.ts @@ -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');