aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2021-09-16 15:24:51 +0200
committersonartech <sonartech@sonarsource.com>2021-09-17 20:03:26 +0000
commit3852fab0f025560ce085c35f9e37fc37a7b917d2 (patch)
treec067f3eb42a14f608da534755c6c33e201f2f3c3
parent03d04ef5c29de60153eadf566530bfbc56ee9b3f (diff)
downloadsonarqube-3852fab0f025560ce085c35f9e37fc37a7b917d2.tar.gz
sonarqube-3852fab0f025560ce085c35f9e37fc37a7b917d2.zip
SONAR-15404 Fix documentation tooltip links when running in a web context
-rw-r--r--server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx6
-rw-r--r--server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/DocumentationTooltip-test.tsx.snap16
2 files changed, 13 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx b/server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx
index 62de7cb0281..57d2d3738ad 100644
--- a/server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx
+++ b/server/sonar-web/src/main/js/components/common/DocumentationTooltip.tsx
@@ -58,14 +58,14 @@ export default function DocumentationTooltip(props: DocumentationTooltipProps) {
<span>{label}</span>
</Link>
) : (
- <a
+ <Link
className="display-inline-flex-center link-with-icon"
- href={href}
+ to={href}
rel="noopener noreferrer"
target="_blank">
{isWebUri(href) && <DetachIcon size={14} className="spacer-right" />}
<span>{label}</span>
- </a>
+ </Link>
)}
</div>
))}
diff --git a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/DocumentationTooltip-test.tsx.snap b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/DocumentationTooltip-test.tsx.snap
index 522d6cfee3b..6dcf00334b3 100644
--- a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/DocumentationTooltip-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/DocumentationTooltip-test.tsx.snap
@@ -76,11 +76,13 @@ exports[`renders correctly: with links 1`] = `
<div
className="little-spacer-bottom"
>
- <a
+ <Link
className="display-inline-flex-center link-with-icon"
- href="http://link.tosome.place"
+ onlyActiveOnIndex={false}
rel="noopener noreferrer"
+ style={Object {}}
target="_blank"
+ to="http://link.tosome.place"
>
<DetachIcon
className="spacer-right"
@@ -89,21 +91,23 @@ exports[`renders correctly: with links 1`] = `
<span>
external link
</span>
- </a>
+ </Link>
</div>
<div
className="little-spacer-bottom"
>
- <a
+ <Link
className="display-inline-flex-center link-with-icon"
- href="/documentation/guide"
+ onlyActiveOnIndex={false}
rel="noopener noreferrer"
+ style={Object {}}
target="_blank"
+ to="/documentation/guide"
>
<span>
internal link
</span>
- </a>
+ </Link>
</div>
<div
className="little-spacer-bottom"