aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2021-03-30 10:12:11 +0200
committersonartech <sonartech@sonarsource.com>2021-04-01 20:03:45 +0000
commit67741eeb890aa91a07dbccb05a4e37d43cf71a50 (patch)
tree468f215305daf74dbce978bbf19af4cdf388556f
parentb97502919665bb2820e8d2fb51400ff417d4a83c (diff)
downloadsonarqube-67741eeb890aa91a07dbccb05a4e37d43cf71a50.tar.gz
sonarqube-67741eeb890aa91a07dbccb05a4e37d43cf71a50.zip
SONAR-12332 System upgrades should refer to SonarQube Announcements
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx21
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeItem-test.tsx10
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap4
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap151
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties1
6 files changed, 168 insertions, 23 deletions
diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx
index 7f68ae884b8..832ab678dec 100644
--- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx
+++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx
@@ -56,9 +56,7 @@ export class SystemUpgradeForm extends React.PureComponent<Props, State> {
}
key={upgrades[upgrades.length - 1].version}
systemUpgrades={upgrades}
- type={
- idx === 0 ? translate('system.latest_version') : translate('system.lts_version')
- }
+ isLatestVersion={idx === 0}
/>
))}
</div>
diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx
index d2e48694e18..b8d55e570fc 100644
--- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx
+++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx
@@ -30,14 +30,14 @@ import { EditionKey } from '../../../../types/editions';
import { SystemUpgrade } from '../../../../types/system';
import SystemUpgradeIntermediate from './SystemUpgradeIntermediate';
-interface Props {
+export interface SystemUpgradeItemProps {
edition: EditionKey | undefined;
- type: string;
+ isLatestVersion: boolean;
systemUpgrades: SystemUpgrade[];
}
-export default function SystemUpgradeItem(props: Props) {
- const { edition, type, systemUpgrades } = props;
+export default function SystemUpgradeItem(props: SystemUpgradeItemProps) {
+ const { edition, isLatestVersion, systemUpgrades } = props;
const lastUpgrade = systemUpgrades[0];
const downloadUrl = getEditionDownloadUrl(
getEdition(edition || EditionKey.community),
@@ -47,7 +47,18 @@ export default function SystemUpgradeItem(props: Props) {
return (
<div className="system-upgrade-version">
<h3 className="h1 spacer-bottom">
- <strong>{type}</strong>
+ <strong>
+ {isLatestVersion ? translate('system.latest_version') : translate('system.lts_version')}
+ </strong>
+ {isLatestVersion && (
+ <a
+ className="spacer-left medium"
+ href="https://www.sonarqube.org/whats-new/?referrer=sonarqube"
+ rel="noopener noreferrer"
+ target="_blank">
+ {translate('system.see_whats_new')}
+ </a>
+ )}
</h3>
<p>
<FormattedMessage
diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeItem-test.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeItem-test.tsx
index 5244eca4425..6b775f034df 100644
--- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeItem-test.tsx
+++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeItem-test.tsx
@@ -20,17 +20,17 @@
import { shallow } from 'enzyme';
import * as React from 'react';
import { EditionKey } from '../../../../../types/editions';
-import SystemUpgradeItem from '../SystemUpgradeItem';
+import SystemUpgradeItem, { SystemUpgradeItemProps } from '../SystemUpgradeItem';
it('should display correctly', () => {
expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ isLatestVersion: false })).toMatchSnapshot();
expect(shallowRender({ edition: EditionKey.developer })).toMatchSnapshot();
expect(shallowRender({ edition: EditionKey.enterprise })).toMatchSnapshot();
expect(shallowRender({ edition: EditionKey.datacenter })).toMatchSnapshot();
// Fallback to Community.
expect(
shallowRender({
- edition: EditionKey.datacenter,
systemUpgrades: [
{
version: '5.6.7',
@@ -44,8 +44,8 @@ it('should display correctly', () => {
).toMatchSnapshot();
});
-function shallowRender(props = {}) {
- return shallow(
+function shallowRender(props: Partial<SystemUpgradeItemProps> = {}) {
+ return shallow<SystemUpgradeItemProps>(
<SystemUpgradeItem
edition={EditionKey.community}
systemUpgrades={[
@@ -76,7 +76,7 @@ function shallowRender(props = {}) {
downloadDeveloperUrl: 'http://download.url/developer'
}
]}
- type="Latest Version"
+ isLatestVersion={true}
{...props}
/>
);
diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap
index 7e777c5a4de..e1c80419910 100644
--- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap
@@ -17,6 +17,7 @@ exports[`should display correctly 1`] = `
>
<SystemUpgradeItem
edition="community"
+ isLatestVersion={true}
key="6.3"
systemUpgrades={
Array [
@@ -38,10 +39,10 @@ exports[`should display correctly 1`] = `
},
]
}
- type="system.latest_version"
/>
<SystemUpgradeItem
edition="community"
+ isLatestVersion={false}
key="5.6.5"
systemUpgrades={
Array [
@@ -71,7 +72,6 @@ exports[`should display correctly 1`] = `
},
]
}
- type="system.lts_version"
/>
</div>
<div
diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap
index 4ffa1cd2858..51d35d94dc6 100644
--- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap
@@ -8,8 +8,16 @@ exports[`should display correctly 1`] = `
className="h1 spacer-bottom"
>
<strong>
- Latest Version
+ system.latest_version
</strong>
+ <a
+ className="spacer-left medium"
+ href="https://www.sonarqube.org/whats-new/?referrer=sonarqube"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ system.see_whats_new
+ </a>
</h3>
<p>
<FormattedMessage
@@ -103,8 +111,111 @@ exports[`should display correctly 2`] = `
className="h1 spacer-bottom"
>
<strong>
- Latest Version
+ system.lts_version
+ </strong>
+ </h3>
+ <p>
+ <FormattedMessage
+ defaultMessage="system.version_is_availble"
+ id="system.version_is_availble"
+ values={
+ Object {
+ "version": <b>
+ SonarQube
+ 5.6.7
+ </b>,
+ }
+ }
+ />
+ </p>
+ <p
+ className="spacer-top"
+ >
+ Version 5.6.7 description
+ </p>
+ <div
+ className="big-spacer-top"
+ >
+ <DateFormatter
+ date="2017-03-01"
+ long={true}
+ >
+ <Component />
+ </DateFormatter>
+ <a
+ className="spacer-left"
+ href="http://changelog.url/"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ system.release_notes
+ </a>
+ </div>
+ <SystemUpgradeIntermediate
+ className="spacer-top"
+ upgrades={
+ Array [
+ Object {
+ "changeLogUrl": "http://changelog.url/",
+ "description": "Version 5.6.6 description",
+ "downloadDeveloperUrl": "http://download.url/developer",
+ "downloadUrl": "http://download.url/community",
+ "releaseDate": "2017-04-02",
+ "version": "5.6.6",
+ },
+ Object {
+ "changeLogUrl": "http://changelog.url/",
+ "description": "Version 5.6.5 description",
+ "downloadDeveloperUrl": "http://download.url/developer",
+ "downloadUrl": "http://download.url/community",
+ "releaseDate": "2017-03-01",
+ "version": "5.6.5",
+ },
+ ]
+ }
+ />
+ <div
+ className="big-spacer-top"
+ >
+ <a
+ className="button"
+ download="http://download.url/community"
+ href="http://download.url/community"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ system.download_x.5.6.7
+ </a>
+ <a
+ className="spacer-left"
+ href="https://redirect.sonarsource.com/doc/upgrading.html"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ system.how_to_upgrade
+ </a>
+ </div>
+</div>
+`;
+
+exports[`should display correctly 3`] = `
+<div
+ className="system-upgrade-version"
+>
+ <h3
+ className="h1 spacer-bottom"
+ >
+ <strong>
+ system.latest_version
</strong>
+ <a
+ className="spacer-left medium"
+ href="https://www.sonarqube.org/whats-new/?referrer=sonarqube"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ system.see_whats_new
+ </a>
</h3>
<p>
<FormattedMessage
@@ -190,7 +301,7 @@ exports[`should display correctly 2`] = `
</div>
`;
-exports[`should display correctly 3`] = `
+exports[`should display correctly 4`] = `
<div
className="system-upgrade-version"
>
@@ -198,8 +309,16 @@ exports[`should display correctly 3`] = `
className="h1 spacer-bottom"
>
<strong>
- Latest Version
+ system.latest_version
</strong>
+ <a
+ className="spacer-left medium"
+ href="https://www.sonarqube.org/whats-new/?referrer=sonarqube"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ system.see_whats_new
+ </a>
</h3>
<p>
<FormattedMessage
@@ -285,7 +404,7 @@ exports[`should display correctly 3`] = `
</div>
`;
-exports[`should display correctly 4`] = `
+exports[`should display correctly 5`] = `
<div
className="system-upgrade-version"
>
@@ -293,8 +412,16 @@ exports[`should display correctly 4`] = `
className="h1 spacer-bottom"
>
<strong>
- Latest Version
+ system.latest_version
</strong>
+ <a
+ className="spacer-left medium"
+ href="https://www.sonarqube.org/whats-new/?referrer=sonarqube"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ system.see_whats_new
+ </a>
</h3>
<p>
<FormattedMessage
@@ -380,7 +507,7 @@ exports[`should display correctly 4`] = `
</div>
`;
-exports[`should display correctly 5`] = `
+exports[`should display correctly 6`] = `
<div
className="system-upgrade-version"
>
@@ -388,8 +515,16 @@ exports[`should display correctly 5`] = `
className="h1 spacer-bottom"
>
<strong>
- Latest Version
+ system.latest_version
</strong>
+ <a
+ className="spacer-left medium"
+ href="https://www.sonarqube.org/whats-new/?referrer=sonarqube"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ system.see_whats_new
+ </a>
</h3>
<p>
<FormattedMessage
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index 2db3d247d11..26ae1fdc0af 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -2860,6 +2860,7 @@ system.log_level.warning.short=Current logs level has performance impacts, get b
system.log_level.info=Your selection does not affect the Search Engine.
system.logs_level=Logs level
system.new_version_available=A new version of SonarQube is available.
+system.see_whats_new=See what's new!
system.release_notes=Release Notes
system.released_x=Released {0}
system.restart_in_progress=Restart in progress