]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22943 Fix portfolio drilldown link to project (#11730)
authorStanislav <31501873+stanislavhh@users.noreply.github.com>
Thu, 12 Sep 2024 07:23:36 +0000 (09:23 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 12 Sep 2024 20:02:53 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx
server/sonar-web/src/main/js/apps/overview/utils.tsx
server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts
server/sonar-web/src/main/js/helpers/urls.ts

index 18ad9680db76119029b48ccb173b6966ec0e9689..d9f096bdfd63c14f32431fd467dc1359a0e9a626 100644 (file)
@@ -68,9 +68,11 @@ export default function ComponentName({
   const ariaLabel = unclickable ? translate('code.parent_folder') : undefined;
 
   if (
-    [ComponentQualifier.Application, ComponentQualifier.Portfolio].includes(
-      rootComponent.qualifier as ComponentQualifier,
-    ) &&
+    [
+      ComponentQualifier.Application,
+      ComponentQualifier.Portfolio,
+      ComponentQualifier.SubPortfolio,
+    ].includes(rootComponent.qualifier as ComponentQualifier) &&
     [ComponentQualifier.Application, ComponentQualifier.Project].includes(
       component.qualifier as ComponentQualifier,
     )
index 7e34977780e36e14881f9a6f6cafafae61aa89cb..fa7e2786ea54d1b96264597ffc01b721ebe29b72 100644 (file)
@@ -214,7 +214,7 @@ export function getMeasurementMetricKey(type: MeasurementType, useDiffMetric: bo
 
 export const parseQuery = memoize((urlQuery: RawQuery): { codeScope: string } => {
   return {
-    codeScope: parseAsString(urlQuery['code_scope']),
+    codeScope: parseAsString(urlQuery['codeScope']),
   };
 });
 
index d1940cb038537fa727d67b33819ad9854629f3f7..9405edfdf25a42460d9d997faedc8d54ab4d7da0 100644 (file)
@@ -124,7 +124,7 @@ describe('#getComponentOverviewUrl', () => {
     ).toEqual(
       expect.objectContaining({
         pathname: '/dashboard',
-        search: queryToSearchString({ id: SIMPLE_COMPONENT_KEY, code_scope: 'new' }),
+        search: queryToSearchString({ id: SIMPLE_COMPONENT_KEY, codeScope: 'new' }),
       }),
     );
   });
@@ -139,7 +139,7 @@ describe('#getComponentOverviewUrl', () => {
     ).toEqual(
       expect.objectContaining({
         pathname: '/dashboard',
-        search: queryToSearchString({ id: SIMPLE_COMPONENT_KEY, code_scope: 'overall' }),
+        search: queryToSearchString({ id: SIMPLE_COMPONENT_KEY, codeScope: 'overall' }),
       }),
     );
   });
index bb9ed3be926dbd505313121a510f1469a444291b..19ce4896dff624696e754891419d82127b5de6a0 100644 (file)
@@ -88,7 +88,7 @@ export function getProjectUrl(
     search: queryToSearchString({
       id: project,
       branch,
-      ...(codeScope && { code_scope: codeScope }),
+      ...(codeScope && { codeScope }),
     }),
   };
 }
@@ -110,7 +110,7 @@ export function getProjectQueryUrl(
     search: queryToSearchString({
       id: project,
       ...branchParameters,
-      ...(codeScope && { code_scope: codeScope }),
+      ...(codeScope && { codeScope }),
     }),
   };
 }