]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12332 System upgrades should refer to SonarQube Announcements
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Tue, 30 Mar 2021 08:12:11 +0000 (10:12 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 1 Apr 2021 20:03:45 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx
server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeItem.tsx
server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/SystemUpgradeItem-test.tsx
server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeForm-test.tsx.snap
server/sonar-web/src/main/js/apps/system/components/system-upgrade/__tests__/__snapshots__/SystemUpgradeItem-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 7f68ae884b8d1cb87a9b49b96795aeb0ebd6a759..832ab678decf63de46676e27aab4a52ca69d3a59 100644 (file)
@@ -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>
index d2e48694e186d8a5ab042d17b83f2498c36fee91..b8d55e570fc4539a99fb3146d955c0845c4f9e11 100644 (file)
@@ -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
index 5244eca4425310a7e2591ce35d711c0dcbe36ca3..6b775f034dfca18104dfb033daf5529afd936574 100644 (file)
 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}
     />
   );
index 7e777c5a4de22b4be59af3b4e5af384f9f051d2d..e1c80419910199d483976d7c2102fbcf128bea7d 100644 (file)
@@ -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
index 4ffa1cd28580f754276b3fb9c03969cf8b17c62d..51d35d94dc601a1897b2cda3babb3e064a3d60fa 100644 (file)
@@ -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
index 2db3d247d11dcf9436e6b5315e36f4fbe3482e48..26ae1fdc0af57e0e098dced1f2731c91c65a3317 100644 (file)
@@ -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