aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViktor Vorona <viktor.vorona@sonarsource.com>2024-08-09 10:26:36 +0200
committersonartech <sonartech@sonarsource.com>2024-08-26 20:03:05 +0000
commitfb284560d1afdfb11cc77a4600cb995f98a33693 (patch)
tree82b2726d084d1d0ee06b3cf66f2b7149599faac9
parent69aa352100a5b14f0530007f9015a093e856d8a0 (diff)
downloadsonarqube-fb284560d1afdfb11cc77a4600cb995f98a33693.tar.gz
sonarqube-fb284560d1afdfb11cc77a4600cb995f98a33693.zip
SONAR-22727 Hide Change in Calculation message if Legacy
-rw-r--r--server/sonar-web/src/main/js/apps/code/__tests__/__snapshots__/utils-test.tsx.snap6
-rw-r--r--server/sonar-web/src/main/js/apps/code/utils.ts2
-rw-r--r--server/sonar-web/src/main/js/components/shared/AnalysisMissingInfoMessage.tsx4
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<AnalysisMissingInfoMessageProps>) {
+ const { data: isLegacy, isLoading } = useIsLegacyCCTMode();
const intl = useIntl();
- if (hide) {
+ if (hide || isLoading || isLegacy) {
return null;
}