diff options
author | Viktor Vorona <viktor.vorona@sonarsource.com> | 2024-04-24 14:52:52 +0200 |
---|---|---|
committer | Matteo Mara <matteo.mara@sonarsource.com> | 2024-04-30 10:59:03 +0200 |
commit | cdeb0429be4e9e4c1590e2333bd780e5fa9d1a65 (patch) | |
tree | f4fad82d3127882f1f64e52469eb9faddd8601db /server/sonar-web/src/main/js/components/SourceViewer | |
parent | 57b2e33c8c321d3297631de46e1fda374e3b17d8 (diff) | |
download | sonarqube-cdeb0429be4e9e4c1590e2333bd780e5fa9d1a65.tar.gz sonarqube-cdeb0429be4e9e4c1590e2333bd780e5fa9d1a65.zip |
SONAR-22049 Align getComponentIssuesUrl and getComponentSecurityHotspotsUrl
Diffstat (limited to 'server/sonar-web/src/main/js/components/SourceViewer')
3 files changed, 10 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx index 07ba7e6bfb0..49c1aaac719 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx @@ -21,6 +21,7 @@ import { FlagMessage } from 'design-system'; import { intersection } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getComponentData, getComponentForSourceViewer, @@ -31,7 +32,6 @@ import { ComponentContext } from '../../app/components/componentContext/Componen import { isSameBranchLike } from '../../helpers/branch-like'; import { translate } from '../../helpers/l10n'; import { HttpStatus } from '../../helpers/request'; -import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx index c2372d53b3c..694b4442a7b 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx @@ -38,6 +38,12 @@ import { } from 'design-system'; import * as React from 'react'; import { useIntl } from 'react-intl'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { + getComponentIssuesUrl, + getComponentSecurityHotspotsUrl, +} from '~sonar-aligned/helpers/urls'; import { SOFTWARE_QUALITIES } from '../../helpers/constants'; import { ISSUETYPE_METRIC_KEYS_MAP, @@ -49,14 +55,7 @@ import { collapsedDirFromPath, fileFromPath } from '../../helpers/path'; import { omitNil } from '../../helpers/request'; import { getBaseUrl } from '../../helpers/system'; import { isDefined } from '../../helpers/types'; -import { - getBranchLikeUrl, - getCodeUrl, - getComponentIssuesUrl, - getComponentSecurityHotspotsUrl, -} from '../../helpers/urls'; -import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; +import { getBranchLikeUrl, getCodeUrl } from '../../helpers/urls'; import type { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { IssueType } from '../../types/issues'; @@ -148,8 +147,7 @@ export default function SourceViewerHeader(props: Readonly<Props>) { <span> <StyledDrilldownLink className="sw-body-md" - to={getComponentSecurityHotspotsUrl(project, { - ...getBranchLikeQuery(branchLike), + to={getComponentSecurityHotspotsUrl(project, branchLike, { files: path, ...DEFAULT_ISSUES_QUERY, types: IssueType.SecurityHotspot, diff --git a/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts b/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts index 7627c87f14e..a6f137121f5 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts +++ b/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts @@ -17,9 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { listIssues, searchIssues } from '../../../api/issues'; import { parseIssueFromResponse } from '../../../helpers/issues'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { Issue, RawQuery } from '../../../types/types'; import { DEFAULT_ISSUES_QUERY } from '../../shared/utils'; |