aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/marketplace
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/apps/marketplace
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/apps/marketplace')
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/App.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/App-test.tsx.snap8
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx9
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap6
5 files changed, 12 insertions, 15 deletions
diff --git a/server/sonar-web/src/main/js/apps/marketplace/App.tsx b/server/sonar-web/src/main/js/apps/marketplace/App.tsx
index debe1da43a7..2ce22d60b0a 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/App.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/App.tsx
@@ -21,7 +21,6 @@ import { sortBy, uniqBy } from 'lodash';
import * as React from 'react';
import { Helmet } from 'react-helmet-async';
import { FormattedMessage } from 'react-intl';
-import { Link } from 'react-router-dom';
import {
getAvailablePlugins,
getInstalledPlugins,
@@ -29,6 +28,7 @@ import {
getPluginUpdates
} from '../../api/plugins';
import { getValues, setSimpleSettingValue } from '../../api/settings';
+import Link from '../../components/common/Link';
import Suggestions from '../../components/embed-docs-modal/Suggestions';
import { Location, Router, withRouter } from '../../components/hoc/withRouter';
import { Alert } from '../../components/ui/Alert';
diff --git a/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/App-test.tsx.snap
index f839316faff..dfe9f4507b0 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/App-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/App-test.tsx.snap
@@ -43,12 +43,12 @@ exports[`should render correctly: loaded 1`] = `
id="marketplace.page.plugins.description2"
values={
Object {
- "link": <Link
+ "link": <ForwardRef(Link)
target="_blank"
to="/documentation/instance-administration/marketplace/"
>
marketplace.page.plugins.description2.link
- </Link>,
+ </ForwardRef(Link)>,
}
}
/>
@@ -141,12 +141,12 @@ exports[`should render correctly: loading 1`] = `
id="marketplace.page.plugins.description2"
values={
Object {
- "link": <Link
+ "link": <ForwardRef(Link)
target="_blank"
to="/documentation/instance-administration/marketplace/"
>
marketplace.page.plugins.description2.link
- </Link>,
+ </ForwardRef(Link)>,
}
}
/>
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx
index 56882029a15..4336f3090f4 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/LicensePromptModal.tsx
@@ -19,7 +19,7 @@
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { Link } from 'react-router-dom';
+import Link from '../../../components/common/Link';
import { ResetButtonLink } from '../../../components/controls/buttons';
import Modal from '../../../components/controls/Modal';
import { translate } from '../../../helpers/l10n';
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx
index 4ced6763e33..19f4ce99a1b 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx
@@ -19,6 +19,7 @@
*/
import * as React from 'react';
import { installPlugin, uninstallPlugin, updatePlugin } from '../../../api/plugins';
+import Link from '../../../components/common/Link';
import { Button } from '../../../components/controls/buttons';
import Checkbox from '../../../components/controls/Checkbox';
import Tooltip from '../../../components/controls/Tooltip';
@@ -81,9 +82,11 @@ export default class PluginActions extends React.PureComponent<Props, State> {
<p className="little-spacer-bottom">
{translate('marketplace.available_under_commercial_license')}
</p>
- <a href={plugin.homepageUrl} target="_blank" rel="noopener noreferrer">
- {translate('marketplace.learn_more')}
- </a>
+ {plugin.homepageUrl && (
+ <Link to={plugin.homepageUrl} target="_blank">
+ {translate('marketplace.learn_more')}
+ </Link>
+ )}
</div>
)}
{isInstalledPlugin(plugin) && (
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap
index d5a6548367e..15853674d26 100644
--- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap
@@ -54,12 +54,6 @@ exports[`should render available plugin correctly 2`] = `
>
marketplace.available_under_commercial_license
</p>
- <a
- rel="noopener noreferrer"
- target="_blank"
- >
- marketplace.learn_more
- </a>
</div>
</div>
`;