]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22018 Add link to latest sonarqube versions if no upgrades available
authorViktor Vorona <viktor.vorona@sonarsource.com>
Wed, 10 Apr 2024 08:45:54 +0000 (10:45 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 10 Apr 2024 20:02:53 +0000 (20:02 +0000)
server/sonar-web/src/main/js/components/upgrade/SystemUpgradeButton.tsx
server/sonar-web/src/main/js/components/upgrade/__tests__/__snapshots__/SystemUpgradeButton-test.tsx.snap

index cbd8ba2f1a5b5510d05b8a8047f29c05d095db52..2882202470bb954e60971af55017a9cbc0066ef1 100644 (file)
@@ -20,6 +20,7 @@
 import * as React from 'react';
 import { translate } from '../../helpers/l10n';
 import { SystemUpgrade } from '../../types/system';
+import Link from '../common/Link';
 import { Button } from '../controls/buttons';
 import SystemUpgradeForm from './SystemUpgradeForm';
 import { groupUpgrades, sortUpgrades, UpdateUseCase } from './utils';
@@ -50,7 +51,15 @@ export default class SystemUpgradeButton extends React.PureComponent<Props, Stat
     const { openSystemUpgradeForm } = this.state;
 
     if (systemUpgrades.length === 0) {
-      return null;
+      return (
+        <Link
+          className="spacer-left"
+          to="https://www.sonarqube.org/downloads/?referrer=sonarqube"
+          target="_blank"
+        >
+          {translate('learn_more')}
+        </Link>
+      );
     }
 
     return (
index 1b581220ca7e50156f5d802731a4ddadba129e4e..44dc7e7196583d00808515aea1f8a778f327d2c0 100644 (file)
@@ -1,6 +1,14 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`should not show button if there are no upgrades 1`] = `""`;
+exports[`should not show button if there are no upgrades 1`] = `
+<ForwardRef(Link)
+  className="spacer-left"
+  target="_blank"
+  to="https://www.sonarqube.org/downloads/?referrer=sonarqube"
+>
+  learn_more
+</ForwardRef(Link)>
+`;
 
 exports[`should open modal correctly 1`] = `
 <Fragment>