Просмотр исходного кода

SONAR-12332 System upgrades should refer to SonarQube Announcements

tags/8.9.0.43852
Wouter Admiraal 3 лет назад
Родитель
Сommit
67741eeb89

+ 1
- 3
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>

+ 16
- 5
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

+ 5
- 5
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}
/>
);

+ 2
- 2
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

+ 143
- 8
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

+ 1
- 0
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

Загрузка…
Отмена
Сохранить