aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2021-11-02 14:28:32 +0100
committersonartech <sonartech@sonarsource.com>2021-11-05 20:03:28 +0000
commit3641fb3c3b11768ff2f3ff54b6bcfa754e3064ec (patch)
tree0540e79bffe25a0a675bab15881594fbea74ac1a /server
parent9004586f55de91d43d472db674d1906e05db2055 (diff)
downloadsonarqube-3641fb3c3b11768ff2f3ff54b6bcfa754e3064ec.tar.gz
sonarqube-3641fb3c3b11768ff2f3ff54b6bcfa754e3064ec.zip
SONAR-15508 Fix upgrade being display in the modal
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/components/upgrade/SystemUpgradeForm.tsx10
-rw-r--r--server/sonar-web/src/main/js/components/upgrade/SystemUpgradeItem.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap16
3 files changed, 18 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeForm.tsx b/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeForm.tsx
index eb6e85ca6b8..985f8d4600f 100644
--- a/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeForm.tsx
+++ b/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeForm.tsx
@@ -54,7 +54,7 @@ export class SystemUpgradeForm extends React.PureComponent<Props, State> {
render() {
const { upgrading } = this.state;
const { appState, systemUpgrades, latestLTS, updateUseCase } = this.props;
- let systemUpgradesWithPatch = systemUpgrades;
+ let systemUpgradesWithPatch: SystemUpgrade[][] = [];
const alertVariant = updateUseCase ? MAP_ALERT[updateUseCase] : undefined;
const header = translate('system.system_upgrade');
const parsedVersion = this.versionParser.exec(appState.version);
@@ -69,6 +69,14 @@ export class SystemUpgradeForm extends React.PureComponent<Props, State> {
.map(upgrades => upgrades.filter(upgrade => !upgrade.version.startsWith(majoMinorVersion)))
.filter(negate(isEmpty));
systemUpgradesWithPatch.push(patches);
+ } else {
+ let untilLTS = false;
+ for (const upgrades of systemUpgrades) {
+ if (untilLTS === false) {
+ systemUpgradesWithPatch.push(upgrades);
+ untilLTS = upgrades.some(upgrade => upgrade.version.startsWith(latestLTS));
+ }
+ }
}
return (
diff --git a/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeItem.tsx b/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeItem.tsx
index 049bfa96d86..ffbc2b718f2 100644
--- a/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeItem.tsx
+++ b/server/sonar-web/src/main/js/components/upgrade/SystemUpgradeItem.tsx
@@ -55,7 +55,7 @@ export default function SystemUpgradeItem(props: SystemUpgradeItemProps) {
<div className="system-upgrade-version it__upgrade-list-item">
<h3 className="h1 spacer-bottom">
<strong>{header}</strong>
- {!isLTSVersion && (
+ {!isPatch && (
<a
className="spacer-left medium"
href="https://www.sonarqube.org/whats-new/?referrer=sonarqube"
diff --git a/server/sonar-web/src/main/js/components/upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap b/server/sonar-web/src/main/js/components/upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap
index 697c8eb3375..849ff677a1d 100644
--- a/server/sonar-web/src/main/js/components/upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap
@@ -113,6 +113,14 @@ exports[`should display correctly 2`] = `
<strong>
system.lts_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
@@ -208,14 +216,6 @@ exports[`should display correctly 3`] = `
<strong>
system.latest_patch
</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