]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22018 Show only inactive version case in footer and system pages
authorstanislavh <stanislav.honcharov@sonarsource.com>
Thu, 11 Apr 2024 09:39:16 +0000 (11:39 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 11 Apr 2024 20:02:41 +0000 (20:02 +0000)
server/sonar-web/src/main/js/components/shared/AppVersionStatus.tsx
server/sonar-web/src/main/js/components/shared/__tests__/AppVersionStatus-test.tsx

index 91e961695e755a7a4d309827cd64d5fe3e036694..1e7aa54d614f4298546a36f3c19ba629aebf5539 100644 (file)
@@ -34,12 +34,12 @@ export default function AppVersionStatus() {
       defaultMessage={translate('footer.version')}
       values={{
         version,
-        status: (
+        status: !isActive && (
           <DocLink
             to="/setup-and-upgrade/upgrade-the-server/active-versions/"
             className="little-spacer-left"
           >
-            {translate(`footer.version.status.${isActive ? 'active' : 'inactive'}`)}
+            {translate('footer.version.status.inactive')}
           </DocLink>
         ),
       }}
index f60dba440bb6b6ab3d7c3d5979678059df8bb8ab..1ad54a43723b9bc18dd99658877fccd6edd53d44 100644 (file)
@@ -29,10 +29,12 @@ jest.mock('../../../helpers/dates', () => ({
   now: () => new Date('2022-01-01'),
 }));
 
-it('should render active version if it has not reached EOL', () => {
+it('should not render inactive version if it has not reached EOL', () => {
   renderAppVersionStatus(mockAppState({ versionEOL: '2022-01-02' }));
 
-  expect(screen.getByRole('link', { name: /footer.version.status.active/ })).toBeInTheDocument();
+  expect(
+    screen.queryByRole('link', { name: /footer.version.status.inactive/ })
+  ).not.toBeInTheDocument();
 });
 
 it('should render inactive version if it has reached EOL', () => {