From d05dc82a384ab40fe72212d6864dd111b1c023fa Mon Sep 17 00:00:00 2001 From: guillaume-peoch-sonarsource Date: Wed, 8 Nov 2023 14:45:44 +0100 Subject: [PATCH] SONAR-20984 Application's Projects list metrics are not retrieved for "New code" --- .../main/js/apps/code/components/Search.tsx | 25 +++++++++++++++---- .../resources/org/sonar/l10n/core.properties | 1 + 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.tsx b/server/sonar-web/src/main/js/apps/code/components/Search.tsx index 0a95d1baece..9fe54cf31fa 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/Search.tsx @@ -28,7 +28,7 @@ import { getBranchLikeQuery } from '../../../helpers/branch-like'; import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; +import { ComponentQualifier, isPortfolioLike } from '../../../types/component'; import { ComponentMeasure } from '../../../types/types'; interface Props { @@ -144,7 +144,9 @@ export class Search extends React.PureComponent { render() { const { component, newCodeSelected } = this.props; const { loading, query } = this.state; - const isPortfolio = ['VW', 'SVW', 'APP'].includes(component.qualifier); + + const isPortfolio = isPortfolioLike(component.qualifier); + const searchPlaceholder = getSearchPlaceholderLabel(component.qualifier as ComponentQualifier); return (