aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorViktor Vorona <viktor.vorona@sonarsource.com>2024-04-10 11:20:43 +0200
committersonartech <sonartech@sonarsource.com>2024-04-10 20:02:56 +0000
commitd66f159e6010a65b488a8964554c2819046d6b33 (patch)
treecbde8a235dfbfc53b202c12c4af637ddbb66bfcc /server
parent2585a7b8d18564d1e08b63c2aa0a3913efd6e655 (diff)
downloadsonarqube-d66f159e6010a65b488a8964554c2819046d6b33.tar.gz
sonarqube-d66f159e6010a65b488a8964554c2819046d6b33.zip
SONAR-22017 Show link to SonarQube downloads for no longer active version
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx3
-rw-r--r--server/sonar-web/src/main/js/components/upgrade/SystemUpgradeButton.tsx11
-rw-r--r--server/sonar-web/src/main/js/helpers/testMocks.ts3
3 files changed, 14 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx b/server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx
index 91e350399c9..9673352c29d 100644
--- a/server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx
+++ b/server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx
@@ -39,6 +39,7 @@ jest.mock('../../../api/system', () => ({
const ui = {
updateMessage: byRole('alert'),
openDialogBtn: byRole('button', { name: 'learn_more' }),
+ learnMoreLink: byRole('link', { name: /learn_more/ }),
dialog: byRole('dialog', { name: 'system.system_upgrade' }),
latestHeader: byRole('heading', { name: /system.latest_version/ }),
latestLTAHeader: byRole('heading', { name: /system.lta_version/ }),
@@ -83,6 +84,7 @@ it('should show error message if upgrades call failed and the version has reache
`admin_notification.update.${UpdateUseCase.CurrentVersionInactive}`,
);
expect(ui.openDialogBtn.query()).not.toBeInTheDocument();
+ expect(ui.learnMoreLink.get()).toBeInTheDocument();
});
it('should not show the notification banner if there is no network connection and version has not reached the eol', () => {
@@ -106,6 +108,7 @@ it('should show the error banner if there is no network connection and version h
`admin_notification.update.${UpdateUseCase.CurrentVersionInactive}`,
);
expect(ui.openDialogBtn.query()).not.toBeInTheDocument();
+ expect(ui.learnMoreLink.get()).toBeInTheDocument();
});
it('active / latest / patch', async () => {
diff --git a/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeButton.tsx b/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeButton.tsx
index 7744d356114..9e318506cd2 100644
--- a/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeButton.tsx
+++ b/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeButton.tsx
@@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { Link } from '@sonarsource/echoes-react';
import { ButtonSecondary } from 'design-system';
import * as React from 'react';
import { translate } from '../../helpers/l10n';
@@ -44,7 +45,15 @@ export default function SystemUpgradeButton(props: Readonly<Props>) {
}, [setSystemUpgradeFormOpen]);
if (systemUpgrades.length === 0) {
- return null;
+ return (
+ <Link
+ className="sw-ml-2"
+ to="https://www.sonarsource.com/products/sonarqube/downloads/?referrer=sonarqube"
+ target="_blank"
+ >
+ {translate('learn_more')}
+ </Link>
+ );
}
return (
diff --git a/server/sonar-web/src/main/js/helpers/testMocks.ts b/server/sonar-web/src/main/js/helpers/testMocks.ts
index 7cb81dfb4b7..313cb7f03bd 100644
--- a/server/sonar-web/src/main/js/helpers/testMocks.ts
+++ b/server/sonar-web/src/main/js/helpers/testMocks.ts
@@ -17,7 +17,6 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { addMonths, formatISO } from 'date-fns';
import { omit } from 'lodash';
import { To } from 'react-router-dom';
import { CompareResponse } from '../api/quality-profiles';
@@ -95,7 +94,7 @@ export function mockAppState(overrides: Partial<AppState> = {}): AppState {
qualifiers: [ComponentQualifier.Project],
settings: {},
version: '1.0',
- versionEOL: formatISO(addMonths(new Date(), 1), { representation: 'date' }),
+ versionEOL: '2020-01-01',
documentationUrl: 'https://docs.sonarsource.com/sonarqube/10.0',
...overrides,
};