aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanislavh <stanislav.honcharov@sonarsource.com>2024-04-11 11:39:16 +0200
committersonartech <sonartech@sonarsource.com>2024-04-11 20:02:41 +0000
commit43938ef8de1aed6a7762078f1b0faf576fca4810 (patch)
tree37500bfe1267f011a227bd22c4d4f0402216e2f1
parent14027e02b00e475b052776fd94f08b2a45970741 (diff)
downloadsonarqube-43938ef8de1aed6a7762078f1b0faf576fca4810.tar.gz
sonarqube-43938ef8de1aed6a7762078f1b0faf576fca4810.zip
SONAR-22018 Show only inactive version case in footer and system pages
-rw-r--r--server/sonar-web/src/main/js/components/shared/AppVersionStatus.tsx4
-rw-r--r--server/sonar-web/src/main/js/components/shared/__tests__/AppVersionStatus-test.tsx6
2 files changed, 6 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/components/shared/AppVersionStatus.tsx b/server/sonar-web/src/main/js/components/shared/AppVersionStatus.tsx
index 91e961695e7..1e7aa54d614 100644
--- a/server/sonar-web/src/main/js/components/shared/AppVersionStatus.tsx
+++ b/server/sonar-web/src/main/js/components/shared/AppVersionStatus.tsx
@@ -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>
),
}}
diff --git a/server/sonar-web/src/main/js/components/shared/__tests__/AppVersionStatus-test.tsx b/server/sonar-web/src/main/js/components/shared/__tests__/AppVersionStatus-test.tsx
index f60dba440bb..1ad54a43723 100644
--- a/server/sonar-web/src/main/js/components/shared/__tests__/AppVersionStatus-test.tsx
+++ b/server/sonar-web/src/main/js/components/shared/__tests__/AppVersionStatus-test.tsx
@@ -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', () => {