diff options
Diffstat (limited to 'server/sonar-web/src/main')
214 files changed, 355 insertions, 334 deletions
diff --git a/server/sonar-web/src/main/js/api/alm-integrations.ts b/server/sonar-web/src/main/js/api/alm-integrations.ts index a2a350eb073..ce7986c0c9c 100644 --- a/server/sonar-web/src/main/js/api/alm-integrations.ts +++ b/server/sonar-web/src/main/js/api/alm-integrations.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { get, getJSON, parseError, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { AzureProject, AzureRepository, diff --git a/server/sonar-web/src/main/js/api/alm-settings.ts b/server/sonar-web/src/main/js/api/alm-settings.ts index b32bb24d263..cd7a986bdb6 100644 --- a/server/sonar-web/src/main/js/api/alm-settings.ts +++ b/server/sonar-web/src/main/js/api/alm-settings.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { get, getJSON, HttpStatus, parseError, parseJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { AlmSettingsBindingDefinitions, AlmSettingsInstance, diff --git a/server/sonar-web/src/main/js/api/application.ts b/server/sonar-web/src/main/js/api/application.ts index 9735e83ba08..6c51411b58e 100644 --- a/server/sonar-web/src/main/js/api/application.ts +++ b/server/sonar-web/src/main/js/api/application.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { Application, ApplicationPeriod } from '../types/application'; import { Visibility } from '../types/component'; diff --git a/server/sonar-web/src/main/js/api/branches.ts b/server/sonar-web/src/main/js/api/branches.ts index a7884879428..e0a9fb6f8ed 100644 --- a/server/sonar-web/src/main/js/api/branches.ts +++ b/server/sonar-web/src/main/js/api/branches.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { Branch, PullRequest } from '../types/branch-like'; export function getBranches(project: string): Promise<Branch[]> { diff --git a/server/sonar-web/src/main/js/api/ce.ts b/server/sonar-web/src/main/js/api/ce.ts index 2a292c47aff..62b36056571 100644 --- a/server/sonar-web/src/main/js/api/ce.ts +++ b/server/sonar-web/src/main/js/api/ce.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { IndexationStatus } from '../types/indexation'; import { ActivityRequestParameters, Task, TaskWarning } from '../types/tasks'; import { Paging } from '../types/types'; diff --git a/server/sonar-web/src/main/js/api/component-report.ts b/server/sonar-web/src/main/js/api/component-report.ts index f54941ebdfd..20fd7bf0432 100644 --- a/server/sonar-web/src/main/js/api/component-report.ts +++ b/server/sonar-web/src/main/js/api/component-report.ts @@ -17,9 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; import { getBaseUrl } from '../helpers/system'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { ComponentReportStatus } from '../types/component-report'; export function getReportStatus( diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts index b6f020aa7f7..29b5a4c4e1b 100644 --- a/server/sonar-web/src/main/js/api/components.ts +++ b/server/sonar-web/src/main/js/api/components.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, RequestData } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { BranchParameters } from '../types/branch-like'; import { ComponentQualifier, diff --git a/server/sonar-web/src/main/js/api/editions.ts b/server/sonar-web/src/main/js/api/editions.ts index 5d3d8c20444..83a16612b68 100644 --- a/server/sonar-web/src/main/js/api/editions.ts +++ b/server/sonar-web/src/main/js/api/editions.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { License } from '../types/editions'; export function isValidLicense(): Promise<{ isValidLicense: boolean }> { diff --git a/server/sonar-web/src/main/js/api/github-provisioning.ts b/server/sonar-web/src/main/js/api/github-provisioning.ts index 2e932886a8f..713f9b123a8 100644 --- a/server/sonar-web/src/main/js/api/github-provisioning.ts +++ b/server/sonar-web/src/main/js/api/github-provisioning.ts @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import axios from 'axios'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { GitHubConfigurationStatus, GitHubMapping, GithubStatus } from '../types/provisioning'; const GITHUB_PERMISSION_MAPPINGS = '/api/v2/dop-translation/github-permission-mappings'; diff --git a/server/sonar-web/src/main/js/api/issues.ts b/server/sonar-web/src/main/js/api/issues.ts index a87ad9ad1f5..6f490cc80e7 100644 --- a/server/sonar-web/src/main/js/api/issues.ts +++ b/server/sonar-web/src/main/js/api/issues.ts @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import getCoverageStatus from '../components/SourceViewer/helpers/getCoverageStatus'; import { get, @@ -27,7 +28,6 @@ import { postJSON, RequestData, } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { FacetName, IssueResponse, ListIssuesResponse, RawIssuesResponse } from '../types/issues'; import { Dict, FacetValue, IssueChangelog, SnippetsByComponent, SourceLine } from '../types/types'; diff --git a/server/sonar-web/src/main/js/api/languages.ts b/server/sonar-web/src/main/js/api/languages.ts index 3c9f6c907c2..f76605f2ea8 100644 --- a/server/sonar-web/src/main/js/api/languages.ts +++ b/server/sonar-web/src/main/js/api/languages.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { Language } from '../types/languages'; export function getLanguages(): Promise<Language[]> { diff --git a/server/sonar-web/src/main/js/api/measures.ts b/server/sonar-web/src/main/js/api/measures.ts index a2bb0470f23..b30bce138bb 100644 --- a/server/sonar-web/src/main/js/api/measures.ts +++ b/server/sonar-web/src/main/js/api/measures.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { BranchParameters } from '../types/branch-like'; import { MeasuresAndMetaWithMetrics, diff --git a/server/sonar-web/src/main/js/api/messages.ts b/server/sonar-web/src/main/js/api/messages.ts index 1d03f17b8c0..3184cdb4c75 100644 --- a/server/sonar-web/src/main/js/api/messages.ts +++ b/server/sonar-web/src/main/js/api/messages.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; export enum MessageTypes { GlobalNcd90 = 'GLOBAL_NCD_90', diff --git a/server/sonar-web/src/main/js/api/metrics.ts b/server/sonar-web/src/main/js/api/metrics.ts index 09b966092c0..894ef7a4a65 100644 --- a/server/sonar-web/src/main/js/api/metrics.ts +++ b/server/sonar-web/src/main/js/api/metrics.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { Metric } from '../types/types'; export interface MetricsResponse { diff --git a/server/sonar-web/src/main/js/api/navigation.ts b/server/sonar-web/src/main/js/api/navigation.ts index e41f88ec6c3..05099d42fce 100644 --- a/server/sonar-web/src/main/js/api/navigation.ts +++ b/server/sonar-web/src/main/js/api/navigation.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { AppState } from '../types/appstate'; import { BranchParameters } from '../types/branch-like'; import { Extension, NavigationComponent } from '../types/types'; diff --git a/server/sonar-web/src/main/js/api/newCodeDefinition.ts b/server/sonar-web/src/main/js/api/newCodeDefinition.ts index cf81abd3a2f..57a553eb71f 100644 --- a/server/sonar-web/src/main/js/api/newCodeDefinition.ts +++ b/server/sonar-web/src/main/js/api/newCodeDefinition.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { NewCodeDefinition, NewCodeDefinitionBranch, diff --git a/server/sonar-web/src/main/js/api/notifications.ts b/server/sonar-web/src/main/js/api/notifications.ts index bd0310dd9d8..aab9b5df561 100644 --- a/server/sonar-web/src/main/js/api/notifications.ts +++ b/server/sonar-web/src/main/js/api/notifications.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { AddRemoveNotificationParameters, NotificationsResponse } from '../types/notifications'; export function getNotifications(): Promise<NotificationsResponse> { diff --git a/server/sonar-web/src/main/js/api/permissions.ts b/server/sonar-web/src/main/js/api/permissions.ts index 73e5c9be020..06c554e293f 100644 --- a/server/sonar-web/src/main/js/api/permissions.ts +++ b/server/sonar-web/src/main/js/api/permissions.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON, RequestData } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { Visibility } from '../types/component'; import { Paging, diff --git a/server/sonar-web/src/main/js/api/plugins.ts b/server/sonar-web/src/main/js/api/plugins.ts index 3531f8351f2..db78fea70d7 100644 --- a/server/sonar-web/src/main/js/api/plugins.ts +++ b/server/sonar-web/src/main/js/api/plugins.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { AvailablePlugin, InstalledPlugin, diff --git a/server/sonar-web/src/main/js/api/project-badges.ts b/server/sonar-web/src/main/js/api/project-badges.ts index db811882fee..d73ff348980 100644 --- a/server/sonar-web/src/main/js/api/project-badges.ts +++ b/server/sonar-web/src/main/js/api/project-badges.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; export function getProjectBadgesToken(project: string) { return getJSON('/api/project_badges/token', { project }) diff --git a/server/sonar-web/src/main/js/api/project-dump.ts b/server/sonar-web/src/main/js/api/project-dump.ts index ed939039704..e7ce3574b60 100644 --- a/server/sonar-web/src/main/js/api/project-dump.ts +++ b/server/sonar-web/src/main/js/api/project-dump.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { DumpStatus } from '../types/project-dump'; export function getStatus(componentKey: string): Promise<DumpStatus> { diff --git a/server/sonar-web/src/main/js/api/project-management.ts b/server/sonar-web/src/main/js/api/project-management.ts index 65a162691d2..9d10c8834f0 100644 --- a/server/sonar-web/src/main/js/api/project-management.ts +++ b/server/sonar-web/src/main/js/api/project-management.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { ComponentQualifier, Visibility } from '../types/component'; import { Paging } from '../types/types'; diff --git a/server/sonar-web/src/main/js/api/projectActivity.ts b/server/sonar-web/src/main/js/api/projectActivity.ts index 7a28e2499ca..52edbc66f0f 100644 --- a/server/sonar-web/src/main/js/api/projectActivity.ts +++ b/server/sonar-web/src/main/js/api/projectActivity.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { BranchParameters } from '../types/branch-like'; import { Analysis, diff --git a/server/sonar-web/src/main/js/api/projectLinks.ts b/server/sonar-web/src/main/js/api/projectLinks.ts index c8ca2d71960..fe8880f72d2 100644 --- a/server/sonar-web/src/main/js/api/projectLinks.ts +++ b/server/sonar-web/src/main/js/api/projectLinks.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { ProjectLink } from '../types/types'; export function getProjectLinks(projectKey: string): Promise<ProjectLink[]> { diff --git a/server/sonar-web/src/main/js/api/quality-gates.ts b/server/sonar-web/src/main/js/api/quality-gates.ts index d35bd99116d..a0767938280 100644 --- a/server/sonar-web/src/main/js/api/quality-gates.ts +++ b/server/sonar-web/src/main/js/api/quality-gates.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { BranchParameters } from '../types/branch-like'; import { AddDeleteGroupPermissionsParameters, diff --git a/server/sonar-web/src/main/js/api/quality-profiles.ts b/server/sonar-web/src/main/js/api/quality-profiles.ts index 6ab0d03048b..120dd6a33cd 100644 --- a/server/sonar-web/src/main/js/api/quality-profiles.ts +++ b/server/sonar-web/src/main/js/api/quality-profiles.ts @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { map } from 'lodash'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { Exporter, ProfileChangelogEvent } from '../apps/quality-profiles/types'; import { csvEscape } from '../helpers/csv'; import { RequestData, getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { CleanCodeAttributeCategory, SoftwareImpact } from '../types/clean-code-taxonomy'; import { Dict, Paging, ProfileInheritanceDetails, UserSelected } from '../types/types'; diff --git a/server/sonar-web/src/main/js/api/rules.ts b/server/sonar-web/src/main/js/api/rules.ts index 9c7588ea5e8..ef3991bb259 100644 --- a/server/sonar-web/src/main/js/api/rules.ts +++ b/server/sonar-web/src/main/js/api/rules.ts @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { HttpStatusCode } from 'axios'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { axiosToCatch, getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { CleanCodeAttribute, SoftwareImpact } from '../types/clean-code-taxonomy'; import { GetRulesAppResponse, SearchRulesResponse } from '../types/coding-rules'; import { SearchRulesQuery } from '../types/rules'; diff --git a/server/sonar-web/src/main/js/api/scim-provisioning.ts b/server/sonar-web/src/main/js/api/scim-provisioning.ts index abbc75667f0..b9678e9c6dc 100644 --- a/server/sonar-web/src/main/js/api/scim-provisioning.ts +++ b/server/sonar-web/src/main/js/api/scim-provisioning.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; export function fetchIsScimEnabled(): Promise<boolean> { return getJSON('/api/scim_management/status') diff --git a/server/sonar-web/src/main/js/api/security-hotspots.ts b/server/sonar-web/src/main/js/api/security-hotspots.ts index 813a3f756cc..75a743ab118 100644 --- a/server/sonar-web/src/main/js/api/security-hotspots.ts +++ b/server/sonar-web/src/main/js/api/security-hotspots.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { BranchParameters } from '../types/branch-like'; import { Hotspot, diff --git a/server/sonar-web/src/main/js/api/settings.ts b/server/sonar-web/src/main/js/api/settings.ts index 3a092ee708c..8ca01a42f9d 100644 --- a/server/sonar-web/src/main/js/api/settings.ts +++ b/server/sonar-web/src/main/js/api/settings.ts @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { omitBy } from 'lodash'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { isCategoryDefinition } from '../apps/settings/utils'; import { getJSON, post, postJSON, RequestData } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { BranchParameters } from '../types/branch-like'; import { ExtendedSettingDefinition, diff --git a/server/sonar-web/src/main/js/api/system.ts b/server/sonar-web/src/main/js/api/system.ts index 5ad15dab742..7014f71feea 100644 --- a/server/sonar-web/src/main/js/api/system.ts +++ b/server/sonar-web/src/main/js/api/system.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON, requestTryAndRepeatUntil } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { SystemUpgrade } from '../types/system'; import { SysInfoCluster, SysInfoStandalone, SysStatus } from '../types/types'; diff --git a/server/sonar-web/src/main/js/api/time-machine.ts b/server/sonar-web/src/main/js/api/time-machine.ts index 6f88f067b24..45f17998588 100644 --- a/server/sonar-web/src/main/js/api/time-machine.ts +++ b/server/sonar-web/src/main/js/api/time-machine.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { BranchParameters } from '../types/branch-like'; import { MetricKey } from '../types/metrics'; import { Paging } from '../types/types'; diff --git a/server/sonar-web/src/main/js/api/user-tokens.ts b/server/sonar-web/src/main/js/api/user-tokens.ts index bc2080a6b76..35f8402155b 100644 --- a/server/sonar-web/src/main/js/api/user-tokens.ts +++ b/server/sonar-web/src/main/js/api/user-tokens.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { NewUserToken, UserToken } from '../types/token'; /** List tokens for given user login */ diff --git a/server/sonar-web/src/main/js/api/users.ts b/server/sonar-web/src/main/js/api/users.ts index aff47526174..e4387df03af 100644 --- a/server/sonar-web/src/main/js/api/users.ts +++ b/server/sonar-web/src/main/js/api/users.ts @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import axios from 'axios'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { HttpStatus, axiosToCatch, getJSON, parseJSON, post } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { IdentityProvider, Paging } from '../types/types'; import { ChangePasswordResults, diff --git a/server/sonar-web/src/main/js/api/web-api.ts b/server/sonar-web/src/main/js/api/web-api.ts index 89d1fdeedb1..b7119a8fb20 100644 --- a/server/sonar-web/src/main/js/api/web-api.ts +++ b/server/sonar-web/src/main/js/api/web-api.ts @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { OpenAPIV3 } from 'openapi-types'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { WebApi } from '../types/types'; interface RawDomain { diff --git a/server/sonar-web/src/main/js/api/webhooks.ts b/server/sonar-web/src/main/js/api/webhooks.ts index 52c616f5fc0..9b59e82a542 100644 --- a/server/sonar-web/src/main/js/api/webhooks.ts +++ b/server/sonar-web/src/main/js/api/webhooks.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON, post, postJSON } from '../helpers/request'; -import { throwGlobalError } from '../sonar-aligned/helpers/error'; import { Paging } from '../types/types'; import { WebhookCreatePayload, diff --git a/server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts b/server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts index 6d044b37041..c14038522de 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts +++ b/server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts @@ -19,6 +19,7 @@ */ import { addGlobalSuccessMessage } from 'design-system'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { get, @@ -31,7 +32,6 @@ import { postJSONBody, request, } from '../../../helpers/request'; -import { throwGlobalError } from '../../../sonar-aligned/helpers/error'; const exposeLibraries = () => { const global = window as any; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx index 8718aea3a99..fda6f759b77 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx @@ -26,13 +26,13 @@ import { PopupZLevel, } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { useLocation } from '../../../../components/hoc/withRouter'; import { DEFAULT_ISSUES_QUERY } from '../../../../components/shared/utils'; import { isPullRequest } from '../../../../helpers/branch-like'; import { hasMessage, translate, translateWithParameters } from '../../../../helpers/l10n'; import { getPortfolioUrl, getProjectQueryUrl } from '../../../../helpers/urls'; import { useBranchesQuery } from '../../../../queries/branch'; -import { getBranchLikeQuery } from '../../../../sonar-aligned/helpers/branch-like'; import { BranchParameters } from '../../../../types/branch-like'; import { ComponentQualifier, diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchHelpTooltip.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchHelpTooltip.tsx index 53585914f9c..7f97acc9051 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchHelpTooltip.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchHelpTooltip.tsx @@ -20,11 +20,11 @@ import { Link } from '@sonarsource/echoes-react'; import { HelperHintIcon } from 'design-system'; import React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate, translateWithParameters } from '../../../../../helpers/l10n'; import { getApplicationAdminUrl } from '../../../../../helpers/urls'; import { useProjectBindingQuery } from '../../../../../queries/devops-integration'; -import DocHelpTooltip from '../../../../../sonar-aligned/components/controls/DocHelpTooltip'; -import HelpTooltip from '../../../../../sonar-aligned/components/controls/HelpTooltip'; import { AlmKeys } from '../../../../../types/alm-settings'; import { Component } from '../../../../../types/types'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx index 9748cb935d6..41c75853d57 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx @@ -19,6 +19,7 @@ */ import { DropdownMenu, InputSearch, ItemDivider, Link } from 'design-system'; import * as React from 'react'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import { Router, withRouter } from '../../../../../components/hoc/withRouter'; import { getBrancheLikesAsTree, @@ -28,7 +29,6 @@ import { import { KeyboardKeys } from '../../../../../helpers/keycodes'; import { translate } from '../../../../../helpers/l10n'; import { getBranchLikeUrl, queryToSearch } from '../../../../../helpers/urls'; -import { isBranch } from '../../../../../sonar-aligned/helpers/branch-like'; import { BranchLike, BranchLikeTree } from '../../../../../types/branch-like'; import { ComponentQualifier } from '../../../../../types/component'; import { Component } from '../../../../../types/types'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx index d3ce663a6e9..9a9a9624b63 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx @@ -20,10 +20,10 @@ import classNames from 'classnames'; import { Badge, ItemButton, TextBold, TextMuted } from 'design-system'; import * as React from 'react'; +import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; import BranchLikeIcon from '../../../../../components/icon-mappers/BranchLikeIcon'; import { getBranchLikeDisplayName } from '../../../../../helpers/branch-like'; import { translate } from '../../../../../helpers/l10n'; -import { isMainBranch } from '../../../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../../../types/branch-like'; import QualityGateStatus from './QualityGateStatus'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx index de5014e202c..11c787cfa5e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItemList.tsx @@ -19,10 +19,10 @@ */ import { HelperHintIcon, ItemDivider, ItemHeader } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { getBranchLikeKey, isSameBranchLike } from '../../../../../helpers/branch-like'; import { translate } from '../../../../../helpers/l10n'; import { isDefined } from '../../../../../helpers/types'; -import HelpTooltip from '../../../../../sonar-aligned/components/controls/HelpTooltip'; import { BranchLike, BranchLikeTree } from '../../../../../types/branch-like'; import MenuItem from './MenuItem'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/QualityGateStatus.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/QualityGateStatus.tsx index 4b6cad57e4a..8d2aa27811c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/QualityGateStatus.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/QualityGateStatus.tsx @@ -20,8 +20,8 @@ import classNames from 'classnames'; import { QualityGateIndicator } from 'design-system'; import React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translateWithParameters } from '../../../../../helpers/l10n'; -import { formatMeasure } from '../../../../../sonar-aligned/helpers/measures'; import { BranchLike } from '../../../../../types/branch-like'; import { MetricType } from '../../../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/utils.ts b/server/sonar-web/src/main/js/app/components/nav/component/utils.ts index 730abbc8c4d..f713ccb0653 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/utils.ts +++ b/server/sonar-web/src/main/js/app/components/nav/component/utils.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { isBranch } from '../../../../sonar-aligned/helpers/branch-like'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../../types/branch-like'; import { ComponentQualifier } from '../../../../types/component'; import { Component } from '../../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/account/profile/Profile.tsx b/server/sonar-web/src/main/js/apps/account/profile/Profile.tsx index 340bb851e22..030f84a9681 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/Profile.tsx +++ b/server/sonar-web/src/main/js/apps/account/profile/Profile.tsx @@ -20,9 +20,9 @@ import { GreySeparator, HelperHintIcon, SubHeading, Title } from 'design-system'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { LoggedInUser } from '../../../types/users'; import { Preferences } from './Preferences'; import UserExternalIdentity from './UserExternalIdentity'; diff --git a/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx b/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx index 1cbd7c8ca53..c314f388849 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx +++ b/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx @@ -27,13 +27,13 @@ import { UnorderedList, } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import MetaLink from '../../../components/common/MetaLink'; import Tooltip from '../../../components/controls/Tooltip'; import DateFromNow from '../../../components/intl/DateFromNow'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { orderLinks } from '../../../helpers/projectLinks'; import { getProjectUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { MyProject, ProjectLink, Status } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx index 7b4fc52c0f1..20f5542e456 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatPendingTime.tsx @@ -19,9 +19,9 @@ */ import { HelperHintIcon } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; // Do not display the pending time for values smaller than this threshold (in ms) const MIN_PENDING_TIME_THRESHOLD = 1000; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatStillFailing.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/StatStillFailing.tsx index cd70916cb79..9124ce7b2ab 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatStillFailing.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatStillFailing.tsx @@ -19,8 +19,8 @@ */ import { HelperHintIcon, StandoutLink } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; export interface Props { failingCount?: number; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx index 7369ce40e27..cfab3673035 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx @@ -25,10 +25,10 @@ import { Spinner, } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { getWorkers } from '../../../api/ce'; import Tooltip from '../../../components/controls/Tooltip'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import NoWorkersSupportPopup from './NoWorkersSupportPopup'; import WorkersForm from './WorkersForm'; diff --git a/server/sonar-web/src/main/js/apps/code/components/CodeAppRenderer.tsx b/server/sonar-web/src/main/js/apps/code/components/CodeAppRenderer.tsx index d62f224316e..1cb824488c1 100644 --- a/server/sonar-web/src/main/js/apps/code/components/CodeAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/CodeAppRenderer.tsx @@ -29,6 +29,7 @@ import { import { difference, intersection } from 'lodash'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import A11ySkipTarget from '../../../components/a11y/A11ySkipTarget'; import ListFooter from '../../../components/controls/ListFooter'; import Suggestions from '../../../components/embed-docs-modal/Suggestions'; @@ -38,7 +39,6 @@ import { CCT_SOFTWARE_QUALITY_METRICS, OLD_TAXONOMY_METRICS } from '../../../hel import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate } from '../../../helpers/l10n'; import { areCCTMeasuresComputed } from '../../../helpers/measures'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { BranchLike } from '../../../types/branch-like'; import { isApplication, isPortfolioLike } from '../../../types/component'; import { Breadcrumb, Component, ComponentMeasure, Dict, Metric } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx index a4a3a41824a..6092b1081fc 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx @@ -26,6 +26,7 @@ import { RatingEnum, } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import Measure from '../../../components/measure/Measure'; import { getLeakValue } from '../../../components/measure/utils'; import { @@ -37,7 +38,6 @@ import { areCCTMeasuresComputed as areCCTMeasuresComputedFn, isDiffMetric, } from '../../../helpers/measures'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { isApplication, isProject } from '../../../types/component'; import { MetricKey, MetricType } from '../../../types/metrics'; import { Metric, Status, ComponentMeasure as TypeComponentMeasure } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx index ddf29edee55..ac401b378b0 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx @@ -21,10 +21,10 @@ import { LinkHighlight, LinkStandalone } from '@sonarsource/echoes-react'; import { Badge, BranchIcon, LightLabel, Note, QualifierIcon } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { isDefined } from '../../../helpers/types'; import { CodeScope, getComponentOverviewUrl, queryToSearch } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier, diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.tsx b/server/sonar-web/src/main/js/apps/code/components/Search.tsx index 18586350462..bf0bd2bc9e2 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/Search.tsx @@ -21,11 +21,11 @@ import classNames from 'classnames'; import { InputSearch, Spinner, ToggleButton } from 'design-system'; import { isEmpty, omit } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getTree } from '../../../api/components'; import { Location, Router, withRouter } from '../../../components/hoc/withRouter'; import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate } from '../../../helpers/l10n'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier, isPortfolioLike, isView } from '../../../types/component'; import { ComponentMeasure } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/code/utils.ts b/server/sonar-web/src/main/js/apps/code/utils.ts index b9518349bb7..14fa190f3f5 100644 --- a/server/sonar-web/src/main/js/apps/code/utils.ts +++ b/server/sonar-web/src/main/js/apps/code/utils.ts @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getBreadcrumbs, getChildren, getComponent, getComponentData } from '../../api/components'; import { isPullRequest } from '../../helpers/branch-like'; import { CCT_SOFTWARE_QUALITY_METRICS, OLD_TAXONOMY_METRICS } from '../../helpers/constants'; -import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier, isPortfolioLike } from '../../types/component'; import { MetricKey } from '../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx index 9137773c91e..de69a9319e9 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx @@ -19,10 +19,10 @@ */ import { ButtonPrimary, FlagMessage, FormField, Modal, Spinner } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { Profile, bulkActivateRules, bulkDeactivateRules } from '../../../api/quality-profiles'; import withLanguagesContext from '../../../app/components/languages/withLanguagesContext'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { Languages } from '../../../types/languages'; import { MetricType } from '../../../types/metrics'; import { Dict } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx index 4156a90e8ab..cabaca83040 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx @@ -21,9 +21,9 @@ import classNames from 'classnames'; import { FacetBox, FacetItem } from 'design-system'; import { orderBy, sortBy, without } from 'lodash'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import Tooltip from '../../../components/controls/Tooltip'; import { translate } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { Dict } from '../../../types/types'; import { FacetItemsList } from '../../issues/sidebar/FacetItemsList'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx index 5f17719be4e..480ba05fb86 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/ProfileFacet.tsx @@ -21,9 +21,9 @@ import styled from '@emotion/styled'; import { FacetBox, FacetItem, HelperHintIcon, Note, themeColor } from 'design-system'; import { sortBy } from 'lodash'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { Profile } from '../../../api/quality-profiles'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { Dict } from '../../../types/types'; import { FacetItemsList } from '../../issues/sidebar/FacetItemsList'; import { FacetKey, Query } from '../query'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx index d6db414460f..1d975ba4494 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx @@ -28,6 +28,7 @@ import { themeColor, } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { Profile } from '../../../api/quality-profiles'; import ConfirmButton from '../../../components/controls/ConfirmButton'; import DateFormatter from '../../../components/intl/DateFormatter'; @@ -37,7 +38,6 @@ import { useRuleDetailsQuery, useUpdateRuleMutation, } from '../../../queries/rules'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { Dict } from '../../../types/types'; import { Activation } from '../query'; import CustomRuleButton from './CustomRuleButton'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderActions.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderActions.tsx index 2437e4905a0..46d82b187b4 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderActions.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderActions.tsx @@ -19,11 +19,11 @@ */ import { Note, SeparatorCircleIcon, TextSubdued } from 'design-system'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import IssueSeverityIcon from '../../../components/icon-mappers/IssueSeverityIcon'; import IssueTypeIcon from '../../../components/icon-mappers/IssueTypeIcon'; import TagsList from '../../../components/tags/TagsList'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { IssueSeverity } from '../../../types/issues'; import { Dict, RuleDetails } from '../../../types/types'; import RuleDetailsTagsPopup from './RuleDetailsTagsPopup'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderMeta.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderMeta.tsx index 203f4826d5e..846377823dd 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderMeta.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderMeta.tsx @@ -19,10 +19,10 @@ */ import { Badge, HelperHintIcon, Link, Note, SeparatorCircleIcon } from 'design-system'; import React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import Tooltip from '../../../components/controls/Tooltip'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getRuleUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { Dict, RuleDetails } from '../../../types/types'; const EXTERNAL_RULE_REPO_PREFIX = 'external_'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx index dbfd31d4765..2813d2bf9c6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx @@ -21,6 +21,7 @@ import { ContentCell, Link, Spinner, SubTitle, Table, TableRow } from 'design-sy import { keyBy } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { getComponentData } from '../../../api/components'; import { getFacet } from '../../../api/issues'; import withAvailableFeatures, { @@ -30,7 +31,6 @@ import Tooltip from '../../../components/controls/Tooltip'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; import { translate } from '../../../helpers/l10n'; import { getIssuesUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { Feature } from '../../../types/features'; import { FacetName } from '../../../types/issues'; import { MetricType } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx index c5b9bdde608..394220d35a6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx @@ -29,6 +29,7 @@ import { themeBorder, } from 'design-system'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { Profile, deactivateRule } from '../../../api/quality-profiles'; import ConfirmButton from '../../../components/controls/ConfirmButton'; import Tooltip from '../../../components/controls/Tooltip'; @@ -38,7 +39,6 @@ import TypeHelper from '../../../components/shared/TypeHelper'; import TagsList from '../../../components/tags/TagsList'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getRuleUrl } from '../../../helpers/urls'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { Rule } from '../../../types/types'; import { Activation } from '../query'; import ActivationButton from './ActivationButton'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/SeverityFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/SeverityFacet.tsx index 9924f4ba39e..7e6e1d124e9 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/SeverityFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/SeverityFacet.tsx @@ -19,10 +19,10 @@ */ import { HelperHintIcon } from 'design-system'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import SoftwareImpactSeverityIcon from '../../../components/icon-mappers/SoftwareImpactSeverityIcon'; import { IMPACT_SEVERITIES } from '../../../helpers/constants'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import Facet, { BasicProps } from './Facet'; export default function SeverityFacet(props: BasicProps) { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx index ba3b7fbc37c..87fdc3d87cf 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/TemplateFacet.tsx @@ -19,8 +19,8 @@ */ import { HelperHintIcon } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import Facet, { BasicProps } from './Facet'; interface Props extends Omit<BasicProps, 'onChange' | 'values'> { diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/ComponentMeasuresApp.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/ComponentMeasuresApp.tsx index 4df28d0b794..f05615a4f67 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/ComponentMeasuresApp.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/ComponentMeasuresApp.tsx @@ -31,6 +31,8 @@ import { import { keyBy } from 'lodash'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getMeasuresWithPeriod } from '../../../api/measures'; import { getAllMetrics } from '../../../api/metrics'; import { ComponentContext } from '../../../app/components/componentContext/ComponentContext'; @@ -43,8 +45,6 @@ import { isPullRequest, isSameBranchLike } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { areLeakAndOverallCCTMeasuresComputed } from '../../../helpers/measures'; import { WithBranchLikesProps, useBranchesQuery } from '../../../queries/branch'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { ComponentQualifier, isPortfolioLike } from '../../../types/component'; import { MeasurePageView } from '../../../types/measures'; import { MetricKey } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx index 617f2880c8e..20013d6cbfe 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx @@ -19,6 +19,7 @@ */ import { Highlight, KeyboardHint } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getComponentTree } from '../../../api/components'; import { getMeasures } from '../../../api/measures'; import SourceViewer from '../../../components/SourceViewer/SourceViewer'; @@ -33,7 +34,6 @@ import { getCCTMeasureValue, isDiffMetric } from '../../../helpers/measures'; import { RequestData } from '../../../helpers/request'; import { isDefined } from '../../../helpers/types'; import { getProjectUrl } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { isApplication, isFile, isView } from '../../../types/component'; import { MeasurePageView } from '../../../types/measures'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx index b772df0a850..99e0c642cfd 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx @@ -21,13 +21,13 @@ import { LinkStandalone } from '@sonarsource/echoes-react'; import classNames from 'classnames'; import { MetricsRatingBadge, RatingLabel } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import LanguageDistribution from '../../../components/charts/LanguageDistribution'; import Tooltip from '../../../components/controls/Tooltip'; import Measure from '../../../components/measure/Measure'; import { getLocalizedMetricName, translate, translateWithParameters } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; import { getMeasureHistoryUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; import { MetricKey, MetricType } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx index 6d577b2f458..243c4fb8f24 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx @@ -19,11 +19,11 @@ */ import { Spinner } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getComponentLeaves } from '../../../api/components'; import SourceViewer from '../../../components/SourceViewer/SourceViewer'; import A11ySkipTarget from '../../../components/a11y/A11ySkipTarget'; import { isSameBranchLike } from '../../../helpers/branch-like'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { isFile } from '../../../types/component'; import { diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx index 91bbc9ac8bc..737c7520db1 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getComponentShow } from '../../../api/components'; import { Router } from '../../../components/hoc/withRouter'; import { isSameBranchLike } from '../../../helpers/branch-like'; import { getProjectUrl } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { isView } from '../../../types/component'; import { diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx index 9a6797956b5..eb0a0a7395b 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx @@ -20,12 +20,12 @@ import classNames from 'classnames'; import { Breadcrumbs, ClipboardIconButton, HoverLink } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getBreadcrumbs } from '../../../api/components'; import { isSameBranchLike } from '../../../helpers/branch-like'; import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate } from '../../../helpers/l10n'; import { collapsePath, limitComponentName } from '../../../helpers/path'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier, isProject } from '../../../types/component'; import { ComponentMeasure, ComponentMeasureIntern } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChartView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChartView.tsx index 0dd396ef30d..cc448a7e477 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChartView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChartView.tsx @@ -27,6 +27,8 @@ import { themeColor, } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { getLocalizedMetricDomain, getLocalizedMetricName, @@ -36,8 +38,6 @@ import { import { isDiffMetric } from '../../../helpers/measures'; import { isDefined } from '../../../helpers/types'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { isProject, isView } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ColorRatingsLegend.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ColorRatingsLegend.tsx index 9eecb2e95ca..9d01b8d4ba7 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ColorRatingsLegend.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ColorRatingsLegend.tsx @@ -19,8 +19,8 @@ */ import { ColorFilterOption, ColorsLegend } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translateWithParameters } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; export interface ColorRatingsLegendProps { diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx index d7370ee781f..a3820b9ceda 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx @@ -20,12 +20,12 @@ import { ButtonSecondary, FlagMessage } from 'design-system'; import { throttle } from 'lodash'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import ListFooter from '../../../components/controls/ListFooter'; import { isInput, isShortcut } from '../../../helpers/keyboardEventHelpers'; import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { isDiffMetric, isPeriodBestValue } from '../../../helpers/measures'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { MeasurePageView } from '../../../types/measures'; import { MetricType } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx index ff45c4a3d6d..d167cce21df 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx @@ -19,10 +19,10 @@ */ import { MetricsRatingBadge, NumericalCell, RatingLabel } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import Measure from '../../../components/measure/Measure'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getCCTMeasureValue, isDiffMetric } from '../../../helpers/measures'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { ComponentMeasureEnhanced, MeasureEnhanced, Metric } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx index b00b48be0c6..b33746cd45a 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx @@ -32,13 +32,13 @@ import { import { isEmpty } from 'lodash'; import * as React from 'react'; import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import ColorBoxLegend from '../../../components/charts/ColorBoxLegend'; import ColorGradientLegend from '../../../components/charts/ColorGradientLegend'; import { getComponentMeasureUniqueKey } from '../../../helpers/component'; import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; import { isDefined } from '../../../helpers/types'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricKey, MetricType } from '../../../types/metrics'; import { ComponentMeasureEnhanced, ComponentMeasureIntern, Metric } from '../../../types/types'; import EmptyResult from './EmptyResult'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainSubnavigation.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainSubnavigation.tsx index 2ed3904b2a3..a90b976c8d5 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainSubnavigation.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainSubnavigation.tsx @@ -25,6 +25,7 @@ import { SubnavigationSubheading, } from 'design-system'; import React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { getLocalizedCategoryMetricName, getLocalizedMetricDomain, @@ -32,7 +33,6 @@ import { hasMessage, translate, } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { MeasureEnhanced } from '../../../types/types'; import { addMeasureCategories, diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/SubnavigationMeasureValue.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/SubnavigationMeasureValue.tsx index 0b9a0e545c8..30f140b329a 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/SubnavigationMeasureValue.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/SubnavigationMeasureValue.tsx @@ -19,10 +19,10 @@ */ import { MetricsRatingBadge, Note, RatingLabel } from 'design-system'; import React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import Measure from '../../../components/measure/Measure'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { MeasureEnhanced } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/utils.ts b/server/sonar-web/src/main/js/apps/component-measures/utils.ts index 6e0211e3177..c9fbfe80f03 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/utils.ts +++ b/server/sonar-web/src/main/js/apps/component-measures/utils.ts @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { groupBy, memoize, sortBy, toPairs } from 'lodash'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import { enhanceMeasure } from '../../components/measure/utils'; import { isPullRequest } from '../../helpers/branch-like'; import { @@ -42,7 +43,6 @@ import { parseAsString, serializeString, } from '../../helpers/query'; -import { isBranch } from '../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { Domain, MeasurePageView } from '../../types/measures'; diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx index 935fe980209..c613b28c7dd 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectModeSelection.tsx @@ -30,11 +30,11 @@ import { Title, } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; import { Image } from '../../../components/common/Image'; import { translate } from '../../../helpers/l10n'; import { getCreateProjectModeLocation } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { AlmKeys } from '../../../types/alm-settings'; import { AppState } from '../../../types/appstate'; import { CreateProjectModes } from './types'; diff --git a/server/sonar-web/src/main/js/apps/create/project/monorepo/MonorepoProjectCreate.tsx b/server/sonar-web/src/main/js/apps/create/project/monorepo/MonorepoProjectCreate.tsx index fa1b4687773..92885d35dba 100644 --- a/server/sonar-web/src/main/js/apps/create/project/monorepo/MonorepoProjectCreate.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/monorepo/MonorepoProjectCreate.tsx @@ -22,11 +22,11 @@ import { BlueGreySeparator, ButtonPrimary, ButtonSecondary } from 'design-system import React, { useEffect, useRef } from 'react'; import { FormattedMessage } from 'react-intl'; import { GroupBase } from 'react-select'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getComponents } from '../../../../api/project-management'; import { useLocation, useRouter } from '../../../../components/hoc/withRouter'; import { LabelValueSelectOption } from '../../../../helpers/search'; import { useProjectBindingsQuery } from '../../../../queries/dop-translation'; -import { throwGlobalError } from '../../../../sonar-aligned/helpers/error'; import { AlmKeys } from '../../../../types/alm-settings'; import { DopSetting } from '../../../../types/dop-translation'; import { ImportProjectParam } from '../CreateProjectPage'; diff --git a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx index 6df91a24fa6..3721dfe716c 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx @@ -33,12 +33,12 @@ import { countBy, flattenDeep, pickBy, sortBy } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { SingleValue } from 'react-select'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { bulkChangeIssues, searchIssueTags } from '../../../api/issues'; import FormattingTips from '../../../components/common/FormattingTips'; import { isTransitionHidden, transitionRequiresComment } from '../../../components/issue/helpers'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { withBranchStatusRefresh } from '../../../queries/branch'; -import { throwGlobalError } from '../../../sonar-aligned/helpers/error'; import { IssueTransition } from '../../../types/issues'; import { Issue, Paging } from '../../../types/types'; import AssigneeSelect from './AssigneeSelect'; diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx index 28840443a67..28dfb7575cc 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx @@ -28,6 +28,8 @@ import { PageContentFontWrapper, } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; import { setIssueAssignee } from '../../../api/issues'; import { updateIssue } from '../../../components/issue/actions'; import IssueActionsBar from '../../../components/issue/components/IssueActionsBar'; @@ -36,8 +38,7 @@ import { isInput, isShortcut } from '../../../helpers/keyboardEventHelpers'; import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate } from '../../../helpers/l10n'; import { getKeyboardShortcutEnabled } from '../../../helpers/preferences'; -import { getComponentIssuesUrl, getPathUrlAsString, getRuleUrl } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; +import { getPathUrlAsString, getRuleUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { IssueActions, IssueType } from '../../../types/issues'; import { Issue, RuleDetails } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx index e3e33e2c654..8d9ba6ee153 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx @@ -35,6 +35,7 @@ import { keyBy, omit, without } from 'lodash'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { listIssues, searchIssues } from '../../../api/issues'; import { getRuleDetails } from '../../../api/rules'; import withComponentContext from '../../../app/components/componentContext/withComponentContext'; @@ -60,7 +61,6 @@ import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { serializeDate } from '../../../helpers/query'; import { withBranchLikes } from '../../../queries/branch'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier, isPortfolioLike, isProject } from '../../../types/component'; import { diff --git a/server/sonar-web/src/main/js/apps/issues/components/TotalEffort.tsx b/server/sonar-web/src/main/js/apps/issues/components/TotalEffort.tsx index 34fc771e667..648838b3204 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/TotalEffort.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/TotalEffort.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; export default function TotalEffort({ effort }: { effort: number }) { return ( diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx index a51ee3debec..1ca660d6544 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx @@ -22,11 +22,11 @@ import classNames from 'classnames'; import { FlagMessage, IssueMessageHighlighting, LineFinding, themeColor } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getSources } from '../../../api/components'; import getCoverageStatus from '../../../components/SourceViewer/helpers/getCoverageStatus'; import { locationsByLine } from '../../../components/SourceViewer/helpers/indexing'; import { translate } from '../../../helpers/l10n'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { isFile } from '../../../types/component'; import { IssueDeprecatedStatus } from '../../../types/issues'; diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx index f212424c609..7045ac78671 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx @@ -22,6 +22,8 @@ import { Spinner } from '@sonarsource/echoes-react'; import { FlagMessage } from 'design-system'; import { findLastIndex, keyBy } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getComponentForSourceViewer, getDuplications, getSources } from '../../../api/components'; import { getIssueFlowSnippets } from '../../../api/issues'; import { SourceViewerContext } from '../../../components/SourceViewer/SourceViewerContext'; @@ -38,8 +40,6 @@ import { import { WorkspaceContext } from '../../../components/workspace/context'; import { translate } from '../../../helpers/l10n'; import { HttpStatus } from '../../../helpers/request'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; -import { throwGlobalError } from '../../../sonar-aligned/helpers/error'; import { BranchLike } from '../../../types/branch-like'; import { isFile } from '../../../types/component'; import { IssueDeprecatedStatus } from '../../../types/issues'; diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/IssueSourceViewerHeader.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/IssueSourceViewerHeader.tsx index 04e71337c92..6b1c96f584c 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/IssueSourceViewerHeader.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/IssueSourceViewerHeader.tsx @@ -32,15 +32,16 @@ import { themeColor, } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery, isBranch } from '~sonar-aligned/helpers/branch-like'; +import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; import { ComponentContext } from '../../../app/components/componentContext/ComponentContext'; import { useCurrentUser } from '../../../app/components/current-user/CurrentUserContext'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; import { isPullRequest } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path'; -import { getBranchLikeUrl, getComponentIssuesUrl } from '../../../helpers/urls'; +import { getBranchLikeUrl } from '../../../helpers/urls'; import { useBranchesQuery } from '../../../queries/branch'; -import { getBranchLikeQuery, isBranch } from '../../../sonar-aligned/helpers/branch-like'; import { ComponentQualifier } from '../../../types/component'; import { SourceViewerFile } from '../../../types/types'; import { isLoggedIn } from '../../../types/users'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx index edd5ace2cd7..a33ce6f4f66 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx @@ -22,12 +22,12 @@ import { BarChart, DateRangePicker, FacetBox, FacetItem, Note } from 'design-sys import { isEmpty, max } from 'lodash'; import * as React from 'react'; import { WrappedComponentProps, injectIntl } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { longFormatterOption } from '../../../components/intl/DateFormatter'; import DateFromNow from '../../../components/intl/DateFromNow'; import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; import { parseDate } from '../../../helpers/dates'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { Component, Dict } from '../../../types/types'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx index 354f678b77d..fe188f13811 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx @@ -20,11 +20,11 @@ import { QualifierIcon } from 'design-system'; import { omit } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getDirectories } from '../../../api/components'; import { translate } from '../../../helpers/l10n'; import { collapsePath } from '../../../helpers/path'; import { highlightTerm } from '../../../helpers/search'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { TreeComponentWithPath } from '../../../types/component'; import { Facet } from '../../../types/issues'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx index e6dd87f1e23..43f6a9ae587 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx @@ -20,12 +20,12 @@ import { QualifierIcon } from 'design-system'; import { omit } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getFiles } from '../../../api/components'; import { translate } from '../../../helpers/l10n'; import { collapsePath, splitPath } from '../../../helpers/path'; import { highlightTerm } from '../../../helpers/search'; import { isDefined } from '../../../helpers/types'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { TreeComponentWithPath } from '../../../types/component'; import { Facet } from '../../../types/issues'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacet.tsx index 36cf186598c..5aff62af9dc 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacet.tsx @@ -20,12 +20,12 @@ import { FacetBox, FacetItem, FlagMessage, InputSearch, Note } from 'design-system'; import { max, sortBy, values, without } from 'lodash'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import ListFooter from '../../../components/controls/ListFooter'; import Tooltip from '../../../components/controls/Tooltip'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { queriesEqual } from '../../../helpers/query'; import { isDefined } from '../../../helpers/types'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { Dict, Paging, RawQuery } from '../../../types/types'; import { FacetItemsList } from './FacetItemsList'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacetFooter.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacetFooter.tsx index 14a054bf641..787a45cc3ae 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacetFooter.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacetFooter.tsx @@ -20,8 +20,8 @@ import { useTheme } from '@emotion/react'; import { DiscreetLink, Theme, themeColor } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; export interface Props { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx index b1907d35798..68d0102e30d 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx @@ -19,10 +19,10 @@ */ import { HelperHintIcon } from 'design-system'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import SoftwareImpactSeverityIcon from '../../../components/icon-mappers/SoftwareImpactSeverityIcon'; import { IMPACT_SEVERITIES } from '../../../helpers/constants'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { SoftwareImpactSeverity } from '../../../types/clean-code-taxonomy'; import { CommonProps, SimpleListStyleFacet } from './SimpleListStyleFacet'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx index 4cc16fa5f83..dac31cacee5 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx @@ -20,10 +20,10 @@ import { BasicSeparator, FlagMessage, Link } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; import { isPullRequest } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; -import { isBranch } from '../../../sonar-aligned/helpers/branch-like'; import { AppState } from '../../../types/appstate'; import { BranchLike } from '../../../types/branch-like'; import { diff --git a/server/sonar-web/src/main/js/apps/issues/utils.ts b/server/sonar-web/src/main/js/apps/issues/utils.ts index 1e0da76fa23..863b73c80fe 100644 --- a/server/sonar-web/src/main/js/apps/issues/utils.ts +++ b/server/sonar-web/src/main/js/apps/issues/utils.ts @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { intersection, isArray, uniq } from 'lodash'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { getUsers } from '../../api/users'; import { DEFAULT_ISSUES_QUERY } from '../../components/shared/utils'; import { @@ -34,7 +35,6 @@ import { } from '../../helpers/query'; import { get, save } from '../../helpers/storage'; import { isDefined } from '../../helpers/types'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { CleanCodeAttributeCategory, SoftwareImpactSeverity, diff --git a/server/sonar-web/src/main/js/apps/marketplace/utils.ts b/server/sonar-web/src/main/js/apps/marketplace/utils.ts index 5570167ab45..bfa98d64ec9 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/utils.ts +++ b/server/sonar-web/src/main/js/apps/marketplace/utils.ts @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { findLastIndex, memoize } from 'lodash'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getInstalledPlugins, getUpdatesPlugins } from '../../api/plugins'; import { cleanQuery, parseAsString, serializeString } from '../../helpers/query'; import { isDefined } from '../../helpers/types'; -import { throwGlobalError } from '../../sonar-aligned/helpers/error'; import { InstalledPlugin, Plugin, Update } from '../../types/plugins'; import { RawQuery } from '../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/AnalysisVariations.tsx b/server/sonar-web/src/main/js/apps/overview/branches/AnalysisVariations.tsx index 6a372a5c18f..2e5b80ad650 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/AnalysisVariations.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/AnalysisVariations.tsx @@ -21,7 +21,7 @@ import styled from '@emotion/styled'; import { TrendDirection, TrendIcon, TrendType, themeColor } from 'design-system'; import React from 'react'; import { FormattedMessage } from 'react-intl'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { AnalysisMeasuresVariations } from '../../../types/project-activity'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/ApplicationLeakPeriodInfo.tsx b/server/sonar-web/src/main/js/apps/overview/branches/ApplicationLeakPeriodInfo.tsx index 7f7ef16ebcd..1e8e5359a86 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/ApplicationLeakPeriodInfo.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/ApplicationLeakPeriodInfo.tsx @@ -19,9 +19,9 @@ */ import { HelperHintIcon } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import DateFromNow from '../../../components/intl/DateFromNow'; import { translateWithParameters } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { ApplicationPeriod } from '../../../types/application'; export interface ApplicationLeakPeriodInfoProps { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/ApplicationNonCaycProjectWarning.tsx b/server/sonar-web/src/main/js/apps/overview/branches/ApplicationNonCaycProjectWarning.tsx index 9f305cb70dd..3ac624b1b81 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/ApplicationNonCaycProjectWarning.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/ApplicationNonCaycProjectWarning.tsx @@ -19,10 +19,10 @@ */ import { Card, FlagMessage, Link } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { useDocUrl } from '../../../helpers/docs'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getProjectQueryUrl } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { QualityGateStatus } from '../../../types/quality-gates'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx b/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx index f3df27076ac..053293a9a59 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx @@ -20,11 +20,11 @@ import { SeparatorCircleIcon } from 'design-system'; import React from 'react'; import { useIntl } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { getCurrentPage } from '../../../app/components/nav/component/utils'; import ComponentReportActions from '../../../components/controls/ComponentReportActions'; import HomePageSelect from '../../../components/controls/HomePageSelect'; import { findMeasure } from '../../../helpers/measures'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { Branch } from '../../../types/branch-like'; import { MetricKey, MetricType } from '../../../types/metrics'; import { Component, MeasureEnhanced } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx index 587891faa43..c8a0b727b6e 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx @@ -19,6 +19,7 @@ */ import { sortBy, uniq } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery, isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { getApplicationDetails, getApplicationLeak } from '../../../api/application'; import { getMeasuresWithPeriodAndMetrics } from '../../../api/measures'; import { getProjectActivity } from '../../../api/projectActivity'; @@ -42,7 +43,6 @@ import { extractStatusConditionsFromProjectStatus, } from '../../../helpers/qualityGates'; import { isDefined } from '../../../helpers/types'; -import { getBranchLikeQuery, isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { ApplicationPeriod } from '../../../types/application'; import { Branch, BranchLike } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx index 3bda1c17337..cae55e0304f 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx @@ -22,11 +22,11 @@ import { Link } from '@sonarsource/echoes-react'; import { Note, getTabPanelId } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import DocumentationLink from '../../../components/common/DocumentationLink'; import { Image } from '../../../components/common/Image'; import { translate } from '../../../helpers/l10n'; import { CodeScope, queryToSearch } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { Branch } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; import { NewCodeDefinitionType } from '../../../types/new-code-definition'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx index 3bf4823d83f..0b5dfd81be2 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx @@ -32,16 +32,16 @@ import { } from 'design-system'; import React from 'react'; import { useIntl } from 'react-intl'; -import { getLeakValue } from '../../../components/measure/utils'; -import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; -import { findMeasure, formatRating } from '../../../helpers/measures'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { - CodeScope, getComponentIssuesUrl, getComponentSecurityHotspotsUrl, -} from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; +} from '~sonar-aligned/helpers/urls'; +import { getLeakValue } from '../../../components/measure/utils'; +import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; +import { findMeasure, formatRating } from '../../../helpers/measures'; +import { CodeScope } from '../../../helpers/urls'; import { Branch } from '../../../types/branch-like'; import { isApplication } from '../../../types/component'; import { IssueStatus } from '../../../types/issues'; @@ -172,9 +172,8 @@ export default function NewCodeMeasuresPanel(props: Readonly<Props>) { ? 'issue.type.SECURITY_HOTSPOT' : 'issue.type.SECURITY_HOTSPOT.plural' } - url={getComponentSecurityHotspotsUrl(component.key, { + url={getComponentSecurityHotspotsUrl(component.key, branch, { inNewCodePeriod: 'true', - ...getBranchLikeQuery(branch), })} value={newSecurityHotspots} metric={MetricKey.new_security_hotspots} diff --git a/server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx b/server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx index 87b684ac607..04a9e2d79ae 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx @@ -19,9 +19,9 @@ */ import { FlagMessage } from 'design-system'; import * as React from 'react'; +import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { getBranchLikeDisplayName } from '../../../helpers/branch-like'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx index e803855e937..a888c3eec49 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx @@ -26,14 +26,14 @@ import { } from 'design-system'; import * as React from 'react'; import { useIntl } from 'react-intl'; -import { findMeasure, formatRating } from '../../../helpers/measures'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { - CodeScope, getComponentIssuesUrl, getComponentSecurityHotspotsUrl, -} from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; +} from '~sonar-aligned/helpers/urls'; +import { findMeasure, formatRating } from '../../../helpers/measures'; +import { CodeScope } from '../../../helpers/urls'; import { Branch } from '../../../types/branch-like'; import { SoftwareQuality } from '../../../types/clean-code-taxonomy'; import { isApplication } from '../../../types/component'; @@ -129,9 +129,7 @@ export default function OverallCodeMeasuresPanel(props: Readonly<OverallCodeMeas ? 'issue.type.SECURITY_HOTSPOT' : 'issue.type.SECURITY_HOTSPOT.plural' } - url={getComponentSecurityHotspotsUrl(component.key, { - ...getBranchLikeQuery(branch), - })} + url={getComponentSecurityHotspotsUrl(component.key, branch)} value={securityHotspots} metric={MetricKey.security_hotspots} conditions={conditions} diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx index 182b19781c6..96d5bd9e22d 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx @@ -20,6 +20,12 @@ import { LinkBox, TextMuted } from 'design-system'; import * as React from 'react'; import { Path } from 'react-router-dom'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { + getComponentIssuesUrl, + getComponentSecurityHotspotsUrl, +} from '~sonar-aligned/helpers/urls'; import IssueTypeIcon from '../../../components/icon-mappers/IssueTypeIcon'; import MeasureIndicator from '../../../components/measure/MeasureIndicator'; import { @@ -30,13 +36,7 @@ import { import { translate } from '../../../helpers/l10n'; import { isDiffMetric, localizeMetric } from '../../../helpers/measures'; import { getOperatorLabel } from '../../../helpers/qualityGates'; -import { - getComponentDrilldownUrl, - getComponentIssuesUrl, - getComponentSecurityHotspotsUrl, -} from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; +import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { IssueType } from '../../../types/issues'; import { MetricKey, MetricType } from '../../../types/metrics'; @@ -64,13 +64,11 @@ export default class QualityGateCondition extends React.PureComponent<Props> { }; getUrlForSecurityHotspot(inNewCodePeriod: boolean) { - const query: Dict<string | undefined> = { - ...getBranchLikeQuery(this.props.branchLike), - }; - if (inNewCodePeriod) { - Object.assign(query, { inNewCodePeriod: 'true' }); - } - return getComponentSecurityHotspotsUrl(this.props.component.key, query); + return getComponentSecurityHotspotsUrl( + this.props.component.key, + this.props.branchLike, + inNewCodePeriod ? { inNewCodePeriod: 'true' } : {}, + ); } getUrlForCodeSmells(inNewCodePeriod: boolean) { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx index e31e94ea4ee..97008214a91 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx @@ -19,12 +19,12 @@ */ import { Highlight, LinkBox } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; import { propsToIssueParams } from '../../../components/shared/utils'; import { translate } from '../../../helpers/l10n'; import { isDiffMetric, localizeMetric } from '../../../helpers/measures'; -import { getComponentIssuesUrl } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateStatusTitle.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateStatusTitle.tsx index 481531aad96..e8328b75b20 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateStatusTitle.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateStatusTitle.tsx @@ -19,8 +19,8 @@ */ import { HelperHintIcon, LightGreyCardTitle, PageTitle } from 'design-system'; import React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; export function QualityGateStatusTitle() { return ( diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureBreakdownCard.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureBreakdownCard.tsx index 0f3620e3d90..0e3de3af596 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureBreakdownCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureBreakdownCard.tsx @@ -22,9 +22,9 @@ import classNames from 'classnames'; import { DiscreetLinkBox, Tooltip, themeColor, themeContrast } from 'design-system'; import * as React from 'react'; import { useIntl } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; -import { getComponentIssuesUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { Branch } from '../../../types/branch-like'; import { SoftwareImpactSeverity, SoftwareQuality } from '../../../types/clean-code-taxonomy'; import { MetricType } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx index 40814c2a15e..09767f1ab1f 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx @@ -22,6 +22,8 @@ import { LinkHighlight, LinkStandalone } from '@sonarsource/echoes-react'; import { Badge, LightGreyCard, LightGreyCardTitle, TextBold, TextSubdued } from 'design-system'; import * as React from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; import Tooltip from '../../../components/controls/Tooltip'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; import { @@ -29,8 +31,6 @@ import { getIssueTypeBySoftwareQuality, } from '../../../helpers/issues'; import { isDefined } from '../../../helpers/types'; -import { getComponentIssuesUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { Branch } from '../../../types/branch-like'; import { SoftwareImpactMeasureData, diff --git a/server/sonar-web/src/main/js/apps/overview/components/AnalysisErrorMessage.tsx b/server/sonar-web/src/main/js/apps/overview/components/AnalysisErrorMessage.tsx index 6f843b731b6..a7e43540abe 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/AnalysisErrorMessage.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/AnalysisErrorMessage.tsx @@ -21,11 +21,11 @@ import { Link } from 'design-system'; import React from 'react'; import { FormattedMessage } from 'react-intl'; import { useLocation } from 'react-router-dom'; +import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { isPullRequest } from '../../../helpers/branch-like'; import { hasMessage, translate } from '../../../helpers/l10n'; import { getComponentBackgroundTaskUrl } from '../../../helpers/urls'; import { useBranchesQuery } from '../../../queries/branch'; -import { isBranch, isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { Task } from '../../../types/tasks'; import { Component } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx index 585df52db9f..754e63e09d6 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx @@ -21,6 +21,7 @@ import { FlagMessage, LargeCenteredLayout, PageContentFontWrapper, Spinner } from 'design-system'; import * as React from 'react'; import { Navigate } from 'react-router-dom'; +import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { getScannableProjects } from '../../../api/components'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; import { getBranchLikeDisplayName } from '../../../helpers/branch-like'; @@ -28,7 +29,6 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getProjectTutorialLocation } from '../../../helpers/urls'; import { hasGlobalPermission } from '../../../helpers/users'; import { useTaskForComponentQuery } from '../../../queries/component'; -import { isBranch, isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { ComponentQualifier } from '../../../types/component'; import { Permissions } from '../../../types/permissions'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/IgnoredConditionWarning.tsx b/server/sonar-web/src/main/js/apps/overview/components/IgnoredConditionWarning.tsx index 56fd70b6516..c9cc1e9fea0 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/IgnoredConditionWarning.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/IgnoredConditionWarning.tsx @@ -19,8 +19,8 @@ */ import { FlagMessage, HelperHintIcon } from 'design-system'; import React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; export default function IgnoredConditionWarning() { return ( diff --git a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardNumber.tsx b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardNumber.tsx index 7d186fe1fd6..c8629cdcd8b 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardNumber.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardNumber.tsx @@ -21,7 +21,7 @@ import { LightLabel, TextError } from 'design-system'; import * as React from 'react'; import { useIntl } from 'react-intl'; import { To } from 'react-router-dom'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Status, getConditionRequiredLabel } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardPercent.tsx b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardPercent.tsx index 4875e5a0788..8f86c1c487b 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardPercent.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardPercent.tsx @@ -28,11 +28,11 @@ import { import * as React from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import { To } from 'react-router-dom'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { duplicationRatingConverter, getLeakValue } from '../../../components/measure/utils'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { findMeasure, localizeMetric } from '../../../helpers/measures'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGate.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGate.tsx index 45315610a8a..f2de2bdbcc3 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGate.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGate.tsx @@ -20,7 +20,7 @@ import { HelperHintIcon, LightPrimary, QualityGateIndicator, TextMuted } from 'design-system'; import React from 'react'; import { useIntl } from 'react-intl'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { BranchLike } from '../../../types/branch-like'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component, Status } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx index f2586295e7e..b8efbefac42 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx @@ -21,6 +21,12 @@ import styled from '@emotion/styled'; import { Badge, ButtonSecondary, themeBorder, themeColor } from 'design-system'; import React from 'react'; import { useIntl } from 'react-intl'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { + getComponentIssuesUrl, + getComponentSecurityHotspotsUrl, +} from '~sonar-aligned/helpers/urls'; import { DEFAULT_ISSUES_QUERY, isIssueMeasure, @@ -28,13 +34,7 @@ import { } from '../../../components/shared/utils'; import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; import { getShortType, isDiffMetric } from '../../../helpers/measures'; -import { - getComponentDrilldownUrl, - getComponentIssuesUrl, - getComponentSecurityHotspotsUrl, -} from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; +import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { IssueType } from '../../../types/issues'; import { MetricType } from '../../../types/metrics'; @@ -182,8 +182,7 @@ function getQGConditionUrl( if (ratingIssueType) { if (ratingIssueType === IssueType.SecurityHotspot) { - return getComponentSecurityHotspotsUrl(componentKey, { - ...getBranchLikeQuery(branchLike), + return getComponentSecurityHotspotsUrl(componentKey, branchLike, { ...(sinceLeakPeriod ? { sinceLeakPeriod: 'true' } : {}), }); } diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx index 613c243c5d4..3d44d54c7ed 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx @@ -33,12 +33,12 @@ import { } from 'design-system'; import * as React from 'react'; import { useIntl } from 'react-intl'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; import { getLeakValue } from '../../../components/measure/utils'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; import { findMeasure } from '../../../helpers/measures'; -import { getComponentIssuesUrl } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { PullRequest } from '../../../types/branch-like'; import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx index ec42bcb0ce0..d2119340bc2 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx @@ -19,10 +19,10 @@ */ import classNames from 'classnames'; import * as React from 'react'; +import { getComponentSecurityHotspotsUrl } from '~sonar-aligned/helpers/urls'; import { getLeakValue } from '../../../components/measure/utils'; import { findMeasure } from '../../../helpers/measures'; -import { getComponentDrilldownUrl, getComponentSecurityHotspotsUrl } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; +import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { PullRequest } from '../../../types/branch-like'; import { MetricKey } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; @@ -83,9 +83,7 @@ export default function MeasuresCardPanel(props: React.PropsWithChildren<Props>) ? 'issue.type.SECURITY_HOTSPOT' : 'issue.type.SECURITY_HOTSPOT.plural' } - url={getComponentSecurityHotspotsUrl(component.key, { - ...getBranchLikeQuery(pullRequest), - })} + url={getComponentSecurityHotspotsUrl(component.key, pullRequest)} value={newSecurityHotspots} metric={MetricKey.new_security_hotspots} conditions={conditions} diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestMetaTopBar.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestMetaTopBar.tsx index aae9b023155..1a248f65983 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestMetaTopBar.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestMetaTopBar.tsx @@ -20,10 +20,10 @@ import { SeparatorCircleIcon } from 'design-system'; import React from 'react'; import { useIntl } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import CurrentBranchLikeMergeInformation from '../../../app/components/nav/component/branch-like/CurrentBranchLikeMergeInformation'; import { getLeakValue } from '../../../components/measure/utils'; import { findMeasure } from '../../../helpers/measures'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { PullRequest } from '../../../types/branch-like'; import { MetricKey, MetricType } from '../../../types/metrics'; import { MeasureEnhanced } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx index f773f5abc5d..adf3fc71408 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx @@ -20,12 +20,12 @@ import { BasicSeparator, CenteredLayout, PageContentFontWrapper, Spinner } from 'design-system'; import { uniq } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { enhanceConditionWithMeasure, enhanceMeasuresWithMetrics } from '../../../helpers/measures'; import { isDefined } from '../../../helpers/types'; import { useBranchStatusQuery } from '../../../queries/branch'; import { useComponentMeasuresWithMetricsQuery } from '../../../queries/component'; import { useComponentQualityGateQuery } from '../../../queries/quality-gates'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { PullRequest } from '../../../types/branch-like'; import { Component } from '../../../types/types'; import { AnalysisStatus } from '../components/AnalysisStatus'; diff --git a/server/sonar-web/src/main/js/apps/overview/utils.tsx b/server/sonar-web/src/main/js/apps/overview/utils.tsx index eb0c2112807..fb824c69b06 100644 --- a/server/sonar-web/src/main/js/apps/overview/utils.tsx +++ b/server/sonar-web/src/main/js/apps/overview/utils.tsx @@ -20,10 +20,10 @@ import { memoize } from 'lodash'; import React from 'react'; import { IntlShape } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { ISSUETYPE_METRIC_KEYS_MAP } from '../../helpers/issues'; import { translate } from '../../helpers/l10n'; import { parseAsString } from '../../helpers/query'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { SoftwareQuality } from '../../types/clean-code-taxonomy'; import { IssueType } from '../../types/issues'; import { MetricKey, MetricType } from '../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Header.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/Header.tsx index 603ef9fbd44..c085f194ea6 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Header.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Header.tsx @@ -19,11 +19,11 @@ */ import { ButtonPrimary, FlagMessage, Spinner, Title } from 'design-system'; import React, { useState } from 'react'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { createPermissionTemplate } from '../../../api/permissions'; import { Router, withRouter } from '../../../components/hoc/withRouter'; import { translate } from '../../../helpers/l10n'; import { useGithubProvisioningEnabledQuery } from '../../../queries/identity-provider/github'; -import { throwGlobalError } from '../../../sonar-aligned/helpers/error'; import { PERMISSION_TEMPLATES_PATH } from '../utils'; import Form from './Form'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx index ce6891f530a..ecfa5dbf88a 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.tsx @@ -19,9 +19,9 @@ */ import { ContentCell, FlagMessage, HelperHintIcon, TableRow } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import InstanceMessage from '../../../components/common/InstanceMessage'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { Permission } from '../../../types/types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/PermissionCell.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/PermissionCell.tsx index aaad8c6b7b3..7f42e8834a3 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/PermissionCell.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/PermissionCell.tsx @@ -19,8 +19,8 @@ */ import { ContentCell, HelperHintIcon } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; interface Props { permission: { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx index 1a8801c8c99..bce7c1cc2d8 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { useComponent, useTopLevelComponentKey, @@ -35,7 +36,6 @@ import useApplicationLeakQuery from '../../../queries/applications'; import { useBranchesQuery } from '../../../queries/branch'; import { useAllMeasuresHistoryQuery } from '../../../queries/measures'; import { useAllProjectAnalysesQuery } from '../../../queries/project-analyses'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { isApplication, isPortfolioLike, isProject } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; import { MeasureHistory, ParsedAnalysis } from '../../../types/project-activity'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx index bdf0ab3bce7..68c26e48d05 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx @@ -27,12 +27,12 @@ import { TableRowInteractive, } from 'design-system'; import * as React from 'react'; +import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; import QualityGateStatus from '../../../app/components/nav/component/branch-like/QualityGateStatus'; import BranchLikeIcon from '../../../components/icon-mappers/BranchLikeIcon'; import DateFromNow from '../../../components/intl/DateFromNow'; import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branch-like'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { isBranch, isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { Component } from '../../../types/types'; import BranchPurgeSetting from './BranchPurgeSetting'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx index 20f766a3620..8f838a058f9 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx @@ -19,9 +19,9 @@ */ import { ActionCell, ContentCell, HelperHintIcon, Table, TableRow } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { getBranchLikeKey } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { BranchLike } from '../../../types/branch-like'; import { Component } from '../../../types/types'; import BranchLikeRow from './BranchLikeRow'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx index c3f68f998e1..603fb4ab9e2 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx @@ -22,10 +22,10 @@ import { IconGitBranch, IconPullrequest } from '@sonarsource/echoes-react'; import { ToggleButton, getTabId, getTabPanelId } from 'design-system'; import * as React from 'react'; import { useState } from 'react'; +import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { isPullRequest, sortBranches, sortPullRequests } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { useBranchesQuery } from '../../../queries/branch'; -import { isBranch, isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { Branch, BranchLike, PullRequest } from '../../../types/branch-like'; import { Component } from '../../../types/types'; import BranchLikeTable from './BranchLikeTable'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx index b2787265400..2d90f763bab 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx @@ -20,10 +20,10 @@ import { HelperHintIcon, Spinner, Switch } from 'design-system'; import * as React from 'react'; import { useEffect } from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; +import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { useExcludeFromPurgeMutation } from '../../../queries/branch'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; -import { isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { Branch } from '../../../types/branch-like'; import { Component } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/LifetimeInformationRenderer.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/LifetimeInformationRenderer.tsx index 566a9332e3f..2f902d4e4f5 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/LifetimeInformationRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/LifetimeInformationRenderer.tsx @@ -20,8 +20,8 @@ import { Link, Spinner } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; export interface LifetimeInformationRendererProps { branchAndPullRequestLifeTimeInDays?: string; diff --git a/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx b/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx index fedbd54ef0e..5b30997db41 100644 --- a/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx @@ -26,6 +26,7 @@ import { } from 'design-system'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getActivity } from '../../api/ce'; import { getStatus } from '../../api/project-dump'; import withAvailableFeatures, { @@ -33,7 +34,6 @@ import withAvailableFeatures, { } from '../../app/components/available-features/withAvailableFeatures'; import withComponentContext from '../../app/components/componentContext/withComponentContext'; import { translate } from '../../helpers/l10n'; -import { throwGlobalError } from '../../sonar-aligned/helpers/error'; import { Feature } from '../../types/features'; import { DumpStatus, DumpTask } from '../../types/project-dump'; import { ActivityRequestParameters, TaskStatuses, TaskTypes } from '../../types/tasks'; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaKey.tsx b/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaKey.tsx index 7eb6b2adf69..d1af8cf829b 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaKey.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaKey.tsx @@ -19,8 +19,8 @@ */ import { ClipboardIconButton, CodeSnippet, HelperHintIcon, SubHeading } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../../helpers/l10n'; -import HelpTooltip from '../../../../sonar-aligned/components/controls/HelpTooltip'; interface MetaKeyProps { componentKey: string; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaSize.tsx b/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaSize.tsx index 3172136ad9c..4e51c7275b8 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaSize.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaSize.tsx @@ -19,10 +19,10 @@ */ import { DrilldownLink, Note, SizeIndicator, SubHeading } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { localizeMetric } from '../../../../helpers/measures'; import { getComponentDrilldownUrl } from '../../../../helpers/urls'; -import { formatMeasure } from '../../../../sonar-aligned/helpers/measures'; import { ComponentQualifier } from '../../../../types/component'; import { MetricKey, MetricType } from '../../../../types/metrics'; import { Component, Measure } from '../../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx b/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx index bc0b86a8e3d..7ff2e3f1099 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx @@ -33,6 +33,7 @@ import { import { isEmpty } from 'lodash'; import * as React from 'react'; import { useState } from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { Image } from '../../../components/common/Image'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { localizeMetric } from '../../../helpers/measures'; @@ -42,7 +43,6 @@ import { useBadgeTokenQuery, useRenewBagdeTokenMutation, } from '../../../queries/badges'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { MetricKey } from '../../../types/metrics'; import { Component } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx b/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx index 63a35ddea27..24729625d74 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx @@ -29,13 +29,13 @@ import { isEmpty, orderBy } from 'lodash'; import * as React from 'react'; import { useState } from 'react'; import { FormattedMessage } from 'react-intl'; +import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { getBranches } from '../../../api/branches'; import { getRegulatoryReportUrl } from '../../../api/regulatory-report'; import DocumentationLink from '../../../components/common/DocumentationLink'; import { getBranchLikeDisplayName, getBranchLikeKey } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { LabelValueSelectOption } from '../../../helpers/search'; -import { isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { Component } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projectNewCode/components/BranchList.tsx b/server/sonar-web/src/main/js/apps/projectNewCode/components/BranchList.tsx index e47aead27ed..0dfeac5cc3a 100644 --- a/server/sonar-web/src/main/js/apps/projectNewCode/components/BranchList.tsx +++ b/server/sonar-web/src/main/js/apps/projectNewCode/components/BranchList.tsx @@ -19,6 +19,7 @@ */ import { ActionCell, ContentCell, Spinner, Table, TableRow } from 'design-system'; import * as React from 'react'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import { listBranchesNewCodeDefinition, resetNewCodeDefinition, @@ -31,7 +32,6 @@ import { import { sortBranches } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { DEFAULT_NEW_CODE_DEFINITION_TYPE } from '../../../helpers/new-code-definition'; -import { isBranch } from '../../../sonar-aligned/helpers/branch-like'; import { Branch, BranchLike, BranchWithNewCodePeriod } from '../../../types/branch-like'; import { NewCodeDefinition } from '../../../types/new-code-definition'; import { Component } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx b/server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx index 21acdf82d5f..8905321c0c8 100644 --- a/server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx @@ -21,6 +21,7 @@ import { HeadingDark, LargeCenteredLayout, PageContentFontWrapper, Spinner } from 'design-system'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { Helmet } from 'react-helmet-async'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; import withAvailableFeatures, { WithAvailableFeaturesProps, @@ -38,7 +39,6 @@ import { useNewCodeDefinitionMutation, useNewCodeDefinitionQuery, } from '../../../queries/newCodeDefinition'; -import { isBranch } from '../../../sonar-aligned/helpers/branch-like'; import { AppState } from '../../../types/appstate'; import { Branch, BranchLike } from '../../../types/branch-like'; import { Feature } from '../../../types/features'; diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx index 208a0e3ba22..00ffe5de36a 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityGate/ProjectQualityGateAppRenderer.tsx @@ -35,6 +35,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; import { OptionProps, components } from 'react-select'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import A11ySkipTarget from '../../components/a11y/A11ySkipTarget'; import DisableableSelectOption from '../../components/common/DisableableSelectOption'; import Suggestions from '../../components/embed-docs-modal/Suggestions'; @@ -42,7 +43,6 @@ import { translate } from '../../helpers/l10n'; import { isDiffMetric } from '../../helpers/measures'; import { LabelValueSelectOption } from '../../helpers/search'; import { getQualityGateUrl } from '../../helpers/urls'; -import HelpTooltip from '../../sonar-aligned/components/controls/HelpTooltip'; import { QualityGate } from '../../types/types'; import BuiltInQualityGateBadge from '../quality-gates/components/BuiltInQualityGateBadge'; import { USE_SYSTEM_DEFAULT } from './constants'; diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx index 791fbddc4aa..b4aba107c42 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/ProjectQualityProfilesAppRenderer.tsx @@ -36,12 +36,12 @@ import { import { groupBy, orderBy } from 'lodash'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { Profile } from '../../api/quality-profiles'; import A11ySkipTarget from '../../components/a11y/A11ySkipTarget'; import Suggestions from '../../components/embed-docs-modal/Suggestions'; import { translate } from '../../helpers/l10n'; import { getRulesUrl } from '../../helpers/urls'; -import HelpTooltip from '../../sonar-aligned/components/controls/HelpTooltip'; import { Component } from '../../types/types'; import BuiltInQualityProfileBadge from '../quality-profiles/components/BuiltInQualityProfileBadge'; import AddLanguageModal from './components/AddLanguageModal'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx b/server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx index 0c75e64d555..e3787b1a6e2 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ApplicationCreation.tsx @@ -19,6 +19,7 @@ */ import { ButtonSecondary } from 'design-system'; import * as React from 'react'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getComponentNavigation } from '../../../api/navigation'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; @@ -27,7 +28,6 @@ import { Router, withRouter } from '../../../components/hoc/withRouter'; import { translate } from '../../../helpers/l10n'; import { getComponentAdminUrl, getComponentOverviewUrl } from '../../../helpers/urls'; import { hasGlobalPermission } from '../../../helpers/users'; -import { throwGlobalError } from '../../../sonar-aligned/helpers/error'; import { AppState } from '../../../types/appstate'; import { ComponentQualifier } from '../../../types/component'; import { Permissions } from '../../../types/permissions'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx index 71896a62567..cb188571bf0 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx @@ -37,6 +37,7 @@ import { import { isEmpty } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import Favorite from '../../../../components/controls/Favorite'; import Tooltip from '../../../../components/controls/Tooltip'; import DateFromNow from '../../../../components/intl/DateFromNow'; @@ -45,7 +46,6 @@ import Measure from '../../../../components/measure/Measure'; import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { isDefined } from '../../../../helpers/types'; import { getProjectUrl } from '../../../../helpers/urls'; -import { formatMeasure } from '../../../../sonar-aligned/helpers/measures'; import { ComponentQualifier } from '../../../../types/component'; import { MetricKey, MetricType } from '../../../../types/metrics'; import { Status } from '../../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx index 88fdd770958..43eae115217 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.tsx @@ -20,9 +20,9 @@ import { FacetBox, FacetItem, HelperHintIcon, QualityGateIndicator } from 'design-system'; import { without } from 'lodash'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; import { isDefined } from '../../../helpers/types'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { RawQuery, Status } from '../../../types/types'; import { FacetItemsList } from '../../issues/sidebar/FacetItemsList'; import { formatFacetStat } from '../../issues/utils'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/RatingFacet.tsx b/server/sonar-web/src/main/js/apps/projects/filters/RatingFacet.tsx index f33656bbd5f..9fd89a2fb4d 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/RatingFacet.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/RatingFacet.tsx @@ -19,8 +19,8 @@ */ import { MetricsRatingBadge, RatingEnum } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { RawQuery } from '../../../types/types'; import { Facet } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx index b84363490de..99f97f9221a 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx @@ -19,8 +19,8 @@ */ import { MetricsRatingBadge, RatingEnum } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { Dict, RawQuery } from '../../../types/types'; import { Facet } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectManagementApp.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectManagementApp.tsx index 5500ba6eada..ae10d3abb8c 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectManagementApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectManagementApp.tsx @@ -21,6 +21,7 @@ import { LargeCenteredLayout, PageContentFontWrapper } from 'design-system'; import { debounce, uniq } from 'lodash'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { Project, changeProjectDefaultVisibility, @@ -33,7 +34,6 @@ import Suggestions from '../../components/embed-docs-modal/Suggestions'; import { toShortISO8601String } from '../../helpers/dates'; import { translate } from '../../helpers/l10n'; import { hasGlobalPermission } from '../../helpers/users'; -import { throwGlobalError } from '../../sonar-aligned/helpers/error'; import { Visibility } from '../../types/component'; import { Permissions } from '../../types/permissions'; import { SettingsKey } from '../../types/settings'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx index 6052dafce1b..75979d7907a 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRowActions.tsx @@ -19,12 +19,12 @@ */ import { ActionsDropdown, ItemButton, ItemLink, PopupZLevel, Spinner } from 'design-system'; import React, { useState } from 'react'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getComponentNavigation } from '../../api/navigation'; import { Project } from '../../api/project-management'; import { translate, translateWithParameters } from '../../helpers/l10n'; import { getComponentPermissionsUrl } from '../../helpers/urls'; import { useGithubProvisioningEnabledQuery } from '../../queries/identity-provider/github'; -import { throwGlobalError } from '../../sonar-aligned/helpers/error'; import { LoggedInUser } from '../../types/users'; import ApplyTemplate from '../permissions/project/components/ApplyTemplate'; import RestoreAccessModal from './RestoreAccessModal'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx index e13d7e2a77d..4d4b1a230eb 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx @@ -31,11 +31,11 @@ import { import { sortBy } from 'lodash'; import * as React from 'react'; import { OptionProps, SingleValueProps, components } from 'react-select'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { Project } from '../../api/project-management'; import withAppStateContext from '../../app/components/app-state/withAppStateContext'; import { translate } from '../../helpers/l10n'; import { LabelValueSelectOption } from '../../helpers/search'; -import HelpTooltip from '../../sonar-aligned/components/controls/HelpTooltip'; import { AppState } from '../../types/appstate'; import { Visibility } from '../../types/component'; import BulkApplyTemplateModal from './BulkApplyTemplateModal'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/CaycCondition.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/CaycCondition.tsx index ad7f681dfb3..f4e083e8cd3 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/CaycCondition.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/CaycCondition.tsx @@ -21,10 +21,10 @@ import styled from '@emotion/styled'; import { HelperHintIcon, Highlight } from 'design-system'; import React from 'react'; import { FormattedMessage } from 'react-intl'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import withMetricsContext from '../../../app/components/metrics/withMetricsContext'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricKey } from '../../../types/metrics'; import { Condition, Dict, Metric } from '../../../types/types'; import { getCaycConditionMetadata, getLocalizedMetricNameNoDiffMetric } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValue.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValue.tsx index 703830027cc..e01c9af0805 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValue.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValue.tsx @@ -21,7 +21,7 @@ import styled from '@emotion/styled'; import classNames from 'classnames'; import { themeColor } from 'design-system'; import * as React from 'react'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { Condition, Metric } from '../../../types/types'; import { getCorrectCaycCondition } from '../utils'; import ConditionValueDescription from './ConditionValueDescription'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValueDescription.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValueDescription.tsx index e03131227e3..77a22d47fd1 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValueDescription.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValueDescription.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricKey } from '../../../types/metrics'; import { Condition, Metric } from '../../../types/types'; import { GreenColorText } from './ConditionValue'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx index d5323fb8bf5..4d5d1252b38 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx @@ -33,13 +33,13 @@ import { import { differenceWith, map, uniqBy } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { useAvailableFeatures } from '../../../app/components/available-features/withAvailableFeatures'; import { useMetrics } from '../../../app/components/metrics/withMetricsContext'; import DocumentationLink from '../../../components/common/DocumentationLink'; import ModalButton, { ModalProps } from '../../../components/controls/ModalButton'; import { useDocUrl } from '../../../helpers/docs'; import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { Feature } from '../../../types/features'; import { MetricKey } from '../../../types/metrics'; import { CaycStatus, Condition as ConditionType, QualityGate } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx index 736d86f8b60..2e371a1cd9e 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx @@ -19,8 +19,8 @@ */ import { FlagMessage, HelperHintIcon, SubTitle } from 'design-system'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { QualityGate } from '../../../types/types'; import Conditions from './Conditions'; import Projects from './Projects'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx index b7ee1f61cee..54458ab50d5 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx @@ -19,9 +19,9 @@ */ import { ButtonPrimary, HelperHintIcon, Title } from 'design-system'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import ModalButton, { ModalProps } from '../../../components/controls/ModalButton'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import CreateQualityGateForm from './CreateQualityGateForm'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx index 4e2a832175e..2ee069e3340 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx @@ -31,12 +31,12 @@ import { import { keyBy } from 'lodash'; import * as React from 'react'; import { useEffect, useState } from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { getQualityProfile } from '../../../api/quality-profiles'; import { searchRules } from '../../../api/rules'; import { translate } from '../../../helpers/l10n'; import { isDefined } from '../../../helpers/types'; import { getRulesUrl } from '../../../helpers/urls'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { CleanCodeAttributeCategory, SoftwareQuality } from '../../../types/clean-code-taxonomy'; import { SearchRulesResponse } from '../../../types/coding-rules'; import { RulesFacetName } from '../../../types/rules'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx index 19d831e5749..8cc2906e42e 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesDeprecatedWarning.tsx @@ -20,9 +20,9 @@ import { FlagMessage, HelperHintIcon, Link } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; import { getDeprecatedActiveRulesUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; interface Props { activeDeprecatedRules: number; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRow.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRow.tsx index c9a9bd316a5..9fd13ab2f10 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRow.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRow.tsx @@ -19,10 +19,10 @@ */ import { ContentCell, Link, Note, NumericalCell, TableRow } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translateWithParameters } from '../../../helpers/l10n'; import { isDefined } from '../../../helpers/types'; import { getRulesUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { RulesFacetName } from '../../../types/rules'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesSonarWayComparison.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesSonarWayComparison.tsx index 762d3f8228b..38951ce78b7 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesSonarWayComparison.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesSonarWayComparison.tsx @@ -20,9 +20,9 @@ import { FlagMessage, Link } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; interface Props { language: string; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx index 5db04574648..4cdcd65ede0 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx @@ -21,11 +21,11 @@ import { DiscreetLink, Link, Note } from 'design-system'; import { noop, sortBy } from 'lodash'; import * as React from 'react'; import { useIntl } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { listRules } from '../../../api/rules'; import { toShortISO8601String } from '../../../helpers/dates'; import { translateWithParameters } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { MetricType } from '../../../types/metrics'; import { Rule, RuleActivation } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx index 11ce798c9f1..3ca9f75f082 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx @@ -21,7 +21,7 @@ import { ContentCell, FlagMessage, HelperHintIcon, Table, TableRow } from 'desig import { groupBy, pick, sortBy } from 'lodash'; import * as React from 'react'; import { useIntl } from 'react-intl'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { Language } from '../../../types/languages'; import { Dict } from '../../../types/types'; import { Profile } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx index c2c23eac0af..c0ab9f2e220 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx @@ -20,6 +20,7 @@ import { flatMap, range } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getMeasures } from '../../api/measures'; import { getSecurityHotspotList, getSecurityHotspots } from '../../api/security-hotspots'; import withComponentContext from '../../app/components/componentContext/withComponentContext'; @@ -32,7 +33,6 @@ import { isInput } from '../../helpers/keyboardEventHelpers'; import { KeyboardKeys } from '../../helpers/keycodes'; import { getStandards } from '../../helpers/security-standard'; import { withBranchLikes } from '../../queries/branch'; -import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { MetricKey } from '../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx index 8bafc990a3d..4cd77d139e3 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx @@ -31,11 +31,11 @@ import { } from 'design-system'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import A11ySkipTarget from '../../components/a11y/A11ySkipTarget'; import Suggestions from '../../components/embed-docs-modal/Suggestions'; import { translate } from '../../helpers/l10n'; import useFollowScroll from '../../hooks/useFollowScroll'; -import { isBranch } from '../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { MetricKey } from '../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx index 727ab6a2932..2fb0a348ab4 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx @@ -27,14 +27,10 @@ import { StyledPageTitle, } from 'design-system'; import React from 'react'; +import { getComponentSecurityHotspotsUrl } from '~sonar-aligned/helpers/urls'; import { translate } from '../../../helpers/l10n'; -import { - getComponentSecurityHotspotsUrl, - getPathUrlAsString, - getRuleUrl, -} from '../../../helpers/urls'; +import { getPathUrlAsString, getRuleUrl } from '../../../helpers/urls'; import { useRefreshBranchStatus } from '../../../queries/branch'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { SecurityStandard, Standards } from '../../../types/security'; import { Hotspot, HotspotStatusOption } from '../../../types/security-hotspots'; @@ -56,8 +52,7 @@ export function HotspotHeader(props: HotspotHeaderProps) { const refreshBranchStatus = useRefreshBranchStatus(); const permalink = getPathUrlAsString( - getComponentSecurityHotspotsUrl(component.key, { - ...getBranchLikeQuery(branchLike), + getComponentSecurityHotspotsUrl(component.key, branchLike, { hotspots: key, }), false, diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx index 390490e2303..743b3ab14b1 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx @@ -31,14 +31,14 @@ import { Spinner, } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import withComponentContext from '../../../app/components/componentContext/withComponentContext'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; import Tooltip from '../../../components/controls/Tooltip'; import Measure from '../../../components/measure/Measure'; import { PopupPlacement } from '../../../components/ui/popups'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; -import { isBranch } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { ComponentContextShape } from '../../../types/component'; import { MetricKey, MetricType } from '../../../types/metrics'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainer.tsx index 92cbd6123a3..1462abbb52b 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainer.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getSources } from '../../../api/components'; import { locationsByLine } from '../../../components/SourceViewer/helpers/indexing'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { Hotspot } from '../../../types/security-hotspots'; import { Component, ExpandDirection, FlowLocation, SourceLine } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/StatusUpdateSuccessModal.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/StatusUpdateSuccessModal.tsx index 7f081e17679..1f5b65e24e5 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/StatusUpdateSuccessModal.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/StatusUpdateSuccessModal.tsx @@ -20,9 +20,9 @@ import { ButtonPrimary, ButtonSecondary, Checkbox, Modal, Note } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { save } from '../../../helpers/storage'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { HotspotStatusOption } from '../../../types/security-hotspots'; import { SHOW_STATUS_DIALOG_STORAGE_KEY } from '../constants'; diff --git a/server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx b/server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx index 82d220e413f..d398b835d3b 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/OAuthProviders.tsx @@ -19,9 +19,9 @@ */ import { BasicSeparator, ThirdPartyButton } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translateWithParameters } from '../../../helpers/l10n'; import { getBaseUrl } from '../../../helpers/system'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { IdentityProvider } from '../../../types/types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx index 5320238478b..2cca33a9d60 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx @@ -29,12 +29,12 @@ import { } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import DocumentationLink from '../../../../components/common/DocumentationLink'; import Tooltip from '../../../../components/controls/Tooltip'; import { ALM_DOCUMENTATION_PATHS, IMPORT_COMPATIBLE_ALMS } from '../../../../helpers/constants'; import { getEdition, getEditionUrl } from '../../../../helpers/editions'; import { translate, translateWithParameters } from '../../../../helpers/l10n'; -import HelpTooltip from '../../../../sonar-aligned/components/controls/HelpTooltip'; import { AlmBindingDefinitionBase, AlmKeys, diff --git a/server/sonar-web/src/main/js/apps/system/utils.ts b/server/sonar-web/src/main/js/apps/system/utils.ts index 5168c128f3b..edda3871235 100644 --- a/server/sonar-web/src/main/js/apps/system/utils.ts +++ b/server/sonar-web/src/main/js/apps/system/utils.ts @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { each, memoize, omit, omitBy, pickBy, sortBy } from 'lodash'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { cleanQuery, parseAsArray, parseAsString, serializeStringArray } from '../../helpers/query'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { RawQuery, SysInfoAppNode, diff --git a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx index dcb20140794..c40d1ce5865 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx @@ -29,6 +29,7 @@ import { } from 'design-system'; import React, { useEffect, useMemo, useState } from 'react'; import { Helmet } from 'react-helmet-async'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { getIdentityProviders } from '../../api/users'; import GitHubSynchronisationWarning from '../../app/components/GitHubSynchronisationWarning'; import GitLabSynchronisationWarning from '../../app/components/GitLabSynchronisationWarning'; @@ -40,7 +41,6 @@ import { translate } from '../../helpers/l10n'; import { LabelValueSelectOption } from '../../helpers/search'; import { useIdentityProviderQuery } from '../../queries/identity-provider/common'; import { useUsersQueries } from '../../queries/users'; -import HelpTooltip from '../../sonar-aligned/components/controls/HelpTooltip'; import { IdentityProvider, Provider } from '../../types/types'; import { RestUserDetailed } from '../../types/users'; import Header from './Header'; diff --git a/server/sonar-web/src/main/js/apps/users/UsersList.tsx b/server/sonar-web/src/main/js/apps/users/UsersList.tsx index 38c6ad6fc40..40178bb16e0 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersList.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersList.tsx @@ -19,8 +19,8 @@ */ import { ActionCell, ContentCell, HelperHintIcon, Table, TableRow } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../helpers/l10n'; -import HelpTooltip from '../../sonar-aligned/components/controls/HelpTooltip'; import { IdentityProvider, Provider } from '../../types/types'; import { RestUserDetailed } from '../../types/users'; import UserListItem from './components/UserListItem'; diff --git a/server/sonar-web/src/main/js/apps/web-api-v2/components/ApiSidebar.tsx b/server/sonar-web/src/main/js/apps/web-api-v2/components/ApiSidebar.tsx index 1d445d41e02..efc0af390c2 100644 --- a/server/sonar-web/src/main/js/apps/web-api-v2/components/ApiSidebar.tsx +++ b/server/sonar-web/src/main/js/apps/web-api-v2/components/ApiSidebar.tsx @@ -32,8 +32,8 @@ import { sortBy } from 'lodash'; import { OpenAPIV3 } from 'openapi-types'; import React, { Fragment, useContext, useMemo, useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { Dict } from '../../../types/types'; import { InternalExtension } from '../types'; import { URL_DIVIDER, getApiEndpointKey } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Search.tsx b/server/sonar-web/src/main/js/apps/web-api/components/Search.tsx index ec3be1f3c87..9cb06472608 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/Search.tsx @@ -19,8 +19,8 @@ */ import { Checkbox, HelperHintIcon, InputSearch } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate } from '../../../helpers/l10n'; -import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip'; import { Query } from '../utils'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx index 5d03123739f..d9a1f6e93ec 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/DeliveryItem.tsx @@ -19,8 +19,8 @@ */ import { CodeSnippet, Spinner } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { WebhookDelivery } from '../../../types/webhook'; import { formatPayload } from '../utils'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx index 07ba7e6bfb0..49c1aaac719 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx @@ -21,6 +21,7 @@ import { FlagMessage } from 'design-system'; import { intersection } from 'lodash'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { getComponentData, getComponentForSourceViewer, @@ -31,7 +32,6 @@ import { ComponentContext } from '../../app/components/componentContext/Componen import { isSameBranchLike } from '../../helpers/branch-like'; import { translate } from '../../helpers/l10n'; import { HttpStatus } from '../../helpers/request'; -import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx index c2372d53b3c..694b4442a7b 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx @@ -38,6 +38,12 @@ import { } from 'design-system'; import * as React from 'react'; import { useIntl } from 'react-intl'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { + getComponentIssuesUrl, + getComponentSecurityHotspotsUrl, +} from '~sonar-aligned/helpers/urls'; import { SOFTWARE_QUALITIES } from '../../helpers/constants'; import { ISSUETYPE_METRIC_KEYS_MAP, @@ -49,14 +55,7 @@ import { collapsedDirFromPath, fileFromPath } from '../../helpers/path'; import { omitNil } from '../../helpers/request'; import { getBaseUrl } from '../../helpers/system'; import { isDefined } from '../../helpers/types'; -import { - getBranchLikeUrl, - getCodeUrl, - getComponentIssuesUrl, - getComponentSecurityHotspotsUrl, -} from '../../helpers/urls'; -import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; +import { getBranchLikeUrl, getCodeUrl } from '../../helpers/urls'; import type { BranchLike } from '../../types/branch-like'; import { ComponentQualifier } from '../../types/component'; import { IssueType } from '../../types/issues'; @@ -148,8 +147,7 @@ export default function SourceViewerHeader(props: Readonly<Props>) { <span> <StyledDrilldownLink className="sw-body-md" - to={getComponentSecurityHotspotsUrl(project, { - ...getBranchLikeQuery(branchLike), + to={getComponentSecurityHotspotsUrl(project, branchLike, { files: path, ...DEFAULT_ISSUES_QUERY, types: IssueType.SecurityHotspot, diff --git a/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts b/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts index 7627c87f14e..a6f137121f5 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts +++ b/server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts @@ -17,9 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { listIssues, searchIssues } from '../../../api/issues'; import { parseIssueFromResponse } from '../../../helpers/issues'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../../types/branch-like'; import { Issue, RawQuery } from '../../../types/types'; import { DEFAULT_ISSUES_QUERY } from '../../shared/utils'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/DataTableModal.tsx b/server/sonar-web/src/main/js/components/activity-graph/DataTableModal.tsx index d95c51a2f28..dc233d43156 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/DataTableModal.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/DataTableModal.tsx @@ -22,8 +22,8 @@ import { FlagMessage, Modal } from 'design-system'; import { filter, slice, sortBy } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../helpers/l10n'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { ParsedAnalysis, Serie } from '../../types/project-activity'; import DateFormatter from '../intl/DateFormatter'; import TimeFormatter from '../intl/TimeFormatter'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/DefinitionChangeEventInner.tsx b/server/sonar-web/src/main/js/components/activity-graph/DefinitionChangeEventInner.tsx index 49b18217e1c..64b5b6b3ed7 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/DefinitionChangeEventInner.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/DefinitionChangeEventInner.tsx @@ -20,9 +20,9 @@ import { BareButton, BranchIcon, ChevronDownIcon, Note, StandoutLink } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { translate } from '../../helpers/l10n'; import { getProjectUrl } from '../../helpers/urls'; -import { isMainBranch } from '../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../types/branch-like'; import { AnalysisEvent, diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx index 675e2b0895e..db43f9edb8f 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphHistory.tsx @@ -21,10 +21,10 @@ import styled from '@emotion/styled'; import { ButtonSecondary } from 'design-system'; import * as React from 'react'; import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { AdvancedTimeline } from '../../components/charts/AdvancedTimeline'; import { translate } from '../../helpers/l10n'; import { getShortType } from '../../helpers/measures'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { MeasureHistory, ParsedAnalysis, Serie } from '../../types/project-activity'; import ModalButton from '../controls/ModalButton'; import DataTableModal from './DataTableModal'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx index 65a080ae412..0e020cb4230 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx @@ -19,8 +19,8 @@ */ import { TableSeparator } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate } from '../../helpers/l10n'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { MetricKey, MetricType } from '../../types/metrics'; import { MeasureHistory } from '../../types/project-activity'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentDuplication.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentDuplication.tsx index 2d14453306f..3c1b26f88d1 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentDuplication.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentDuplication.tsx @@ -19,8 +19,8 @@ */ import { TableSeparator } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate } from '../../helpers/l10n'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { MetricKey, MetricType } from '../../types/metrics'; import { MeasureHistory } from '../../types/project-activity'; diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/EventInner-it.tsx b/server/sonar-web/src/main/js/components/activity-graph/__tests__/EventInner-it.tsx index 4b6d3a00176..984c754957b 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/EventInner-it.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/EventInner-it.tsx @@ -21,12 +21,12 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; import { Route } from 'react-router-dom'; +import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock'; import { mockBranch, mockMainBranch } from '../../../helpers/mocks/branch-like'; import { mockAnalysisEvent } from '../../../helpers/mocks/project-activity'; import { renderAppWithComponentContext } from '../../../helpers/testReactTestingUtils'; import { byRole, byText } from '../../../helpers/testSelector'; -import { isMainBranch } from '../../../sonar-aligned/helpers/branch-like'; import { Branch, BranchLike } from '../../../types/branch-like'; import { ApplicationAnalysisEventCategory, diff --git a/server/sonar-web/src/main/js/components/charts/ColorBoxLegend.tsx b/server/sonar-web/src/main/js/components/charts/ColorBoxLegend.tsx index 633ab763798..1eb1c26d4b4 100644 --- a/server/sonar-web/src/main/js/components/charts/ColorBoxLegend.tsx +++ b/server/sonar-web/src/main/js/components/charts/ColorBoxLegend.tsx @@ -20,7 +20,7 @@ import styled from '@emotion/styled'; import { ScaleLinear, ScaleOrdinal } from 'd3-scale'; import * as React from 'react'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; interface Props { colorNA?: string; diff --git a/server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx b/server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx index d3fe35ae3a6..97d3ebfdaf8 100644 --- a/server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx +++ b/server/sonar-web/src/main/js/components/charts/LanguageDistribution.tsx @@ -20,9 +20,9 @@ import { Histogram } from 'design-system'; import { sortBy } from 'lodash'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import withLanguagesContext from '../../app/components/languages/withLanguagesContext'; import { translate } from '../../helpers/l10n'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { Languages } from '../../types/languages'; import { MetricType } from '../../types/metrics'; diff --git a/server/sonar-web/src/main/js/components/common/PageCounter.tsx b/server/sonar-web/src/main/js/components/common/PageCounter.tsx index 2f20c7216fc..de07d049fc5 100644 --- a/server/sonar-web/src/main/js/components/common/PageCounter.tsx +++ b/server/sonar-web/src/main/js/components/common/PageCounter.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { MetricType } from '../../types/metrics'; export interface PageCounterProps { diff --git a/server/sonar-web/src/main/js/components/controls/ListFooter.tsx b/server/sonar-web/src/main/js/components/controls/ListFooter.tsx index b393b36ada3..1f4a791fe3b 100644 --- a/server/sonar-web/src/main/js/components/controls/ListFooter.tsx +++ b/server/sonar-web/src/main/js/components/controls/ListFooter.tsx @@ -21,8 +21,8 @@ import styled from '@emotion/styled'; import classNames from 'classnames'; import { ButtonSecondary, Spinner, themeColor } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../helpers/l10n'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { MetricType } from '../../types/metrics'; export interface ListFooterProps { diff --git a/server/sonar-web/src/main/js/components/icon-mappers/BranchLikeIcon.tsx b/server/sonar-web/src/main/js/components/icon-mappers/BranchLikeIcon.tsx index 93b7c81f355..c76172bc276 100644 --- a/server/sonar-web/src/main/js/components/icon-mappers/BranchLikeIcon.tsx +++ b/server/sonar-web/src/main/js/components/icon-mappers/BranchLikeIcon.tsx @@ -21,8 +21,8 @@ import { IconBranch, IconGitBranch, IconProps, IconPullrequest } from '@sonarsource/echoes-react'; import { StyledMutedText } from 'design-system'; import * as React from 'react'; +import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { isPullRequest } from '../../helpers/branch-like'; -import { isMainBranch } from '../../sonar-aligned/helpers/branch-like'; import { BranchLike } from '../../types/branch-like'; export interface BranchLikeIconProps extends IconProps { diff --git a/server/sonar-web/src/main/js/components/issue/__tests__/actions-test.ts b/server/sonar-web/src/main/js/components/issue/__tests__/actions-test.ts index 1df47ac4ff2..ce9caa0e67b 100644 --- a/server/sonar-web/src/main/js/components/issue/__tests__/actions-test.ts +++ b/server/sonar-web/src/main/js/components/issue/__tests__/actions-test.ts @@ -17,13 +17,13 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { parseIssueFromResponse } from '../../../helpers/issues'; import { mockComponent } from '../../../helpers/mocks/component'; import { mockIssue } from '../../../helpers/testMocks'; -import { throwGlobalError } from '../../../sonar-aligned/helpers/error'; import { updateIssue } from '../actions'; -jest.mock('../../../sonar-aligned/helpers/error', () => ({ throwGlobalError: jest.fn() })); +jest.mock('~sonar-aligned/helpers/error', () => ({ throwGlobalError: jest.fn() })); jest.mock('../../../helpers/issues', () => ({ parseIssueFromResponse: jest.fn(), diff --git a/server/sonar-web/src/main/js/components/issue/actions.ts b/server/sonar-web/src/main/js/components/issue/actions.ts index 1d8c078b2ce..4a92b7e4f14 100644 --- a/server/sonar-web/src/main/js/components/issue/actions.ts +++ b/server/sonar-web/src/main/js/components/issue/actions.ts @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { parseIssueFromResponse } from '../../helpers/issues'; -import { throwGlobalError } from '../../sonar-aligned/helpers/error'; import { IssueResponse } from '../../types/issues'; import { Issue } from '../../types/types'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx index 638c8e3349c..379cb4e4c81 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueChangelogDiff.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { formatMeasure } from '../../../sonar-aligned/helpers/measures'; import { IssueChangelogDiff as TypeIssueChangelogDiff } from '../../../types/types'; export interface IssueChangelogDiffProps { diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx index 9eb6ade7f66..f9a6771ba97 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx @@ -19,11 +19,12 @@ */ import { IssueMessageHighlighting, StandoutLink } from 'design-system'; import * as React from 'react'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; import { ComponentContext } from '../../../app/components/componentContext/ComponentContext'; import { areMyIssuesSelected, parseQuery, serializeQuery } from '../../../apps/issues/utils'; import { translate } from '../../../helpers/l10n'; -import { getComponentIssuesUrl, getIssuesUrl } from '../../../helpers/urls'; -import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like'; +import { getIssuesUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { Issue } from '../../../types/types'; import { useLocation } from '../../hoc/withRouter'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx index 6097ec405e8..9dff3ce2bdc 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.tsx @@ -20,8 +20,8 @@ import { IconProps, TextSubdued } from 'design-system'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { IssueSeverity as IssueSeverityType } from '../../../types/issues'; import { Issue } from '../../../types/types'; import IssueSeverityIcon from '../../icon-mappers/IssueSeverityIcon'; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueType.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueType.tsx index cf04cc0553d..892d6c37025 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueType.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueType.tsx @@ -20,8 +20,8 @@ import { IconProps, TextSubdued } from 'design-system'; import * as React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { translate } from '../../../helpers/l10n'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { Issue } from '../../../types/types'; import IssueTypeIcon from '../../icon-mappers/IssueTypeIcon'; import { DeprecatedFieldTooltip } from './DeprecatedFieldTooltip'; diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelogDiff-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelogDiff-test.tsx index de956d27a58..345c7e10aef 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelogDiff-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelogDiff-test.tsx @@ -23,7 +23,7 @@ import { mockIssueChangelogDiff } from '../../../../helpers/mocks/issues'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import IssueChangelogDiff, { IssueChangelogDiffProps } from '../IssueChangelogDiff'; -jest.mock('../../../../sonar-aligned/helpers/measures', () => ({ +jest.mock('~sonar-aligned/helpers/measures', () => ({ formatMeasure: jest .fn() .mockImplementation((value: string, type: string) => `formatted.${value}.as.${type}`), diff --git a/server/sonar-web/src/main/js/components/measure/Measure.tsx b/server/sonar-web/src/main/js/components/measure/Measure.tsx index 6f9a7c647b2..57d43c5a781 100644 --- a/server/sonar-web/src/main/js/components/measure/Measure.tsx +++ b/server/sonar-web/src/main/js/components/measure/Measure.tsx @@ -19,9 +19,9 @@ */ import { MetricsRatingBadge, QualityGateIndicator, RatingLabel } from 'design-system'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import Tooltip from '../../components/controls/Tooltip'; import { translate, translateWithParameters } from '../../helpers/l10n'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { MetricType } from '../../types/metrics'; import { Status } from '../../types/types'; import RatingTooltipContent from './RatingTooltipContent'; diff --git a/server/sonar-web/src/main/js/components/measure/MeasureIndicator.tsx b/server/sonar-web/src/main/js/components/measure/MeasureIndicator.tsx index 2e384775ab3..1c1c9ed1707 100644 --- a/server/sonar-web/src/main/js/components/measure/MeasureIndicator.tsx +++ b/server/sonar-web/src/main/js/components/measure/MeasureIndicator.tsx @@ -24,7 +24,7 @@ import { RatingEnum, } from 'design-system'; import * as React from 'react'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { MetricKey, MetricType } from '../../types/metrics'; import Measure from './Measure'; import { duplicationRatingConverter } from './utils'; diff --git a/server/sonar-web/src/main/js/components/measure/RatingTooltipContent.tsx b/server/sonar-web/src/main/js/components/measure/RatingTooltipContent.tsx index d83276ea6bf..e73de8ef233 100644 --- a/server/sonar-web/src/main/js/components/measure/RatingTooltipContent.tsx +++ b/server/sonar-web/src/main/js/components/measure/RatingTooltipContent.tsx @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import withAppStateContext from '../../app/components/app-state/withAppStateContext'; import { translate, translateWithParameters } from '../../helpers/l10n'; import { isDiffMetric } from '../../helpers/measures'; @@ -27,7 +28,6 @@ import { PERCENT_MULTIPLIER, getMaintainabilityGrid, } from '../../helpers/ratings'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { AppState } from '../../types/appstate'; import { MetricKey, MetricType } from '../../types/metrics'; import { GlobalSettingKeys } from '../../types/settings'; diff --git a/server/sonar-web/src/main/js/components/permissions/PermissionHeader.tsx b/server/sonar-web/src/main/js/components/permissions/PermissionHeader.tsx index 45ffe967014..73bed5c6305 100644 --- a/server/sonar-web/src/main/js/components/permissions/PermissionHeader.tsx +++ b/server/sonar-web/src/main/js/components/permissions/PermissionHeader.tsx @@ -20,9 +20,9 @@ import classNames from 'classnames'; import { BareButton, ContentCell, HelperHintIcon } from 'design-system'; import * as React from 'react'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { translate, translateWithParameters } from '../../helpers/l10n'; import { isPermissionDefinitionGroup } from '../../helpers/permissions'; -import HelpTooltip from '../../sonar-aligned/components/controls/HelpTooltip'; import { PermissionDefinition, PermissionDefinitionGroup } from '../../types/types'; import InstanceMessage from '../common/InstanceMessage'; import ClickEventBoundary from '../controls/ClickEventBoundary'; diff --git a/server/sonar-web/src/main/js/components/shared/CleanCodeAttributePill.tsx b/server/sonar-web/src/main/js/components/shared/CleanCodeAttributePill.tsx index da66a71b98e..2576467c00f 100644 --- a/server/sonar-web/src/main/js/components/shared/CleanCodeAttributePill.tsx +++ b/server/sonar-web/src/main/js/components/shared/CleanCodeAttributePill.tsx @@ -19,8 +19,8 @@ */ import { Pill } from 'design-system'; import React from 'react'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { translate } from '../../helpers/l10n'; -import DocHelpTooltip from '../../sonar-aligned/components/controls/DocHelpTooltip'; import { CleanCodeAttribute, CleanCodeAttributeCategory } from '../../types/clean-code-taxonomy'; export interface Props { diff --git a/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx b/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx index 53f39eaf9aa..c72a4c72373 100644 --- a/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx +++ b/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx @@ -18,8 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { getComponentDrilldownUrl, getComponentIssuesUrl } from '../../helpers/urls'; -import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; +import { getComponentDrilldownUrl } from '../../helpers/urls'; import { BranchLike } from '../../types/branch-like'; import Link from '../common/Link'; import { isIssueMeasure, propsToIssueParams } from './utils'; diff --git a/server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx b/server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx index 916b2736627..4cc8a0ba848 100644 --- a/server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx +++ b/server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx @@ -21,8 +21,8 @@ import classNames from 'classnames'; import { Pill } from 'design-system'; import React from 'react'; import { FormattedMessage } from 'react-intl'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { translate } from '../../helpers/l10n'; -import DocHelpTooltip from '../../sonar-aligned/components/controls/DocHelpTooltip'; import { SoftwareImpactSeverity } from '../../types/clean-code-taxonomy'; import SoftwareImpactSeverityIcon from '../icon-mappers/SoftwareImpactSeverityIcon'; diff --git a/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx b/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx index 9d6cb91d871..675966d6dc1 100644 --- a/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx @@ -29,11 +29,11 @@ import { Title, } from 'design-system'; import * as React from 'react'; +import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { AnalysisStatus } from '../../apps/overview/components/AnalysisStatus'; import { translate } from '../../helpers/l10n'; import { getProjectTutorialLocation } from '../../helpers/urls'; import { useBranchesQuery } from '../../queries/branch'; -import { isMainBranch } from '../../sonar-aligned/helpers/branch-like'; import { AlmKeys, AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings'; import { MainBranch } from '../../types/branch-like'; import { Component } from '../../types/types'; diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CreateJenkinsfileBulletPoint.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CreateJenkinsfileBulletPoint.tsx index 84b70ae1789..4d6d9b2ad4f 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CreateJenkinsfileBulletPoint.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CreateJenkinsfileBulletPoint.tsx @@ -19,7 +19,7 @@ */ import { CodeSnippet, FlagMessage, HelperHintIcon, NumberedListItem } from 'design-system'; import * as React from 'react'; -import HelpTooltip from '../../../../sonar-aligned/components/controls/HelpTooltip'; +import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import SentenceWithFilename from '../../components/SentenceWithFilename'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; diff --git a/server/sonar-web/src/main/js/components/tutorials/other/TokenStep.tsx b/server/sonar-web/src/main/js/components/tutorials/other/TokenStep.tsx index 675a4801c03..452c30a01e9 100644 --- a/server/sonar-web/src/main/js/components/tutorials/other/TokenStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/other/TokenStep.tsx @@ -41,6 +41,7 @@ import { import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { SingleValue } from 'react-select'; +import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { generateToken, getTokens, revokeToken } from '../../../api/user-tokens'; import { translate } from '../../../helpers/l10n'; import { @@ -48,7 +49,6 @@ import { computeTokenExpirationDate, getAvailableExpirationOptions, } from '../../../helpers/tokens'; -import DocHelpTooltip from '../../../sonar-aligned/components/controls/DocHelpTooltip'; import { TokenExpiration, TokenType, UserToken } from '../../../types/token'; import { LoggedInUser } from '../../../types/users'; import ProjectTokenScopeInfo from '../components/ProjectTokenScopeInfo'; diff --git a/server/sonar-web/src/main/js/components/ui/FilesCounter.tsx b/server/sonar-web/src/main/js/components/ui/FilesCounter.tsx index 37ed3bd3d99..3d4aa635092 100644 --- a/server/sonar-web/src/main/js/components/ui/FilesCounter.tsx +++ b/server/sonar-web/src/main/js/components/ui/FilesCounter.tsx @@ -21,9 +21,9 @@ import styled from '@emotion/styled'; import classNames from 'classnames'; import { Note, themeColor } from 'design-system'; import React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate } from '../../helpers/l10n'; import { isDefined } from '../../helpers/types'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { MetricType } from '../../types/metrics'; interface Props { diff --git a/server/sonar-web/src/main/js/components/ui/Rating.tsx b/server/sonar-web/src/main/js/components/ui/Rating.tsx index 055e99dc9eb..f21335fbadc 100644 --- a/server/sonar-web/src/main/js/components/ui/Rating.tsx +++ b/server/sonar-web/src/main/js/components/ui/Rating.tsx @@ -19,8 +19,8 @@ */ import classNames from 'classnames'; import * as React from 'react'; +import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { translate, translateWithParameters } from '../../helpers/l10n'; -import { formatMeasure } from '../../sonar-aligned/helpers/measures'; import { MetricType } from '../../types/metrics'; import './Rating.css'; diff --git a/server/sonar-web/src/main/js/helpers/__tests__/error-test.ts b/server/sonar-web/src/main/js/helpers/__tests__/error-test.ts index e99e03bfae9..a07fe44ee9c 100644 --- a/server/sonar-web/src/main/js/helpers/__tests__/error-test.ts +++ b/server/sonar-web/src/main/js/helpers/__tests__/error-test.ts @@ -19,7 +19,7 @@ */ import { addGlobalErrorMessage } from 'design-system'; -import { throwGlobalError } from '../../sonar-aligned/helpers/error'; +import { throwGlobalError } from '~sonar-aligned/helpers/error'; jest.mock('design-system', () => ({ addGlobalErrorMessage: jest.fn(), diff --git a/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts b/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts index 40b319743c4..ee5c09bdd05 100644 --- a/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts +++ b/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts @@ -17,6 +17,10 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { + getComponentIssuesUrl, + getComponentSecurityHotspotsUrl, +} from '~sonar-aligned/helpers/urls'; import { DEFAULT_ISSUES_QUERY } from '../../components/shared/utils'; import { AlmKeys } from '../../types/alm-settings'; import { ComponentQualifier } from '../../types/component'; @@ -32,9 +36,7 @@ import { getComponentAdminUrl, getComponentDrilldownUrl, getComponentDrilldownUrlWithSelection, - getComponentIssuesUrl, getComponentOverviewUrl, - getComponentSecurityHotspotsUrl, getCreateProjectModeLocation, getDeprecatedActiveRulesUrl, getGlobalSettingsUrl, @@ -124,7 +126,7 @@ describe('#getComponentSecurityHotspotsUrl', () => { it('should forward some query parameters', () => { expect( - getComponentSecurityHotspotsUrl(SIMPLE_COMPONENT_KEY, { + getComponentSecurityHotspotsUrl(SIMPLE_COMPONENT_KEY, undefined, { inNewCodePeriod: 'true', [SecurityStandard.OWASP_TOP10_2021]: 'a1', [SecurityStandard.CWE]: '213', diff --git a/server/sonar-web/src/main/js/helpers/branch-like.ts b/server/sonar-web/src/main/js/helpers/branch-like.ts index 2e4474e19ca..4f9492068bd 100644 --- a/server/sonar-web/src/main/js/helpers/branch-like.ts +++ b/server/sonar-web/src/main/js/helpers/branch-like.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { orderBy } from 'lodash'; -import { isBranch, isMainBranch } from '../sonar-aligned/helpers/branch-like'; +import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { Branch, BranchLike, BranchLikeTree, PullRequest } from '../types/branch-like'; export function sortBranches(branches: Branch[]) { diff --git a/server/sonar-web/src/main/js/helpers/urls.ts b/server/sonar-web/src/main/js/helpers/urls.ts index d48bf47f45e..05053a9f659 100644 --- a/server/sonar-web/src/main/js/helpers/urls.ts +++ b/server/sonar-web/src/main/js/helpers/urls.ts @@ -17,16 +17,15 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { isArray, mapValues, omitBy, pick } from 'lodash'; +import { isArray, mapValues, omitBy } from 'lodash'; import { Path, To } from 'react-router-dom'; +import { getBranchLikeQuery, isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { getProfilePath } from '../apps/quality-profiles/utils'; import { DEFAULT_ISSUES_QUERY } from '../components/shared/utils'; -import { getBranchLikeQuery, isBranch, isMainBranch } from '../sonar-aligned/helpers/branch-like'; import { BranchLike, BranchParameters } from '../types/branch-like'; import { ComponentQualifier, isApplication, isPortfolioLike } from '../types/component'; import { MeasurePageView } from '../types/measures'; import { GraphType } from '../types/project-activity'; -import { SecurityStandard } from '../types/security'; import { Dict, RawQuery } from '../types/types'; import { HomePage } from '../types/users'; import { isPullRequest } from './branch-like'; @@ -45,7 +44,7 @@ export enum CodeScope { type CodeScopeType = CodeScope.Overall | CodeScope.New; -type Query = Location['query']; +export type Query = Location['query']; const PROJECT_BASE_URL = '/dashboard'; @@ -190,47 +189,6 @@ export function getIssuesUrl(query: Query): To { } /** - * Generate URL for a component's issues page - */ -export function getComponentIssuesUrl(componentKey: string, query?: Query): Path { - return { - pathname: '/project/issues', - search: queryToSearch({ ...(query || {}), id: componentKey }), - hash: '', - }; -} - -/** - * Generate URL for a component's security hotspot page - */ -export function getComponentSecurityHotspotsUrl(componentKey: string, query: Query = {}): Path { - const { branch, pullRequest, inNewCodePeriod, hotspots, assignedToMe, files } = query; - return { - pathname: '/security_hotspots', - search: queryToSearch({ - id: componentKey, - branch, - pullRequest, - inNewCodePeriod, - hotspots, - assignedToMe, - files, - ...pick(query, [ - SecurityStandard.OWASP_TOP10_2021, - SecurityStandard.OWASP_TOP10, - SecurityStandard.SONARSOURCE, - SecurityStandard.CWE, - SecurityStandard.PCI_DSS_3_2, - SecurityStandard.PCI_DSS_4_0, - SecurityStandard.OWASP_ASVS_4_0, - 'owaspAsvsLevel', - ]), - }), - hash: '', - }; -} - -/** * Generate URL for a component's drilldown page */ export function getComponentDrilldownUrl(options: { diff --git a/server/sonar-web/src/main/js/queries/branch.tsx b/server/sonar-web/src/main/js/queries/branch.tsx index 68cef8ddef5..e8bd6e1b252 100644 --- a/server/sonar-web/src/main/js/queries/branch.tsx +++ b/server/sonar-web/src/main/js/queries/branch.tsx @@ -22,6 +22,7 @@ import { debounce, flatten } from 'lodash'; import * as React from 'react'; import { useCallback, useContext } from 'react'; import { useSearchParams } from 'react-router-dom'; +import { isBranch } from '~sonar-aligned/helpers/branch-like'; import { deleteBranch, deletePullRequest, @@ -38,7 +39,6 @@ import { useLocation } from '../components/hoc/withRouter'; import { isPullRequest } from '../helpers/branch-like'; import { extractStatusConditionsFromProjectStatus } from '../helpers/qualityGates'; import { searchParamsToQuery } from '../helpers/urls'; -import { isBranch } from '../sonar-aligned/helpers/branch-like'; import { Branch, BranchLike } from '../types/branch-like'; import { isApplication, isPortfolioLike, isProject } from '../types/component'; import { Feature } from '../types/features'; diff --git a/server/sonar-web/src/main/js/queries/project-analyses.ts b/server/sonar-web/src/main/js/queries/project-analyses.ts index 1dadbe71e90..75615849dfc 100644 --- a/server/sonar-web/src/main/js/queries/project-analyses.ts +++ b/server/sonar-web/src/main/js/queries/project-analyses.ts @@ -19,6 +19,7 @@ */ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { CreateEventResponse, ProjectActivityStatuses, @@ -34,7 +35,6 @@ import { } from '../app/components/componentContext/withComponentContext'; import { parseDate } from '../helpers/dates'; import { serializeStringArray } from '../helpers/query'; -import { getBranchLikeQuery } from '../sonar-aligned/helpers/branch-like'; import { BranchParameters } from '../types/branch-like'; import { ParsedAnalysis } from '../types/project-activity'; import { useBranchesQuery } from './branch'; diff --git a/server/sonar-web/src/main/js/sonar-aligned/helpers/urls.ts b/server/sonar-web/src/main/js/sonar-aligned/helpers/urls.ts new file mode 100644 index 00000000000..363729eba2b --- /dev/null +++ b/server/sonar-web/src/main/js/sonar-aligned/helpers/urls.ts @@ -0,0 +1,72 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { pick } from 'lodash'; +import { Query, queryToSearch } from '../../helpers/urls'; + +import { Path } from 'react-router-dom'; +import { BranchLike } from '../../types/branch-like'; +import { SecurityStandard } from '../../types/security'; +import { getBranchLikeQuery } from './branch-like'; + +/** + * Generate URL for a component's issues page + */ + +export function getComponentIssuesUrl(componentKey: string, query?: Query): Path { + return { + pathname: '/project/issues', + search: queryToSearch({ ...(query || {}), id: componentKey }), + hash: '', + }; +} + +/** + * Generate URL for a component's security hotspot page + */ + +export function getComponentSecurityHotspotsUrl( + componentKey: string, + branchLike?: BranchLike, + query: Query = {}, +): Path { + const { inNewCodePeriod, hotspots, assignedToMe, files } = query; + return { + pathname: '/security_hotspots', + search: queryToSearch({ + id: componentKey, + inNewCodePeriod, + hotspots, + assignedToMe, + files, + ...getBranchLikeQuery(branchLike), + ...pick(query, [ + SecurityStandard.OWASP_TOP10_2021, + SecurityStandard.OWASP_TOP10, + SecurityStandard.SONARSOURCE, + SecurityStandard.CWE, + SecurityStandard.PCI_DSS_3_2, + SecurityStandard.PCI_DSS_4_0, + SecurityStandard.OWASP_ASVS_4_0, + 'owaspAsvsLevel', + ]), + }), + hash: '', + }; +} |