aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-ui-common/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-ui-common/helpers')
-rw-r--r--server/sonar-ui-common/helpers/__tests__/colors-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/__tests__/dates-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/__tests__/handleRequiredAuthentication-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/__tests__/init-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/__tests__/l10n-test.ts91
-rw-r--r--server/sonar-ui-common/helpers/__tests__/measures-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/__tests__/pages-test.ts51
-rw-r--r--server/sonar-ui-common/helpers/__tests__/path-test.ts54
-rw-r--r--server/sonar-ui-common/helpers/__tests__/query-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/__tests__/ratings-test.ts114
-rw-r--r--server/sonar-ui-common/helpers/__tests__/request-test.ts5
-rw-r--r--server/sonar-ui-common/helpers/__tests__/scrolling-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/__tests__/strings-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/__tests__/urls-test.ts4
-rw-r--r--server/sonar-ui-common/helpers/colors.ts4
-rw-r--r--server/sonar-ui-common/helpers/cookies.ts4
-rw-r--r--server/sonar-ui-common/helpers/csv.ts4
-rw-r--r--server/sonar-ui-common/helpers/dates.ts4
-rw-r--r--server/sonar-ui-common/helpers/getHistory.ts4
-rw-r--r--server/sonar-ui-common/helpers/handleRequiredAuthentication.ts4
-rw-r--r--server/sonar-ui-common/helpers/init.ts4
-rw-r--r--server/sonar-ui-common/helpers/keycodes.ts4
-rw-r--r--server/sonar-ui-common/helpers/l10n.ts4
-rw-r--r--server/sonar-ui-common/helpers/measures.ts4
-rw-r--r--server/sonar-ui-common/helpers/pages.ts4
-rw-r--r--server/sonar-ui-common/helpers/path.ts4
-rw-r--r--server/sonar-ui-common/helpers/query.ts4
-rw-r--r--server/sonar-ui-common/helpers/ratings.ts4
-rw-r--r--server/sonar-ui-common/helpers/request.ts4
-rw-r--r--server/sonar-ui-common/helpers/scrolling.ts5
-rw-r--r--server/sonar-ui-common/helpers/search.tsx4
-rw-r--r--server/sonar-ui-common/helpers/storage.ts4
-rw-r--r--server/sonar-ui-common/helpers/strings.ts4
-rw-r--r--server/sonar-ui-common/helpers/testUtils.ts5
-rw-r--r--server/sonar-ui-common/helpers/types.ts4
-rw-r--r--server/sonar-ui-common/helpers/urls.ts22
36 files changed, 386 insertions, 73 deletions
diff --git a/server/sonar-ui-common/helpers/__tests__/colors-test.ts b/server/sonar-ui-common/helpers/__tests__/colors-test.ts
index ccc58d305b6..ae80a29e093 100644
--- a/server/sonar-ui-common/helpers/__tests__/colors-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/colors-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/__tests__/dates-test.ts b/server/sonar-ui-common/helpers/__tests__/dates-test.ts
index 688fca9904c..9482f6d6476 100644
--- a/server/sonar-ui-common/helpers/__tests__/dates-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/dates-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/__tests__/handleRequiredAuthentication-test.ts b/server/sonar-ui-common/helpers/__tests__/handleRequiredAuthentication-test.ts
index fa90439d195..abb391a2e21 100644
--- a/server/sonar-ui-common/helpers/__tests__/handleRequiredAuthentication-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/handleRequiredAuthentication-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/__tests__/init-test.ts b/server/sonar-ui-common/helpers/__tests__/init-test.ts
index 44d2dbe984a..8f7e927a867 100644
--- a/server/sonar-ui-common/helpers/__tests__/init-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/init-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/__tests__/l10n-test.ts b/server/sonar-ui-common/helpers/__tests__/l10n-test.ts
index 3252baf524e..523ac99b30b 100644
--- a/server/sonar-ui-common/helpers/__tests__/l10n-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/l10n-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
@@ -19,7 +19,17 @@
*/
/* eslint-disable camelcase */
import Initializer, { getMessages } from '../init';
-import { hasMessage, translate, translateWithParameters } from '../l10n';
+import {
+ getLocalizedCategoryMetricName,
+ getLocalizedMetricDomain,
+ getLocalizedMetricName,
+ getShortMonthName,
+ getShortWeekDayName,
+ getWeekDayName,
+ hasMessage,
+ translate,
+ translateWithParameters,
+} from '../l10n';
const originalMessages = getMessages();
const MSG = 'my_message';
@@ -96,3 +106,78 @@ describe('hasMessage', () => {
expect(hasMessage('foo', 'bar')).toBe(false);
});
});
+
+describe('getLocalizedMetricName', () => {
+ const metric = { key: 'new_code', name: 'new_code_metric_name' };
+
+ it('should return the metric name translation', () => {
+ Initializer.setMessages({ 'metric.new_code.name': 'metric.new_code.name_t' });
+ expect(getLocalizedMetricName(metric)).toBe('metric.new_code.name_t');
+ });
+
+ it('should return the metric short name', () => {
+ Initializer.setMessages({ 'metric.new_code.short_name': 'metric.new_code.short_name_t' });
+ expect(getLocalizedMetricName(metric, true)).toBe('metric.new_code.short_name_t');
+ });
+
+ it('should fallback on name if short name is absent', () => {
+ Initializer.setMessages({ 'metric.new_code.name': 'metric.new_code.name_t' });
+ expect(getLocalizedMetricName(metric, true)).toBe('metric.new_code.name_t');
+ });
+
+ it('should fallback on metric name if translation is absent', () => {
+ expect(getLocalizedMetricName(metric)).toBe('new_code_metric_name');
+ });
+
+ it('should fallback on metric key if nothing else is available', () => {
+ expect(getLocalizedMetricName({ key: 'new_code' })).toBe('new_code');
+ });
+});
+
+describe('getLocalizedCategoryMetricName', () => {
+ it('should return metric category name translation', () => {
+ Initializer.setMessages({
+ 'metric.new_code.extra_short_name': 'metric.new_code.extra_short_name_t',
+ });
+ expect(getLocalizedCategoryMetricName({ key: 'new_code' })).toBe(
+ 'metric.new_code.extra_short_name_t'
+ );
+ });
+
+ it('should fallback on metric name if extra_short_name is absent', () => {
+ Initializer.setMessages({ 'metric.new_code.name': 'metric.new_code.name_t' });
+ expect(getLocalizedCategoryMetricName({ key: 'new_code' })).toBe('metric.new_code.name_t');
+ });
+});
+
+describe('getLocalizedMetricDomain', () => {
+ it('should return metric domain name translation', () => {
+ Initializer.setMessages({ 'metric_domain.domain': 'metric_domain.domain_t' });
+ expect(getLocalizedMetricDomain('domain')).toBe('metric_domain.domain_t');
+ });
+
+ it('should fallback on metric domain name', () => {
+ expect(getLocalizedMetricDomain('domain')).toBe('domain');
+ });
+});
+
+describe('getShortMonthName', () => {
+ it('should properly translation months', () => {
+ Initializer.setMessages({ Jan: 'Jan_t' });
+ expect(getShortMonthName(0)).toBe('Jan_t');
+ });
+});
+
+describe('getWeekDayName', () => {
+ it('should properly translation weekday', () => {
+ Initializer.setMessages({ Sunday: 'Sunday_t' });
+ expect(getWeekDayName(0)).toBe('Sunday_t');
+ });
+});
+
+describe('getShortWeekDayName', () => {
+ it('should properly translation short weekday', () => {
+ Initializer.setMessages({ Sun: 'Sun_t' });
+ expect(getShortWeekDayName(0)).toBe('Sun_t');
+ });
+});
diff --git a/server/sonar-ui-common/helpers/__tests__/measures-test.ts b/server/sonar-ui-common/helpers/__tests__/measures-test.ts
index 346f0dda3be..f9cb4ab04ce 100644
--- a/server/sonar-ui-common/helpers/__tests__/measures-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/measures-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/__tests__/pages-test.ts b/server/sonar-ui-common/helpers/__tests__/pages-test.ts
new file mode 100644
index 00000000000..9f4ba96c172
--- /dev/null
+++ b/server/sonar-ui-common/helpers/__tests__/pages-test.ts
@@ -0,0 +1,51 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import {
+ addNoFooterPageClass,
+ addSideBarClass,
+ addWhitePageClass,
+ removeNoFooterPageClass,
+ removeSideBarClass,
+ removeWhitePageClass,
+} from '../pages';
+
+describe('class adders', () => {
+ it.each([
+ [addSideBarClass, 'sidebar-page'],
+ [addNoFooterPageClass, 'no-footer-page'],
+ [addWhitePageClass, 'white-page'],
+ ])('%s should add the class', (fct, cls) => {
+ const toggle = jest.spyOn(document.body.classList, 'toggle');
+ fct();
+ expect(toggle).toBeCalledWith(cls, true);
+ });
+});
+
+describe('class removers', () => {
+ it.each([
+ [removeSideBarClass, 'sidebar-page'],
+ [removeNoFooterPageClass, 'no-footer-page'],
+ [removeWhitePageClass, 'white-page'],
+ ])('%s should add the class', (fct, cls) => {
+ const toggle = jest.spyOn(document.body.classList, 'toggle');
+ fct();
+ expect(toggle).toBeCalledWith(cls, false);
+ });
+});
diff --git a/server/sonar-ui-common/helpers/__tests__/path-test.ts b/server/sonar-ui-common/helpers/__tests__/path-test.ts
index 997d23e055f..12f32ab7d0c 100644
--- a/server/sonar-ui-common/helpers/__tests__/path-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/path-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
@@ -17,7 +17,14 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { collapsedDirFromPath, cutLongWords, fileFromPath } from '../path';
+import {
+ collapsedDirFromPath,
+ collapsePath,
+ cutLongWords,
+ fileFromPath,
+ limitComponentName,
+ splitPath,
+} from '../path';
describe('#collapsedDirFromPath()', () => {
it('should return null when pass null', () => {
@@ -78,3 +85,44 @@ describe('#cutLongWords', () => {
expect(cutLongWords('This is a test')).toBe('This is a test');
});
});
+
+describe('collapsePath', () => {
+ it('should fail fast if path is not a string', () => {
+ expect(collapsePath({} as string)).toBe('');
+ });
+
+ it('should not collapse short path', () => {
+ const path = 'my/path';
+ expect(collapsePath(path)).toBe(path);
+ });
+
+ it('should collapse path longer than the limit', () => {
+ const path = 'my/long/path/very/long/path';
+ expect(collapsePath(path, 10)).toBe('my/.../very/long/path');
+ expect(collapsePath(path, 5)).toBe('my/.../long/path');
+ expect(collapsePath(path, 2)).toBe('my/.../path');
+ });
+});
+
+describe('splitPath', () => {
+ it('should split path properly', () => {
+ expect(splitPath('my/super/path')).toEqual({ head: 'my/super', tail: 'path' });
+ expect(splitPath('my/super/very/long/path')).toEqual({
+ head: 'my/super/very/long',
+ tail: 'path',
+ });
+ });
+});
+
+describe('limitComponentName', () => {
+ const name = 'my/super/name';
+
+ it('should fail fast if component name is not a string', () => {
+ expect(limitComponentName({} as string)).toBe('');
+ });
+
+ it('should limiit component name longer than the limit', () => {
+ expect(limitComponentName(name)).toBe(name);
+ expect(limitComponentName(name, 10)).toBe('my/super/n...');
+ });
+});
diff --git a/server/sonar-ui-common/helpers/__tests__/query-test.ts b/server/sonar-ui-common/helpers/__tests__/query-test.ts
index 1adea91e969..4a6a671005c 100644
--- a/server/sonar-ui-common/helpers/__tests__/query-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/query-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/__tests__/ratings-test.ts b/server/sonar-ui-common/helpers/__tests__/ratings-test.ts
new file mode 100644
index 00000000000..619ef1cdbd7
--- /dev/null
+++ b/server/sonar-ui-common/helpers/__tests__/ratings-test.ts
@@ -0,0 +1,114 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import {
+ getCoverageRatingAverageValue,
+ getCoverageRatingLabel,
+ getDuplicationsRatingAverageValue,
+ getDuplicationsRatingLabel,
+ getSizeRatingAverageValue,
+ getSizeRatingLabel,
+} from '../ratings';
+
+describe('getCoverageRatingLabel', () => {
+ it('should fail', () => {
+ expect(() => {
+ getCoverageRatingLabel(-1);
+ }).toThrow();
+ });
+ it.each([
+ [1, '≥ 80%'],
+ [2, '70% - 80%'],
+ [3, '50% - 70%'],
+ [4, '30% - 50%'],
+ [5, '< 30%'],
+ ])('should return the correct label for %s', (rating, label) => {
+ expect(getCoverageRatingLabel(rating)).toBe(label);
+ });
+});
+
+describe('getCoverageRatingAverageValue', () => {
+ it.each([
+ [1, 90],
+ [2, 75],
+ [3, 60],
+ [4, 40],
+ [5, 15],
+ ])('should return the correct value', (rating, value) => {
+ expect(getCoverageRatingAverageValue(rating)).toBe(value);
+ });
+});
+
+describe('getDuplicationsRatingLabel', () => {
+ it('should fail', () => {
+ expect(() => {
+ getCoverageRatingLabel(-1);
+ }).toThrow();
+ });
+ it.each([
+ [1, '< 3%'],
+ [2, '3% - 5%'],
+ [3, '5% - 10%'],
+ [4, '10% - 20%'],
+ [5, '> 20%'],
+ ])('should return the correct label for %s', (rating, label) => {
+ expect(getDuplicationsRatingLabel(rating)).toBe(label);
+ });
+});
+
+describe('getDuplicationsRatingAverageValue', () => {
+ it.each([
+ [1, 1.5],
+ [2, 4],
+ [3, 7.5],
+ [4, 15],
+ [5, 30],
+ ])('should return the correct value', (rating, value) => {
+ expect(getDuplicationsRatingAverageValue(rating)).toBe(value);
+ });
+});
+
+describe('getSizeRatingLabel', () => {
+ it('should fail', () => {
+ expect(() => {
+ getCoverageRatingLabel(-1);
+ }).toThrow();
+ });
+ it.each([
+ [1, '< 1k'],
+ [2, '1k - 10k'],
+ [3, '10k - 100k'],
+ [4, '100k - 500k'],
+ [5, '> 500k'],
+ ])('should return the correct label for %s', (rating, label) => {
+ expect(getSizeRatingLabel(rating)).toBe(label);
+ });
+});
+
+describe('getSizeRatingAverageValue', () => {
+ it.each([
+ [1, 500],
+ [2, 5000],
+ [3, 50000],
+ [4, 250000],
+ [5, 750000],
+ ])('should return the correct value', (rating, value) => {
+ expect(getSizeRatingAverageValue(rating)).toBe(value);
+ });
+});
diff --git a/server/sonar-ui-common/helpers/__tests__/request-test.ts b/server/sonar-ui-common/helpers/__tests__/request-test.ts
index aee57700784..a6ffa480d2d 100644
--- a/server/sonar-ui-common/helpers/__tests__/request-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/request-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import handleRequiredAuthentication from '../handleRequiredAuthentication';
import {
checkStatus,
diff --git a/server/sonar-ui-common/helpers/__tests__/scrolling-test.ts b/server/sonar-ui-common/helpers/__tests__/scrolling-test.ts
index ef9f3802d2a..43ec5664178 100644
--- a/server/sonar-ui-common/helpers/__tests__/scrolling-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/scrolling-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/__tests__/strings-test.ts b/server/sonar-ui-common/helpers/__tests__/strings-test.ts
index 2a9da6cd6a9..00711cf1c1d 100644
--- a/server/sonar-ui-common/helpers/__tests__/strings-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/strings-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/__tests__/urls-test.ts b/server/sonar-ui-common/helpers/__tests__/urls-test.ts
index 171b066ae66..1eb75452a8d 100644
--- a/server/sonar-ui-common/helpers/__tests__/urls-test.ts
+++ b/server/sonar-ui-common/helpers/__tests__/urls-test.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/colors.ts b/server/sonar-ui-common/helpers/colors.ts
index 0d48f016a18..839586b4e20 100644
--- a/server/sonar-ui-common/helpers/colors.ts
+++ b/server/sonar-ui-common/helpers/colors.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/cookies.ts b/server/sonar-ui-common/helpers/cookies.ts
index 42da1d8c98c..6c060726711 100644
--- a/server/sonar-ui-common/helpers/cookies.ts
+++ b/server/sonar-ui-common/helpers/cookies.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/csv.ts b/server/sonar-ui-common/helpers/csv.ts
index cd841d4224b..d162d018f3c 100644
--- a/server/sonar-ui-common/helpers/csv.ts
+++ b/server/sonar-ui-common/helpers/csv.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/dates.ts b/server/sonar-ui-common/helpers/dates.ts
index 0661d62a634..daa25a7b603 100644
--- a/server/sonar-ui-common/helpers/dates.ts
+++ b/server/sonar-ui-common/helpers/dates.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/getHistory.ts b/server/sonar-ui-common/helpers/getHistory.ts
index 5daecc37c97..f7162fd06e4 100644
--- a/server/sonar-ui-common/helpers/getHistory.ts
+++ b/server/sonar-ui-common/helpers/getHistory.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/handleRequiredAuthentication.ts b/server/sonar-ui-common/helpers/handleRequiredAuthentication.ts
index 116102b7287..061cde8c09a 100644
--- a/server/sonar-ui-common/helpers/handleRequiredAuthentication.ts
+++ b/server/sonar-ui-common/helpers/handleRequiredAuthentication.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/init.ts b/server/sonar-ui-common/helpers/init.ts
index 42a894769d2..7d2dceaccfd 100644
--- a/server/sonar-ui-common/helpers/init.ts
+++ b/server/sonar-ui-common/helpers/init.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/keycodes.ts b/server/sonar-ui-common/helpers/keycodes.ts
index 5e606938941..2dad00a7fc0 100644
--- a/server/sonar-ui-common/helpers/keycodes.ts
+++ b/server/sonar-ui-common/helpers/keycodes.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/l10n.ts b/server/sonar-ui-common/helpers/l10n.ts
index aa8c5a82f84..818726ca8b1 100644
--- a/server/sonar-ui-common/helpers/l10n.ts
+++ b/server/sonar-ui-common/helpers/l10n.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/measures.ts b/server/sonar-ui-common/helpers/measures.ts
index de4b3b2269e..53715b40731 100644
--- a/server/sonar-ui-common/helpers/measures.ts
+++ b/server/sonar-ui-common/helpers/measures.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/pages.ts b/server/sonar-ui-common/helpers/pages.ts
index 36ba560a289..40c686e43fa 100644
--- a/server/sonar-ui-common/helpers/pages.ts
+++ b/server/sonar-ui-common/helpers/pages.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/path.ts b/server/sonar-ui-common/helpers/path.ts
index dbd7b9a6285..2a124bf1a63 100644
--- a/server/sonar-ui-common/helpers/path.ts
+++ b/server/sonar-ui-common/helpers/path.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/query.ts b/server/sonar-ui-common/helpers/query.ts
index e1f4c6d0480..479b84dda37 100644
--- a/server/sonar-ui-common/helpers/query.ts
+++ b/server/sonar-ui-common/helpers/query.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/ratings.ts b/server/sonar-ui-common/helpers/ratings.ts
index 29b942dbe3c..6470ce2c0bf 100644
--- a/server/sonar-ui-common/helpers/ratings.ts
+++ b/server/sonar-ui-common/helpers/ratings.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/request.ts b/server/sonar-ui-common/helpers/request.ts
index 0ed88c610f4..6cf106ba815 100644
--- a/server/sonar-ui-common/helpers/request.ts
+++ b/server/sonar-ui-common/helpers/request.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/scrolling.ts b/server/sonar-ui-common/helpers/scrolling.ts
index 6f08703ec41..49473f88cea 100644
--- a/server/sonar-ui-common/helpers/scrolling.ts
+++ b/server/sonar-ui-common/helpers/scrolling.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
const SCROLLING_DURATION = 100;
const SCROLLING_INTERVAL = 10;
const SCROLLING_STEPS = SCROLLING_DURATION / SCROLLING_INTERVAL;
diff --git a/server/sonar-ui-common/helpers/search.tsx b/server/sonar-ui-common/helpers/search.tsx
index dd4382c6795..c12152d33c2 100644
--- a/server/sonar-ui-common/helpers/search.tsx
+++ b/server/sonar-ui-common/helpers/search.tsx
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/storage.ts b/server/sonar-ui-common/helpers/storage.ts
index 5a50eb49c5c..c2a16726b87 100644
--- a/server/sonar-ui-common/helpers/storage.ts
+++ b/server/sonar-ui-common/helpers/storage.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/strings.ts b/server/sonar-ui-common/helpers/strings.ts
index 4109a7f173d..391bcdb334e 100644
--- a/server/sonar-ui-common/helpers/strings.ts
+++ b/server/sonar-ui-common/helpers/strings.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/testUtils.ts b/server/sonar-ui-common/helpers/testUtils.ts
index cf7767eb9e9..9ca54c122a0 100644
--- a/server/sonar-ui-common/helpers/testUtils.ts
+++ b/server/sonar-ui-common/helpers/testUtils.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
@@ -17,7 +17,6 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
import { ReactWrapper, ShallowWrapper } from 'enzyme';
export function mockEvent(overrides = {}) {
diff --git a/server/sonar-ui-common/helpers/types.ts b/server/sonar-ui-common/helpers/types.ts
index 09b786ef807..85ca9976b09 100644
--- a/server/sonar-ui-common/helpers/types.ts
+++ b/server/sonar-ui-common/helpers/types.ts
@@ -1,6 +1,6 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
diff --git a/server/sonar-ui-common/helpers/urls.ts b/server/sonar-ui-common/helpers/urls.ts
index 599d8fe531e..296091d7b3c 100644
--- a/server/sonar-ui-common/helpers/urls.ts
+++ b/server/sonar-ui-common/helpers/urls.ts
@@ -1,6 +1,24 @@
/*
- * Sonar UI Common
- * Copyright (C) 2019-2020 SonarSource SA
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+/*
+ * SonarQube
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or