aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-04-30 17:49:47 +0200
committerSonarTech <sonartech@sonarsource.com>2018-05-03 20:20:51 +0200
commitb367622f75eb6a5bc4ab1d485e771f70148d5f58 (patch)
tree22bae64230c540d11728c40722a4e7a1efc2cfdb /server/sonar-web/src
parent093c4b17921519b435fe868672774dd3aa0d544c (diff)
downloadsonarqube-b367622f75eb6a5bc4ab1d485e771f70148d5f58.tar.gz
sonarqube-b367622f75eb6a5bc4ab1d485e771f70148d5f58.zip
SONAR-10609 open documentation links in the same tab
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx8
-rw-r--r--server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap24
2 files changed, 5 insertions, 27 deletions
diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx
index 1c2ba28fa9d..ac864c7dea1 100644
--- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx
+++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx
@@ -21,9 +21,7 @@ import * as React from 'react';
import * as PropTypes from 'prop-types';
import { Link } from 'react-router';
import { SuggestionLink } from './SuggestionsProvider';
-import * as theme from '../../../app/theme';
import BubblePopup, { BubblePopupPosition } from '../../../components/common/BubblePopup';
-import DetachIcon from '../../../components/icons-components/DetachIcon';
import { translate } from '../../../helpers/l10n';
import { getBaseUrl } from '../../../helpers/urls';
@@ -58,9 +56,8 @@ export default class EmbedDocsPopup extends React.PureComponent<Props> {
{this.renderTitle(translate('embed_docs.suggestion'))}
{this.props.suggestions.map((suggestion, index) => (
<li key={index}>
- <Link className="display-flex-center" target="_blank" to={suggestion.link}>
+ <Link onClick={this.props.onClose} to={suggestion.link}>
{suggestion.text}
- <DetachIcon className="spacer-left" fill={theme.gray80} size={12} />
</Link>
</li>
))}
@@ -150,9 +147,8 @@ export default class EmbedDocsPopup extends React.PureComponent<Props> {
<ul className="menu">
{this.renderSuggestions()}
<li>
- <Link className="display-flex-center" target="_blank" to="/documentation">
+ <Link onClick={this.props.onClose} to="/documentation">
{translate('embed_docs.documentation_index')}
- <DetachIcon className="spacer-left" fill={theme.gray80} size={12} />
</Link>
</li>
<li>
diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap b/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap
index ba950f69c47..8867991dcc5 100644
--- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap
+++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap
@@ -17,36 +17,24 @@ exports[`should display suggestion links 1`] = `
key="0"
>
<Link
- className="display-flex-center"
+ onClick={[MockFunction]}
onlyActiveOnIndex={false}
style={Object {}}
- target="_blank"
to="#"
>
foo
- <DetachIcon
- className="spacer-left"
- fill="#cdcdcd"
- size={12}
- />
</Link>
</li>
<li
key="1"
>
<Link
- className="display-flex-center"
+ onClick={[MockFunction]}
onlyActiveOnIndex={false}
style={Object {}}
- target="_blank"
to="#"
>
bar
- <DetachIcon
- className="spacer-left"
- fill="#cdcdcd"
- size={12}
- />
</Link>
</li>
<li
@@ -55,18 +43,12 @@ exports[`should display suggestion links 1`] = `
</React.Fragment>
<li>
<Link
- className="display-flex-center"
+ onClick={[MockFunction]}
onlyActiveOnIndex={false}
style={Object {}}
- target="_blank"
to="/documentation"
>
embed_docs.documentation_index
- <DetachIcon
- className="spacer-left"
- fill="#cdcdcd"
- size={12}
- />
</Link>
</li>
<li>