aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.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/projectActivity/components/ProjectActivityApp.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/projectActivity/components/ProjectActivityApp.tsx')
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx17
1 files changed, 10 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx
index 21cc693dd84..b51a8650651 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx
@@ -38,7 +38,7 @@ import useApplicationLeakQuery from '../../../queries/applications';
import { useCurrentBranchQuery } from '../../../queries/branch';
import { useAllMeasuresHistoryQuery } from '../../../queries/measures';
import { useAllProjectAnalysesQuery } from '../../../queries/project-analyses';
-import { useIsLegacyCCTMode } from '../../../queries/settings';
+import { useStandardExperienceMode } from '../../../queries/settings';
import { isApplication, isProject } from '../../../types/component';
import { MeasureHistory, ParsedAnalysis } from '../../../types/project-activity';
import { Query, parseQuery, serializeUrlQuery } from '../utils';
@@ -73,7 +73,7 @@ export function ProjectActivityApp() {
);
const { data: analysesData, isLoading: isLoadingAnalyses } = useAllProjectAnalysesQuery(enabled);
- const { data: isLegacy, isLoading: isLoadingLegacy } = useIsLegacyCCTMode();
+ const { data: isStandardMode, isLoading: isLoadingStandardMode } = useStandardExperienceMode();
const { data: historyData, isLoading: isLoadingHistory } = useAllMeasuresHistoryQuery(
{
@@ -87,8 +87,11 @@ export function ProjectActivityApp() {
const analyses = React.useMemo(() => analysesData ?? [], [analysesData]);
const measuresHistory = React.useMemo(
- () => (isLoadingLegacy ? [] : mergeRatingMeasureHistory(historyData, parseDate, isLegacy)),
- [historyData, isLegacy, isLoadingLegacy],
+ () =>
+ isLoadingStandardMode
+ ? []
+ : mergeRatingMeasureHistory(historyData, parseDate, isStandardMode),
+ [historyData, isStandardMode, isLoadingStandardMode],
);
const leakPeriodDate = React.useMemo(() => {
@@ -139,11 +142,11 @@ export function ProjectActivityApp() {
return (
component && (
- <Spinner isLoading={isLoadingLegacy}>
+ <Spinner isLoading={isLoadingStandardMode}>
<ProjectActivityAppRenderer
analyses={analyses}
- isLegacy={
- isLegacy ||
+ isStandardMode={
+ isStandardMode ||
!firstSoftwareQualityRatingMetric ||
firstSoftwareQualityRatingMetric.history.every((h) => h.value === undefined)
}