aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx
diff options
context:
space:
mode:
authorIsmail Cherri <ismail.cherri@sonarsource.com>2024-10-15 17:57:26 +0200
committersonartech <sonartech@sonarsource.com>2024-10-16 20:03:00 +0000
commit4a9e9a5d98c5e3d0c938ef3be2027e08182b958c (patch)
treee9b3575dc86d23b22401c50890da478b2692d2fa /server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx
parent8073032868b6763891a12f4a4b4d4cb2507a179d (diff)
downloadsonarqube-4a9e9a5d98c5e3d0c938ef3be2027e08182b958c.tar.gz
sonarqube-4a9e9a5d98c5e3d0c938ef3be2027e08182b958c.zip
SONAR-23188 Rename isLegacy into isStandardMode and useLegacyCCTMode into useStandardExperienceMode
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx
index 19dfe38e4dc..179b9b1bb6f 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx
@@ -31,7 +31,7 @@ import RatingComponent from '../../../../app/components/metrics/RatingComponent'
import { duplicationRatingConverter } from '../../../../components/measure/utils';
import { translate } from '../../../../helpers/l10n';
import { isDefined } from '../../../../helpers/types';
-import { useIsLegacyCCTMode } from '../../../../queries/settings';
+import { useStandardExperienceMode } from '../../../../queries/settings';
import { Dict } from '../../../../types/types';
import ProjectCardMeasure from './ProjectCardMeasure';
@@ -116,7 +116,7 @@ function renderDuplication(props: ProjectCardMeasuresProps) {
);
}
-function renderRatings(props: ProjectCardMeasuresProps, isLegacy: boolean) {
+function renderRatings(props: ProjectCardMeasuresProps, isStandardMode: boolean) {
const { isNewCode, measures, componentKey } = props;
const measuresByCodeLeak = isNewCode
@@ -124,11 +124,11 @@ function renderRatings(props: ProjectCardMeasuresProps, isLegacy: boolean) {
: [
{
iconLabel: translate(
- `metric.${isLegacy ? MetricKey.vulnerabilities : MetricKey.security_issues}.short_name`,
+ `metric.${isStandardMode ? MetricKey.vulnerabilities : MetricKey.security_issues}.short_name`,
),
noShrink: true,
metricKey:
- isLegacy || measures[MetricKey.security_issues] === undefined
+ isStandardMode || measures[MetricKey.security_issues] === undefined
? MetricKey.vulnerabilities
: MetricKey.security_issues,
metricRatingKey: MetricKey.security_rating,
@@ -136,10 +136,10 @@ function renderRatings(props: ProjectCardMeasuresProps, isLegacy: boolean) {
},
{
iconLabel: translate(
- `metric.${isLegacy ? MetricKey.bugs : MetricKey.reliability_issues}.short_name`,
+ `metric.${isStandardMode ? MetricKey.bugs : MetricKey.reliability_issues}.short_name`,
),
metricKey:
- isLegacy || measures[MetricKey.reliability_issues] === undefined
+ isStandardMode || measures[MetricKey.reliability_issues] === undefined
? MetricKey.bugs
: MetricKey.reliability_issues,
metricRatingKey: MetricKey.reliability_rating,
@@ -147,10 +147,10 @@ function renderRatings(props: ProjectCardMeasuresProps, isLegacy: boolean) {
},
{
iconLabel: translate(
- `metric.${isLegacy ? MetricKey.code_smells : MetricKey.maintainability_issues}.short_name`,
+ `metric.${isStandardMode ? MetricKey.code_smells : MetricKey.maintainability_issues}.short_name`,
),
metricKey:
- isLegacy || measures[MetricKey.maintainability_issues] === undefined
+ isStandardMode || measures[MetricKey.maintainability_issues] === undefined
? MetricKey.code_smells
: MetricKey.maintainability_issues,
metricRatingKey: MetricKey.sqale_rating,
@@ -202,7 +202,7 @@ function renderRatings(props: ProjectCardMeasuresProps, isLegacy: boolean) {
export default function ProjectCardMeasures(props: ProjectCardMeasuresProps) {
const { isNewCode, measures, componentQualifier } = props;
- const { data: isLegacy } = useIsLegacyCCTMode();
+ const { data: isStandardMode } = useStandardExperienceMode();
const { ncloc } = measures;
@@ -218,7 +218,7 @@ export default function ProjectCardMeasures(props: ProjectCardMeasuresProps) {
const measureList = [
renderNewIssues(props),
- ...renderRatings(props, !!isLegacy),
+ ...renderRatings(props, !!isStandardMode),
renderCoverage(props),
renderDuplication(props),
].filter(isDefined);