From fb284560d1afdfb11cc77a4600cb995f98a33693 Mon Sep 17 00:00:00 2001 From: Viktor Vorona Date: Fri, 9 Aug 2024 10:26:36 +0200 Subject: [PATCH] SONAR-22727 Hide Change in Calculation message if Legacy --- .../apps/code/__tests__/__snapshots__/utils-test.tsx.snap | 6 ------ server/sonar-web/src/main/js/apps/code/utils.ts | 2 -- .../js/components/shared/AnalysisMissingInfoMessage.tsx | 4 +++- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/code/__tests__/__snapshots__/utils-test.tsx.snap b/server/sonar-web/src/main/js/apps/code/__tests__/__snapshots__/utils-test.tsx.snap index 5ada596b663..25f3a9c6527 100644 --- a/server/sonar-web/src/main/js/apps/code/__tests__/__snapshots__/utils-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/code/__tests__/__snapshots__/utils-test.tsx.snap @@ -33,8 +33,6 @@ exports[`getCodeMetrics should return the right metrics for portfolios 1`] = ` "releasability_rating_new", "security_rating", "security_rating_new", - "security_rating", - "security_rating_new", "reliability_rating", "reliability_rating_new", "sqale_rating", @@ -62,8 +60,6 @@ exports[`getCodeMetrics should return the right metrics for portfolios 2`] = ` "releasability_rating_new", "security_rating", "security_rating_new", - "security_rating", - "security_rating_new", "reliability_rating", "reliability_rating_new", "sqale_rating", @@ -98,8 +94,6 @@ exports[`getCodeMetrics should return the right metrics for portfolios 4`] = ` "releasability_rating_new", "security_rating", "security_rating_new", - "security_rating", - "security_rating_new", "reliability_rating", "reliability_rating_new", "sqale_rating", diff --git a/server/sonar-web/src/main/js/apps/code/utils.ts b/server/sonar-web/src/main/js/apps/code/utils.ts index dfbccb985d4..d64528288f3 100644 --- a/server/sonar-web/src/main/js/apps/code/utils.ts +++ b/server/sonar-web/src/main/js/apps/code/utils.ts @@ -40,8 +40,6 @@ const PORTFOLIO_METRICS = [ MetricKey.releasability_rating_new, MetricKey.security_rating, MetricKey.security_rating_new, - MetricKey.security_rating, - MetricKey.security_rating_new, MetricKey.reliability_rating, MetricKey.reliability_rating_new, MetricKey.sqale_rating, diff --git a/server/sonar-web/src/main/js/components/shared/AnalysisMissingInfoMessage.tsx b/server/sonar-web/src/main/js/components/shared/AnalysisMissingInfoMessage.tsx index f625d4f7c26..b0bb17d6cbf 100644 --- a/server/sonar-web/src/main/js/components/shared/AnalysisMissingInfoMessage.tsx +++ b/server/sonar-web/src/main/js/components/shared/AnalysisMissingInfoMessage.tsx @@ -22,6 +22,7 @@ import { FlagMessage } from 'design-system'; import * as React from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import { DocLink } from '../../helpers/doc-links'; +import { useIsLegacyCCTMode } from '../../queries/settings'; import DocumentationLink from '../common/DocumentationLink'; interface AnalysisMissingInfoMessageProps { @@ -35,9 +36,10 @@ export default function AnalysisMissingInfoMessage({ qualifier, className, }: Readonly) { + const { data: isLegacy, isLoading } = useIsLegacyCCTMode(); const intl = useIntl(); - if (hide) { + if (hide || isLoading || isLegacy) { return null; } -- 2.39.5