aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/SourceViewer
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2022-08-25 10:45:27 +0200
committersonartech <sonartech@sonarsource.com>2022-08-29 20:02:53 +0000
commit06f6244b0ae2fd288e05fbdd0bd077a0da9066c4 (patch)
tree5c1cc37e9aee4859a31321b83d32eafad07f2c14 /server/sonar-web/src/main/js/components/SourceViewer
parentc757692a0a8d02998bfd8839c2612e17011013a7 (diff)
downloadsonarqube-06f6244b0ae2fd288e05fbdd0bd077a0da9066c4.tar.gz
sonarqube-06f6244b0ae2fd288e05fbdd0bd077a0da9066c4.zip
SONAR-17027 Align the way we display links (internal & external) in the UI
Diffstat (limited to 'server/sonar-web/src/main/js/components/SourceViewer')
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap28
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap12
5 files changed, 23 insertions, 23 deletions
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 7343f6a8420..eed5622d773 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { Link } from 'react-router-dom';
import { ButtonIcon } from '../../components/controls/buttons';
import { ClipboardIconButton } from '../../components/controls/clipboard';
import Dropdown from '../../components/controls/Dropdown';
@@ -42,6 +41,7 @@ import {
import { BranchLike } from '../../types/branch-like';
import { ComponentQualifier } from '../../types/component';
import { IssueType, Measure, SourceViewerFile } from '../../types/types';
+import Link from '../common/Link';
import { WorkspaceContextShape } from '../workspace/context';
import MeasuresOverlay from './components/MeasuresOverlay';
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap
index 1aa0e65f921..db63a2fa2b5 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeader-test.tsx.snap
@@ -69,7 +69,7 @@ exports[`should render correctly for a regular file 1`] = `
</a>
</li>
<li>
- <Link
+ <ForwardRef(Link)
className="js-new-window"
rel="noopener noreferrer"
target="_blank"
@@ -81,7 +81,7 @@ exports[`should render correctly for a regular file 1`] = `
}
>
component_viewer.new_window
- </Link>
+ </ForwardRef(Link)>
</li>
<li>
<a
@@ -202,7 +202,7 @@ exports[`should render correctly for a unit test 1`] = `
</a>
</li>
<li>
- <Link
+ <ForwardRef(Link)
className="js-new-window"
rel="noopener noreferrer"
target="_blank"
@@ -214,7 +214,7 @@ exports[`should render correctly for a unit test 1`] = `
}
>
component_viewer.new_window
- </Link>
+ </ForwardRef(Link)>
</li>
<li>
<a
@@ -361,7 +361,7 @@ exports[`should render correctly if issue details are passed 1`] = `
<span
className="source-viewer-header-measure-value"
>
- <Link
+ <ForwardRef(Link)
to={
Object {
"hash": "",
@@ -371,7 +371,7 @@ exports[`should render correctly if issue details are passed 1`] = `
}
>
0
- </Link>
+ </ForwardRef(Link)>
</span>
</div>
<div
@@ -386,7 +386,7 @@ exports[`should render correctly if issue details are passed 1`] = `
<span
className="source-viewer-header-measure-value"
>
- <Link
+ <ForwardRef(Link)
to={
Object {
"hash": "",
@@ -396,7 +396,7 @@ exports[`should render correctly if issue details are passed 1`] = `
}
>
2
- </Link>
+ </ForwardRef(Link)>
</span>
</div>
<div
@@ -411,7 +411,7 @@ exports[`should render correctly if issue details are passed 1`] = `
<span
className="source-viewer-header-measure-value"
>
- <Link
+ <ForwardRef(Link)
to={
Object {
"hash": "",
@@ -421,7 +421,7 @@ exports[`should render correctly if issue details are passed 1`] = `
}
>
1
- </Link>
+ </ForwardRef(Link)>
</span>
</div>
<div
@@ -436,7 +436,7 @@ exports[`should render correctly if issue details are passed 1`] = `
<span
className="source-viewer-header-measure-value"
>
- <Link
+ <ForwardRef(Link)
to={
Object {
"hash": "",
@@ -446,7 +446,7 @@ exports[`should render correctly if issue details are passed 1`] = `
}
>
2
- </Link>
+ </ForwardRef(Link)>
</span>
</div>
</div>
@@ -466,7 +466,7 @@ exports[`should render correctly if issue details are passed 1`] = `
</a>
</li>
<li>
- <Link
+ <ForwardRef(Link)
className="js-new-window"
rel="noopener noreferrer"
target="_blank"
@@ -478,7 +478,7 @@ exports[`should render correctly if issue details are passed 1`] = `
}
>
component_viewer.new_window
- </Link>
+ </ForwardRef(Link)>
</li>
<li>
<a
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
index 2716924b6c2..1b392a2cb99 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
@@ -19,7 +19,7 @@
*/
import { groupBy, sortBy } from 'lodash';
import * as React from 'react';
-import { Link } from 'react-router-dom';
+import Link from '../../../components/common/Link';
import QualifierIcon from '../../../components/icons/QualifierIcon';
import { Alert } from '../../../components/ui/Alert';
import { isPullRequest } from '../../../helpers/branch-like';
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx
index 86c8a90e4fd..aba809cc6b6 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx
@@ -19,10 +19,10 @@
*/
import { groupBy, keyBy, sortBy } from 'lodash';
import * as React from 'react';
-import { Link } from 'react-router-dom';
import { getFacets } from '../../../api/issues';
import { getMeasures } from '../../../api/measures';
import { getAllMetrics } from '../../../api/metrics';
+import Link from '../../../components/common/Link';
import { ResetButtonLink } from '../../../components/controls/buttons';
import Modal from '../../../components/controls/Modal';
import IssueTypeIcon from '../../../components/icons/IssueTypeIcon';
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap
index 6b09bf1ea0b..3327c902762 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap
@@ -24,7 +24,7 @@ exports[`should render source file 1`] = `
className="little-spacer-right"
qualifier="TRK"
/>
- <Link
+ <ForwardRef(Link)
to={
Object {
"pathname": "/dashboard",
@@ -33,7 +33,7 @@ exports[`should render source file 1`] = `
}
>
Project Name
- </Link>
+ </ForwardRef(Link)>
</div>
<div
className="display-flex-center little-spacer-top"
@@ -588,7 +588,7 @@ exports[`should render source file 2`] = `
className="little-spacer-right"
qualifier="TRK"
/>
- <Link
+ <ForwardRef(Link)
to={
Object {
"pathname": "/dashboard",
@@ -597,7 +597,7 @@ exports[`should render source file 2`] = `
}
>
Project Name
- </Link>
+ </ForwardRef(Link)>
</div>
<div
className="display-flex-center little-spacer-top"
@@ -1735,7 +1735,7 @@ exports[`should render test file 1`] = `
className="little-spacer-right"
qualifier="TRK"
/>
- <Link
+ <ForwardRef(Link)
to={
Object {
"pathname": "/dashboard",
@@ -1744,7 +1744,7 @@ exports[`should render test file 1`] = `
}
>
Project Name
- </Link>
+ </ForwardRef(Link)>
</div>
<div
className="display-flex-center little-spacer-top"