aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorViktor Vorona <viktor.vorona@sonarsource.com>2024-09-09 15:40:38 +0200
committersonartech <sonartech@sonarsource.com>2024-09-11 20:03:48 +0000
commitb2eb04cb77ed01b928695b4f100cebe18cfb0170 (patch)
treef59c945f13482240d90d0a0dc7925b2428f83501 /server
parent3533cda43d9f8d0c7be33eb3d81503f757379cdb (diff)
downloadsonarqube-b2eb04cb77ed01b928695b4f100cebe18cfb0170.tar.gz
sonarqube-b2eb04cb77ed01b928695b4f100cebe18cfb0170.zip
SONAR-22698 Fix activity page for sub-portfolios
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx10
1 files changed, 3 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 f4cb3432bb3..ee3b1c026d0 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
@@ -23,10 +23,7 @@ import { useLocation, useRouter } from '~sonar-aligned/components/hoc/withRouter
import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like';
import { isPortfolioLike } from '~sonar-aligned/helpers/component';
import { MetricKey } from '~sonar-aligned/types/metrics';
-import {
- useComponent,
- useTopLevelComponentKey,
-} from '../../../app/components/componentContext/withComponentContext';
+import { useComponent } from '../../../app/components/componentContext/withComponentContext';
import { useMetrics } from '../../../app/components/metrics/withMetricsContext';
import {
DEFAULT_GRAPH,
@@ -70,9 +67,8 @@ export function ProjectActivityApp() {
component?.key !== undefined &&
(isPortfolioLike(component?.qualifier) || (Boolean(branchLike) && !isFetchingBranch));
- const componentKey = useTopLevelComponentKey();
const { data: appLeaks } = useApplicationLeakQuery(
- componentKey ?? '',
+ component?.key ?? '',
isApplication(component?.qualifier),
);
@@ -81,7 +77,7 @@ export function ProjectActivityApp() {
const { data: historyData, isLoading: isLoadingHistory } = useAllMeasuresHistoryQuery(
{
- component: componentKey,
+ component: component?.key,
branchParams: getBranchLikeQuery(branchLike),
metrics: getHistoryMetrics(query.graph || DEFAULT_GRAPH, parsedQuery.customMetrics).join(','),
},