]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10609 open documentation links in the same tab
authorStas Vilchik <stas.vilchik@sonarsource.com>
Mon, 30 Apr 2018 15:49:47 +0000 (17:49 +0200)
committerSonarTech <sonartech@sonarsource.com>
Thu, 3 May 2018 18:20:51 +0000 (20:20 +0200)
server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx
server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap

index 1c2ba28fa9d4fc25d8f20fe3cef7f52962f4abb8..ac864c7dea10d3f7ca0d4816f85a1ff0b527c013 100644 (file)
@@ -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>
index ba950f69c47619891fc0d08eee8e9d9e292f5835..8867991dcc56dfc517eac3cd8d0589fad53e1c30 100644 (file)
@@ -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>