Browse Source

SONAR-11886 Fix hotspots tooltip learn_more link

tags/7.8
Grégoire Aubert 5 years ago
parent
commit
bc17352a0d

+ 8
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx View File

@@ -89,6 +89,10 @@ export class TypeFacet extends React.PureComponent<Props> {
return this.props.types.includes(type);
}

stopPropagation = (event: React.MouseEvent<HTMLAnchorElement>) => {
event.stopPropagation();
};

renderItem = (type: string) => {
const active = this.isFacetItemActive(type);
const stat = this.getStat(type);
@@ -109,7 +113,10 @@ export class TypeFacet extends React.PureComponent<Props> {
<>
<p>{translate('issues.hotspots.helper')}</p>
<hr className="spacer-top spacer-bottom" />
<Link target="_blank" to="/documentation/user-guide/security-hotspots/">
<Link
onClick={this.stopPropagation}
target="_blank"
to="/documentation/user-guide/security-hotspots/">
{translate('learn_more')}
</Link>
</>

+ 2
- 0
server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/TypeFacet-test.tsx.snap View File

@@ -44,6 +44,7 @@ exports[`should display the hotspot tooltip helper only 1`] = `
className="spacer-top spacer-bottom"
/>
<Link
onClick={[Function]}
onlyActiveOnIndex={false}
style={Object {}}
target="_blank"
@@ -78,6 +79,7 @@ exports[`should display the hotspot tooltip helper only 2`] = `
className="spacer-top spacer-bottom"
/>
<Link
onClick={[Function]}
onlyActiveOnIndex={false}
style={Object {}}
target="_blank"

Loading…
Cancel
Save