diff options
author | Viktor Vorona <viktor.vorona@sonarsource.com> | 2024-04-25 15:32:10 +0200 |
---|---|---|
committer | Matteo Mara <matteo.mara@sonarsource.com> | 2024-04-30 10:59:04 +0200 |
commit | dade4edf434e12c90e9c39b114047540b5d352b6 (patch) | |
tree | 73d8b018ac2d64310d4bcbebee89dcdf8a3ccb9c /server | |
parent | 0a731b7621e835a8aef15055a717b95b8203a3e2 (diff) | |
download | sonarqube-dade4edf434e12c90e9c39b114047540b5d352b6.tar.gz sonarqube-dade4edf434e12c90e9c39b114047540b5d352b6.zip |
SONAR-22049 Align ComponentQualifier
Diffstat (limited to 'server')
125 files changed, 202 insertions, 164 deletions
diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts index 02035fcdb7f..a69392e7e9e 100644 --- a/server/sonar-web/src/main/js/api/components.ts +++ b/server/sonar-web/src/main/js/api/components.ts @@ -20,13 +20,9 @@ import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '~sonar-aligned/helpers/request'; import { BranchParameters } from '~sonar-aligned/types/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { post, RequestData } from '../helpers/request'; -import { - ComponentQualifier, - TreeComponent, - TreeComponentWithPath, - Visibility, -} from '../types/component'; +import { TreeComponent, TreeComponentWithPath, Visibility } from '../types/component'; import { ComponentMeasure, Dict, diff --git a/server/sonar-web/src/main/js/api/mocks/CodingRulesServiceMock.ts b/server/sonar-web/src/main/js/api/mocks/CodingRulesServiceMock.ts index 0f16c786a19..5806e296367 100644 --- a/server/sonar-web/src/main/js/api/mocks/CodingRulesServiceMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/CodingRulesServiceMock.ts @@ -19,6 +19,7 @@ */ import { HttpStatusCode } from 'axios'; import { cloneDeep, countBy, pick, trim } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { RuleDescriptionSections } from '../../apps/coding-rules/rule'; import { mapRestRuleToRule } from '../../apps/coding-rules/utils'; import { getStandards } from '../../helpers/security-standard'; @@ -30,7 +31,7 @@ import { mockRuleRepository, } from '../../helpers/testMocks'; import { RuleRepository, SearchRulesResponse } from '../../types/coding-rules'; -import { ComponentQualifier, Visibility } from '../../types/component'; +import { Visibility } from '../../types/component'; import { RawIssuesResponse } from '../../types/issues'; import { RuleStatus, SearchRulesQuery } from '../../types/rules'; import { SecurityStandard } from '../../types/security'; diff --git a/server/sonar-web/src/main/js/api/mocks/PermissionsServiceMock.ts b/server/sonar-web/src/main/js/api/mocks/PermissionsServiceMock.ts index aaf8dda617e..7c53a4da0f2 100644 --- a/server/sonar-web/src/main/js/api/mocks/PermissionsServiceMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/PermissionsServiceMock.ts @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { chunk, cloneDeep, remove, uniq } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockPermission, mockPermissionGroup, @@ -26,7 +27,7 @@ import { mockPermissionUser, } from '../../helpers/mocks/permissions'; import { PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE } from '../../helpers/permissions'; -import { ComponentQualifier, Visibility } from '../../types/component'; +import { Visibility } from '../../types/component'; import { Permissions } from '../../types/permissions'; import { Permission, PermissionGroup, PermissionTemplate, PermissionUser } from '../../types/types'; import { BaseSearchProjectsParameters } from '../components'; diff --git a/server/sonar-web/src/main/js/api/mocks/ProjectsManagementServiceMock.ts b/server/sonar-web/src/main/js/api/mocks/ProjectsManagementServiceMock.ts index 57955a41fda..b6048242d6a 100644 --- a/server/sonar-web/src/main/js/api/mocks/ProjectsManagementServiceMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/ProjectsManagementServiceMock.ts @@ -18,8 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { cloneDeep } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockProject } from '../../helpers/mocks/projects'; -import { ComponentQualifier, Visibility } from '../../types/component'; +import { Visibility } from '../../types/component'; import { SettingsKey } from '../../types/settings'; import { Project, diff --git a/server/sonar-web/src/main/js/api/mocks/data/components.ts b/server/sonar-web/src/main/js/api/mocks/data/components.ts index fada7c125f0..14ba685aa6c 100644 --- a/server/sonar-web/src/main/js/api/mocks/data/components.ts +++ b/server/sonar-web/src/main/js/api/mocks/data/components.ts @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { times } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockComponent } from '../../../helpers/mocks/component'; import { mockDuplicatedFile, @@ -26,7 +27,6 @@ import { mockSourceLine, mockSourceViewerFile, } from '../../../helpers/mocks/sources'; -import { ComponentQualifier } from '../../../types/component'; import { Component, Dict, diff --git a/server/sonar-web/src/main/js/api/mocks/data/projects.ts b/server/sonar-web/src/main/js/api/mocks/data/projects.ts index 65091f63c77..966e6bae94d 100644 --- a/server/sonar-web/src/main/js/api/mocks/data/projects.ts +++ b/server/sonar-web/src/main/js/api/mocks/data/projects.ts @@ -20,7 +20,8 @@ /* eslint-disable local-rules/use-metrickey-enum */ -import { ComponentQualifier, Visibility } from '../../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { Visibility } from '../../../types/component'; import { ComponentRaw } from '../../components'; export function mockProjects(): ComponentRaw[] { diff --git a/server/sonar-web/src/main/js/api/mocks/data/webhooks.ts b/server/sonar-web/src/main/js/api/mocks/data/webhooks.ts index a67e6b9912b..4e0e2ba7128 100644 --- a/server/sonar-web/src/main/js/api/mocks/data/webhooks.ts +++ b/server/sonar-web/src/main/js/api/mocks/data/webhooks.ts @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { cloneDeep } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockComponent } from '../../../helpers/mocks/component'; import { mockWebhook, mockWebhookDelivery } from '../../../helpers/mocks/webhook'; -import { ComponentQualifier } from '../../../types/component'; import { WebhookDelivery, WebhookResponse } from '../../../types/webhook'; import { WEBHOOK_GLOBAL_1, 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 7ac68b3f756..2cd0b6136bc 100644 --- a/server/sonar-web/src/main/js/api/project-management.ts +++ b/server/sonar-web/src/main/js/api/project-management.ts @@ -19,8 +19,9 @@ */ import { throwGlobalError } from '~sonar-aligned/helpers/error'; import { getJSON } from '~sonar-aligned/helpers/request'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { post, postJSON } from '../helpers/request'; -import { ComponentQualifier, Visibility } from '../types/component'; +import { Visibility } from '../types/component'; import { Paging } from '../types/types'; export interface BaseSearchProjectsParameters { diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index 0e96137e0be..e05163099ab 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -24,6 +24,7 @@ import { createPortal } from 'react-dom'; import { Helmet } from 'react-helmet-async'; import { Outlet } from 'react-router-dom'; import { useLocation, useRouter } from '~sonar-aligned/components/hoc/withRouter'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { validateProjectAlmBinding } from '../../api/alm-settings'; import { getTasksForComponent } from '../../api/ce'; import { getComponentData } from '../../api/components'; @@ -34,7 +35,7 @@ import { getPortfolioUrl, getProjectUrl, getPullRequestUrl } from '../../helpers import { useBranchesQuery } from '../../queries/branch'; import { ProjectAlmBindingConfigurationErrors } from '../../types/alm-settings'; import { Branch } from '../../types/branch-like'; -import { ComponentQualifier, isFile, isPortfolioLike } from '../../types/component'; +import { isFile, isPortfolioLike } from '../../types/component'; import { Feature } from '../../types/features'; import { Task, TaskStatuses, TaskTypes } from '../../types/tasks'; import { Component } from '../../types/types'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx index c617493d56d..309d128a9f0 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx @@ -22,6 +22,7 @@ import userEvent from '@testing-library/user-event'; import React, { useContext } from 'react'; import { Route } from 'react-router-dom'; import * as withRouter from '~sonar-aligned/components/hoc/withRouter'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { validateProjectAlmBinding } from '../../../api/alm-settings'; import { getTasksForComponent } from '../../../api/ce'; import { getComponentData } from '../../../api/components'; @@ -34,7 +35,7 @@ import { HttpStatus } from '../../../helpers/request'; import { renderAppRoutes, renderComponent } from '../../../helpers/testReactTestingUtils'; import { byRole, byText } from '../../../helpers/testSelector'; import { getProjectUrl, getPullRequestUrl } from '../../../helpers/urls'; -import { ComponentQualifier, Visibility } from '../../../types/component'; +import { Visibility } from '../../../types/component'; import { TaskStatuses, TaskTypes } from '../../../types/tasks'; import handleRequiredAuthorization from '../../utils/handleRequiredAuthorization'; import ComponentContainer, { isSameBranch } from '../ComponentContainer'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx index 01f497a8d08..77664e5beb1 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx @@ -20,8 +20,9 @@ import { render, screen } from '@testing-library/react'; import * as React from 'react'; import { MemoryRouter, Route, Routes } from 'react-router-dom'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockComponent } from '../../../helpers/mocks/component'; -import { ComponentContextShape, ComponentQualifier } from '../../../types/component'; +import { ComponentContextShape } from '../../../types/component'; import { Component } from '../../../types/types'; import NonAdminPagesContainer from '../NonAdminPagesContainer'; import { ComponentContext } from '../componentContext/ComponentContext'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx index 0e3cdd76e37..a6a79a9abd9 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx @@ -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 { ComponentQualifier } from '~sonar-aligned/types/component'; import { get, remove, save } from '../../../helpers/storage'; -import { ComponentQualifier } from '../../../types/component'; import RecentHistory, { History } from '../RecentHistory'; jest.mock('../../../helpers/storage', () => ({ diff --git a/server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx b/server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx index c2b4a9acce7..9086a57de6f 100644 --- a/server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx +++ b/server/sonar-web/src/main/js/app/components/componentContext/withComponentContext.tsx @@ -19,7 +19,8 @@ */ import * as React from 'react'; import { getWrappedDisplayName } from '~sonar-aligned/components/hoc/utils'; -import { ComponentContextShape, ComponentQualifier } from '../../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { ComponentContextShape } from '../../../types/component'; import { ComponentContext } from './ComponentContext'; export default function withComponentContext<P extends Partial<ComponentContextShape>>( diff --git a/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx b/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx index 98084b97bb4..74f8f67cafe 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx @@ -26,10 +26,11 @@ import { RadioButton, } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { createApplication } from '../../../api/application'; import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; import { translate } from '../../../helpers/l10n'; -import { ComponentQualifier, Visibility } from '../../../types/component'; +import { Visibility } from '../../../types/component'; interface Props { onClose: () => void; diff --git a/server/sonar-web/src/main/js/app/components/global-search/GlobalSearch.tsx b/server/sonar-web/src/main/js/app/components/global-search/GlobalSearch.tsx index be60a163d75..7e849acf4ea 100644 --- a/server/sonar-web/src/main/js/app/components/global-search/GlobalSearch.tsx +++ b/server/sonar-web/src/main/js/app/components/global-search/GlobalSearch.tsx @@ -30,6 +30,7 @@ import { import { debounce, uniqBy } from 'lodash'; import * as React from 'react'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Router } from '~sonar-aligned/types/router'; import { getSuggestions } from '../../../api/components'; import FocusOutHandler from '../../../components/controls/FocusOutHandler'; @@ -41,7 +42,6 @@ import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getKeyboardShortcutEnabled } from '../../../helpers/preferences'; import { getComponentOverviewUrl } from '../../../helpers/urls'; -import { ComponentQualifier } from '../../../types/component'; import { Dict } from '../../../types/types'; import RecentHistory from '../RecentHistory'; import GlobalSearchResult from './GlobalSearchResult'; diff --git a/server/sonar-web/src/main/js/app/components/global-search/utils.ts b/server/sonar-web/src/main/js/app/components/global-search/utils.ts index c1b617e15e9..b14c5a80025 100644 --- a/server/sonar-web/src/main/js/app/components/global-search/utils.ts +++ b/server/sonar-web/src/main/js/app/components/global-search/utils.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { sortBy } from 'lodash'; -import { ComponentQualifier } from '../../../../js/types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; const ORDER = [ ComponentQualifier.Portfolio, diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx index cab37894a90..7a668ce3d26 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx @@ -19,12 +19,12 @@ */ import { TopBar } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import NCDAutoUpdateMessage from '../../../../components/new-code-definition/NCDAutoUpdateMessage'; import { translate } from '../../../../helpers/l10n'; import { withBranchLikes } from '../../../../queries/branch'; import { ProjectAlmBindingConfigurationErrors } from '../../../../types/alm-settings'; import { Branch } from '../../../../types/branch-like'; -import { ComponentQualifier } from '../../../../types/component'; import { Feature } from '../../../../types/features'; import { Component } from '../../../../types/types'; import RecentHistory from '../../RecentHistory'; 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 705a4e0515a..c36789459d4 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 @@ -29,17 +29,13 @@ import * as React from 'react'; import { useLocation } from '~sonar-aligned/components/hoc/withRouter'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { BranchParameters } from '~sonar-aligned/types/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; 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 { - ComponentQualifier, - isApplication, - isPortfolioLike, - isProject, -} from '../../../../types/component'; +import { isApplication, isPortfolioLike, isProject } from '../../../../types/component'; import { Feature } from '../../../../types/features'; import { Component, Dict, Extension } from '../../../../types/types'; import withAvailableFeatures, { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx index 1331723adba..d302a4e650f 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx @@ -20,12 +20,12 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import AlmSettingsServiceMock from '../../../../../api/mocks/AlmSettingsServiceMock'; import BranchesServiceMock from '../../../../../api/mocks/BranchesServiceMock'; import { mockProjectAlmBindingConfigurationErrors } from '../../../../../helpers/mocks/alm-settings'; import { mockComponent } from '../../../../../helpers/mocks/component'; import { renderApp } from '../../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../../types/component'; import ComponentNav, { ComponentNavProps } from '../ComponentNav'; const branchesHandler = new BranchesServiceMock(); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/Header-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/Header-test.tsx index e2a12202854..2872f34cf5e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/Header-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/Header-test.tsx @@ -20,6 +20,7 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import AlmSettingsServiceMock from '../../../../../api/mocks/AlmSettingsServiceMock'; import BranchesServiceMock from '../../../../../api/mocks/BranchesServiceMock'; import { mockMainBranch, mockPullRequest } from '../../../../../helpers/mocks/branch-like'; @@ -27,7 +28,6 @@ import { mockComponent } from '../../../../../helpers/mocks/component'; import { mockCurrentUser, mockLoggedInUser } from '../../../../../helpers/testMocks'; import { renderApp } from '../../../../../helpers/testReactTestingUtils'; import { AlmKeys } from '../../../../../types/alm-settings'; -import { ComponentQualifier } from '../../../../../types/component'; import { Feature } from '../../../../../types/features'; import { Header, HeaderProps } from '../Header'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/Menu-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/Menu-test.tsx index 89e5b10e842..2d954bb0bf9 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/Menu-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/Menu-test.tsx @@ -20,11 +20,11 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import BranchesServiceMock from '../../../../../api/mocks/BranchesServiceMock'; import { mockComponent } from '../../../../../helpers/mocks/component'; import { renderComponent } from '../../../../../helpers/testReactTestingUtils'; import { ComponentPropsType } from '../../../../../helpers/testUtils'; -import { ComponentQualifier } from '../../../../../types/component'; import { Feature } from '../../../../../types/features'; import { Menu } from '../Menu'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/utils-test.ts b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/utils-test.ts index 7ff1396924a..2d1f0813825 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/utils-test.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 { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockBranch } from '../../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../../helpers/mocks/component'; -import { ComponentQualifier } from '../../../../../types/component'; import { getCurrentPage } from '../utils'; describe('getCurrentPage', () => { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx index 5756e7e1e0b..5fa6f577023 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx @@ -20,11 +20,11 @@ import styled from '@emotion/styled'; import { ButtonSecondary, Popup, PopupPlacement, PopupZLevel } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import EscKeydownHandler from '../../../../../components/controls/EscKeydownHandler'; import FocusOutHandler from '../../../../../components/controls/FocusOutHandler'; import OutsideClickHandler from '../../../../../components/controls/OutsideClickHandler'; import { useBranchesQuery } from '../../../../../queries/branch'; -import { ComponentQualifier } from '../../../../../types/component'; import { Feature } from '../../../../../types/features'; import { Component } from '../../../../../types/types'; import withAvailableFeatures, { 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 24b448c766c..17cfa0db992 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 @@ -22,6 +22,7 @@ import * as React from 'react'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; import { isBranch } from '~sonar-aligned/helpers/branch-like'; import { queryToSearch } from '~sonar-aligned/helpers/urls'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Router } from '~sonar-aligned/types/router'; import { getBrancheLikesAsTree, @@ -32,7 +33,6 @@ import { KeyboardKeys } from '../../../../../helpers/keycodes'; import { translate } from '../../../../../helpers/l10n'; import { getBranchLikeUrl } from '../../../../../helpers/urls'; import { BranchLike, BranchLikeTree } from '../../../../../types/branch-like'; -import { ComponentQualifier } from '../../../../../types/component'; import { Component } from '../../../../../types/types'; import MenuItemList from './MenuItemList'; 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 f713ccb0653..5fdf10e0c16 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 @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { isBranch } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { BranchLike } from '../../../../types/branch-like'; -import { ComponentQualifier } from '../../../../types/component'; import { Component } from '../../../../types/types'; import { HomePage } from '../../../../types/users'; diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx index 28f2dfbf468..305d5880c26 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavMenu.tsx @@ -21,13 +21,13 @@ import classNames from 'classnames'; import { MainMenu, MainMenuItem } from 'design-system'; import * as React from 'react'; import { NavLink } from 'react-router-dom'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { isMySet } from '../../../../apps/issues/utils'; import Link from '../../../../components/common/Link'; import { DEFAULT_ISSUES_QUERY } from '../../../../components/shared/utils'; import { translate } from '../../../../helpers/l10n'; import { getQualityGatesUrl } from '../../../../helpers/urls'; import { AppState } from '../../../../types/appstate'; -import { ComponentQualifier } from '../../../../types/component'; import { CurrentUser } from '../../../../types/users'; import withAppStateContext from '../../app-state/withAppStateContext'; import GlobalNavMore from './GlobalNavMore'; diff --git a/server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx b/server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx index f027d36fcb7..1f7fa6850ca 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/ProjectModal.tsx @@ -30,10 +30,10 @@ import { Spinner, } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getSuggestions } from '../../../api/components'; import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate } from '../../../helpers/l10n'; -import { ComponentQualifier } from '../../../types/component'; import { NotificationProject } from '../../../types/notifications'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/code/__tests__/Code-it.ts b/server/sonar-web/src/main/js/apps/code/__tests__/Code-it.ts index 441cb8a1f08..0b47121cad7 100644 --- a/server/sonar-web/src/main/js/apps/code/__tests__/Code-it.ts +++ b/server/sonar-web/src/main/js/apps/code/__tests__/Code-it.ts @@ -21,6 +21,7 @@ import { screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { UserEvent } from '@testing-library/user-event/dist/types/setup/setup'; import { keyBy, omit, times } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock'; import ComponentsServiceMock from '../../../api/mocks/ComponentsServiceMock'; import IssuesServiceMock from '../../../api/mocks/IssuesServiceMock'; @@ -30,7 +31,6 @@ import { mockComponent } from '../../../helpers/mocks/component'; import { mockMeasure } from '../../../helpers/testMocks'; import { renderAppWithComponentContext } from '../../../helpers/testReactTestingUtils'; import { QuerySelector, byLabelText, byRole, byText } from '../../../helpers/testSelector'; -import { ComponentQualifier } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; import { Component } from '../../../types/types'; import routes from '../routes'; diff --git a/server/sonar-web/src/main/js/apps/code/__tests__/utils-test.tsx b/server/sonar-web/src/main/js/apps/code/__tests__/utils-test.tsx index 7c8d345811d..094c0effa08 100644 --- a/server/sonar-web/src/main/js/apps/code/__tests__/utils-test.tsx +++ b/server/sonar-web/src/main/js/apps/code/__tests__/utils-test.tsx @@ -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 { ComponentQualifier } from '~sonar-aligned/types/component'; import { getBreadcrumbs, getChildren, getComponent } from '../../../api/components'; import { mockMainBranch, mockPullRequest } from '../../../helpers/mocks/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { addComponent, addComponentBreadcrumbs, diff --git a/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx b/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx index fcb3b6cd505..a598b092069 100644 --- a/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx @@ -19,12 +19,13 @@ */ import * as React from 'react'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Location, Router } from '~sonar-aligned/types/router'; import withComponentContext from '../../../app/components/componentContext/withComponentContext'; import withMetricsContext from '../../../app/components/metrics/withMetricsContext'; import { CodeScope, getCodeUrl, getProjectUrl } from '../../../helpers/urls'; import { WithBranchLikesProps, useBranchesQuery } from '../../../queries/branch'; -import { ComponentQualifier, isPortfolioLike } from '../../../types/component'; +import { isPortfolioLike } from '../../../types/component'; import { Breadcrumb, Component, ComponentMeasure, Dict, Metric } from '../../../types/types'; import { addComponent, addComponentBreadcrumbs, clearBucket } from '../bucket'; import { loadMoreChildren, retrieveComponent, retrieveComponentChildren } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/code/components/Component.tsx b/server/sonar-web/src/main/js/apps/code/components/Component.tsx index c8aa45a568c..daecf2363c1 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Component.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/Component.tsx @@ -19,10 +19,10 @@ */ import { ContentCell, NumericalCell, TableRowInteractive } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import DateFromNow from '../../../components/intl/DateFromNow'; import { WorkspaceContext } from '../../../components/workspace/context'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { Metric, ComponentMeasure as TypeComponentMeasure } from '../../../types/types'; import ComponentMeasure from './ComponentMeasure'; import ComponentName from './ComponentName'; 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 22d5b0c07fd..f06edd9d8d9 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 @@ -22,16 +22,12 @@ import { Badge, BranchIcon, LightLabel, Note, QualifierIcon } from 'design-syste import * as React from 'react'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { queryToSearch } from '~sonar-aligned/helpers/urls'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { translate } from '../../../helpers/l10n'; import { isDefined } from '../../../helpers/types'; import { CodeScope, getComponentOverviewUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; -import { - ComponentQualifier, - isApplication, - isPortfolioLike, - isProject, -} from '../../../types/component'; +import { isApplication, isPortfolioLike, isProject } from '../../../types/component'; import { ComponentMeasure } from '../../../types/types'; import { mostCommonPrefix } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/code/components/Components.tsx b/server/sonar-web/src/main/js/apps/code/components/Components.tsx index a604644e209..0cd65d47c8a 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Components.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/Components.tsx @@ -20,11 +20,11 @@ import { ContentCell, Table, TableRow } from 'design-system'; import { sortBy, times } from 'lodash'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import withKeyboardNavigation from '../../../components/hoc/withKeyboardNavigation'; import { getComponentMeasureUniqueKey } from '../../../helpers/component'; import { isDefined } from '../../../helpers/types'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { ComponentMeasure, Metric } from '../../../types/types'; import Component from './Component'; import ComponentsEmpty from './ComponentsEmpty'; 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 b99f1b76f81..ce7cb76897d 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 @@ -23,12 +23,13 @@ import { isEmpty, omit } from 'lodash'; import * as React from 'react'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Location, Router } from '~sonar-aligned/types/router'; import { getTree } from '../../../api/components'; import { KeyboardKeys } from '../../../helpers/keycodes'; import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier, isPortfolioLike, isView } from '../../../types/component'; +import { isPortfolioLike, isView } from '../../../types/component'; import { ComponentMeasure } from '../../../types/types'; interface Props { 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 14fa190f3f5..89d9333d7c1 100644 --- a/server/sonar-web/src/main/js/apps/code/utils.ts +++ b/server/sonar-web/src/main/js/apps/code/utils.ts @@ -18,11 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; 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 { BranchLike } from '../../types/branch-like'; -import { ComponentQualifier, isPortfolioLike } from '../../types/component'; +import { isPortfolioLike } from '../../types/component'; import { MetricKey } from '../../types/metrics'; import { Breadcrumb, ComponentMeasure } from '../../types/types'; import { diff --git a/server/sonar-web/src/main/js/apps/component-measures/__tests__/ComponentMeasures-it.tsx b/server/sonar-web/src/main/js/apps/component-measures/__tests__/ComponentMeasures-it.tsx index ab9c02d9b06..3bd91c2e763 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/__tests__/ComponentMeasures-it.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/__tests__/ComponentMeasures-it.tsx @@ -21,6 +21,7 @@ import { screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { times } from 'lodash'; import selectEvent from 'react-select-event'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock'; import ComponentsServiceMock from '../../../api/mocks/ComponentsServiceMock'; import IssuesServiceMock from '../../../api/mocks/IssuesServiceMock'; @@ -29,7 +30,7 @@ import { mockComponent } from '../../../helpers/mocks/component'; import { mockMeasure, mockMetric } from '../../../helpers/testMocks'; import { renderAppWithComponentContext } from '../../../helpers/testReactTestingUtils'; import { byLabelText, byRole, byTestId, byText } from '../../../helpers/testSelector'; -import { ComponentContextShape, ComponentQualifier } from '../../../types/component'; +import { ComponentContextShape } from '../../../types/component'; import { Feature } from '../../../types/features'; import { MetricKey } from '../../../types/metrics'; import routes from '../routes'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/component-measures/__tests__/utils-test.ts index af7563afcc9..23eca5a2f0d 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/component-measures/__tests__/utils-test.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 { ComponentQualifier } from '../../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { MeasurePageView } from '../../../types/measures'; import { MetricKey, MetricType } from '../../../types/metrics'; import { ComponentMeasure } from '../../../types/types'; 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 57fb020d3ed..80ad48f8a8f 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 @@ -34,6 +34,7 @@ import { Helmet } from 'react-helmet-async'; import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Location, Router } from '~sonar-aligned/types/router'; import { getMeasuresWithPeriod } from '../../../api/measures'; import { getAllMetrics } from '../../../api/metrics'; @@ -46,7 +47,7 @@ import { isPullRequest, isSameBranchLike } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { areLeakAndOverallCCTMeasuresComputed } from '../../../helpers/measures'; import { WithBranchLikesProps, useBranchesQuery } from '../../../queries/branch'; -import { ComponentQualifier, isPortfolioLike } from '../../../types/component'; +import { isPortfolioLike } from '../../../types/component'; import { MeasurePageView } from '../../../types/measures'; import { MetricKey } from '../../../types/metrics'; import { ComponentMeasure, Dict, MeasureEnhanced, Metric, Period } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx index a8021f0b07e..34492842e8e 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx @@ -22,13 +22,13 @@ import { differenceInDays } from 'date-fns'; import { Highlight, Note, themeBorder, themeColor } from 'design-system'; import * as React from 'react'; import { WrappedComponentProps, injectIntl } from 'react-intl'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import Tooltip from '../../../components/controls/Tooltip'; import DateFormatter, { longFormatterOption } from '../../../components/intl/DateFormatter'; import DateFromNow from '../../../components/intl/DateFromNow'; import DateTimeFormatter, { formatterOption } from '../../../components/intl/DateTimeFormatter'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getNewCodePeriodDate, getNewCodePeriodLabel } from '../../../helpers/new-code-period'; -import { ComponentQualifier } from '../../../types/component'; import { NewCodeDefinitionType } from '../../../types/new-code-definition'; import { ComponentMeasure, Period } from '../../../types/types'; 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 99e0c642cfd..7f87036451a 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 @@ -22,6 +22,7 @@ import classNames from 'classnames'; import { MetricsRatingBadge, RatingLabel } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import LanguageDistribution from '../../../components/charts/LanguageDistribution'; import Tooltip from '../../../components/controls/Tooltip'; import Measure from '../../../components/measure/Measure'; @@ -29,7 +30,6 @@ import { getLocalizedMetricName, translate, translateWithParameters } from '../. import { isDiffMetric } from '../../../helpers/measures'; import { getMeasureHistoryUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { MetricKey, MetricType } from '../../../types/metrics'; import { ComponentMeasure, Metric, Period, Measure as TypeMeasure } from '../../../types/types'; import { getMetricSubnavigationName, hasFullMeasures } from '../utils'; 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 eb0a0a7395b..0284d8bc4a1 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 @@ -21,13 +21,14 @@ 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 { ComponentQualifier } from '~sonar-aligned/types/component'; 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 { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier, isProject } from '../../../types/component'; +import { isProject } from '../../../types/component'; import { ComponentMeasure, ComponentMeasureIntern } from '../../../types/types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/LeakPeriodLegend-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/LeakPeriodLegend-test.tsx index 3a832bdbd8e..879da57177d 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/LeakPeriodLegend-test.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/LeakPeriodLegend-test.tsx @@ -19,9 +19,9 @@ */ import { screen } from '@testing-library/react'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockComponentMeasure } from '../../../../helpers/mocks/component'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../types/component'; import { Period } from '../../../../types/types'; import LeakPeriodLegend, { LeakPeriodLegendProps } from '../LeakPeriodLegend'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx index cc4f101da29..fab3b2edecb 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx @@ -20,11 +20,12 @@ import { ContentCell, HoverLink, Note, QualifierIcon } from 'design-system'; import * as React from 'react'; import { To } from 'react-router-dom'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { fillBranchLike } from '../../../helpers/branch-like'; import { limitComponentName, splitPath } from '../../../helpers/path'; import { getComponentDrilldownUrlWithSelection, getProjectUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier, isApplication, isProject } from '../../../types/component'; +import { isApplication, isProject } from '../../../types/component'; import { MeasurePageView } from '../../../types/measures'; import { MetricKey } from '../../../types/metrics'; import { ComponentMeasure, ComponentMeasureEnhanced, Metric } 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 497e1ff9231..bbd182854a8 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 @@ -19,6 +19,7 @@ */ import { groupBy, memoize, sortBy, toPairs } from 'lodash'; import { isBranch } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { RawQuery } from '~sonar-aligned/types/router'; import { enhanceMeasure } from '../../components/measure/utils'; import { isPullRequest } from '../../helpers/branch-like'; @@ -45,7 +46,6 @@ import { serializeString, } from '../../helpers/query'; import { BranchLike } from '../../types/branch-like'; -import { ComponentQualifier } from '../../types/component'; import { Domain, MeasurePageView } from '../../types/measures'; import { MetricKey, MetricType } from '../../types/metrics'; import { diff --git a/server/sonar-web/src/main/js/apps/issues/__tests__/IssuesApp-it.tsx b/server/sonar-web/src/main/js/apps/issues/__tests__/IssuesApp-it.tsx index e707d9741fd..ad9c606eeb0 100644 --- a/server/sonar-web/src/main/js/apps/issues/__tests__/IssuesApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/issues/__tests__/IssuesApp-it.tsx @@ -20,8 +20,8 @@ import { screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockLoggedInUser } from '../../../helpers/testMocks'; -import { ComponentQualifier } from '../../../types/component'; import { IssueType } from '../../../types/issues'; import { NoticeType } from '../../../types/users'; import { diff --git a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx index 926327f5f6f..4da4b20756a 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx @@ -20,9 +20,10 @@ import styled from '@emotion/styled'; import { Badge, BranchIcon, themeBorder, themeContrast } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { collapsePath, limitComponentName } from '../../../helpers/path'; -import { ComponentQualifier, isView } from '../../../types/component'; +import { isView } from '../../../types/component'; import { Component, Issue } from '../../../types/types'; import { getSelectedLocation } from '../utils'; 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 2ef265fa609..f825be933c9 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 @@ -36,6 +36,7 @@ import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Location, RawQuery, Router } from '~sonar-aligned/types/router'; import { listIssues, searchIssues } from '../../../api/issues'; import { getRuleDetails } from '../../../api/rules'; @@ -62,7 +63,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; import { serializeDate } from '../../../helpers/query'; import { withBranchLikes } from '../../../queries/branch'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier, isPortfolioLike, isProject } from '../../../types/component'; +import { isPortfolioLike, isProject } from '../../../types/component'; import { ASSIGNEE_ME, Facet, diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx b/server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx index 7671c52bc30..abec2ed9706 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx @@ -19,10 +19,10 @@ */ import { screen } from '@testing-library/react'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockComponent } from '../../../../helpers/mocks/component'; import { mockIssue } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../types/component'; import { Component, Issue } from '../../../../types/types'; import ComponentBreadcrumbs from '../ComponentBreadcrumbs'; 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 6b1c96f584c..6d36e808194 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 @@ -34,6 +34,7 @@ import { import * as React from 'react'; import { getBranchLikeQuery, isBranch } from '~sonar-aligned/helpers/branch-like'; import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { ComponentContext } from '../../../app/components/componentContext/ComponentContext'; import { useCurrentUser } from '../../../app/components/current-user/CurrentUserContext'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; @@ -42,7 +43,6 @@ import { translate } from '../../../helpers/l10n'; import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path'; import { getBranchLikeUrl } from '../../../helpers/urls'; import { useBranchesQuery } from '../../../queries/branch'; -import { ComponentQualifier } from '../../../types/component'; import { SourceViewerFile } from '../../../types/types'; import { isLoggedIn } from '../../../types/users'; import { IssueOpenInIdeButton } from '../components/IssueOpenInIdeButton'; diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts index 7b9d057d675..f74fcf5e6ad 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/utils.ts @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { sortBy } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { decorateWithUnderlineFlags } from '../../../helpers/code-viewer'; import { isDefined } from '../../../helpers/types'; import { useUsersQueries } from '../../../queries/users'; -import { ComponentQualifier } from '../../../types/component'; import { ReviewHistoryElement, ReviewHistoryType } from '../../../types/security-hotspots'; import { ExpandDirection, diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx index b545b9601da..f6a898e0d17 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AuthorFacet.tsx @@ -19,10 +19,10 @@ */ import { omit } from 'lodash'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { searchIssueAuthors } from '../../../api/issues'; import { translate } from '../../../helpers/l10n'; import { highlightTerm } from '../../../helpers/search'; -import { ComponentQualifier } from '../../../types/component'; import { Facet } from '../../../types/issues'; import { Component, Dict } from '../../../types/types'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx index 52a703f4ef4..3321eb714be 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ProjectFacet.tsx @@ -21,11 +21,11 @@ import { IconProject, Spinner } from '@sonarsource/echoes-react'; import { omit } from 'lodash'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getTree, searchProjects } from '../../../api/components'; import { translate } from '../../../helpers/l10n'; import { highlightTerm } from '../../../helpers/search'; import { useProjectQuery } from '../../../queries/projects'; -import { ComponentQualifier } from '../../../types/component'; import { Facet, ReferencedComponent } from '../../../types/issues'; import { MetricKey } from '../../../types/metrics'; import { Component, Dict, Paging } from '../../../types/types'; 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 dac31cacee5..182d77c96c2 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 @@ -21,18 +21,13 @@ 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 { ComponentQualifier } from '~sonar-aligned/types/component'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; import { isPullRequest } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { AppState } from '../../../types/appstate'; import { BranchLike } from '../../../types/branch-like'; -import { - ComponentQualifier, - isApplication, - isPortfolioLike, - isProject, - isView, -} from '../../../types/component'; +import { isApplication, isPortfolioLike, isProject, isView } from '../../../types/component'; import { Facet, ReferencedComponent, diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx index 19a5fe4430d..400960bd1e6 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TagFacet.tsx @@ -19,10 +19,10 @@ */ import { omit } from 'lodash'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { searchIssueTags } from '../../../api/issues'; import { translate } from '../../../helpers/l10n'; import { highlightTerm } from '../../../helpers/search'; -import { ComponentQualifier } from '../../../types/component'; import { Facet } from '../../../types/issues'; import { Component, Dict } from '../../../types/types'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-it.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-it.tsx index 11055ca44f8..ec27ce5ddc7 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-it.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-it.tsx @@ -19,11 +19,11 @@ */ import { screen, waitFor } from '@testing-library/react'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockComponent } from '../../../../helpers/mocks/component'; import { mockQuery } from '../../../../helpers/mocks/issues'; import { mockAppState } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../types/component'; import { GlobalSettingKeys } from '../../../../types/settings'; import { SidebarClass as Sidebar } from '../Sidebar'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx b/server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx index 1f734266d96..8e296865e21 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/Analysis.tsx @@ -21,8 +21,8 @@ import { QualityGateIndicator } from 'design-system'; import { sortBy } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; -import { ComponentQualifier } from '../../../types/component'; import { AnalysisMeasuresVariations, ProjectAnalysisEventCategory, 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 c8a0b727b6e..03471874a37 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 @@ -20,6 +20,7 @@ import { sortBy, uniq } from 'lodash'; import * as React from 'react'; import { getBranchLikeQuery, isMainBranch } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getApplicationDetails, getApplicationLeak } from '../../../api/application'; import { getMeasuresWithPeriodAndMetrics } from '../../../api/measures'; import { getProjectActivity } from '../../../api/projectActivity'; @@ -45,7 +46,6 @@ import { import { isDefined } from '../../../helpers/types'; import { ApplicationPeriod } from '../../../types/application'; import { Branch, BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; import { Analysis, GraphType, MeasureHistory } from '../../../types/project-activity'; import { QualityGateStatus, QualityGateStatusCondition } from '../../../types/quality-gates'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx index 4d63589d17b..85243c10d47 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/BranchOverviewRenderer.tsx @@ -26,6 +26,7 @@ import { } from 'design-system'; import * as React from 'react'; import { useLocation, useRouter } from '~sonar-aligned/components/hoc/withRouter'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import A11ySkipTarget from '../../../components/a11y/A11ySkipTarget'; import AnalysisMissingInfoMessage from '../../../components/shared/AnalysisMissingInfoMessage'; import { parseDate } from '../../../helpers/dates'; @@ -33,7 +34,7 @@ import { areCCTMeasuresComputed, isDiffMetric } from '../../../helpers/measures' import { CodeScope } from '../../../helpers/urls'; import { ApplicationPeriod } from '../../../types/application'; import { Branch } from '../../../types/branch-like'; -import { ComponentQualifier, isPortfolioLike } from '../../../types/component'; +import { isPortfolioLike } from '../../../types/component'; import { Analysis, GraphType, MeasureHistory } from '../../../types/project-activity'; import { QualityGateStatus } from '../../../types/quality-gates'; import { Component, MeasureEnhanced, Metric, Period, QualityGate } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx b/server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx index d6b9a67ffbd..b7b0ce2c721 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/FirstAnalysisNextStepsNotif.tsx @@ -21,11 +21,11 @@ import { Link } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { queryToSearch } from '~sonar-aligned/helpers/urls'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; import DismissableAlert from '../../../components/ui/DismissableAlert'; import { translate } from '../../../helpers/l10n'; import { useProjectBindingQuery } from '../../../queries/devops-integration'; -import { ComponentQualifier } from '../../../types/component'; import { Component } from '../../../types/types'; import { CurrentUser, isLoggedIn } from '../../../types/users'; import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../settings/constants'; 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 9b9d97189d9..200ea6b0cba 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 @@ -23,12 +23,12 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { queryToSearch } from '~sonar-aligned/helpers/urls'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import DocumentationLink from '../../../components/common/DocumentationLink'; import { Image } from '../../../components/common/Image'; import { translate } from '../../../helpers/l10n'; import { CodeScope } from '../../../helpers/urls'; import { Branch } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { NewCodeDefinitionType } from '../../../types/new-code-definition'; import { Component, Period } from '../../../types/types'; 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 04a9e2d79ae..4befd866b66 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 @@ -20,10 +20,10 @@ import { FlagMessage } from 'design-system'; import * as React from 'react'; import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getBranchLikeDisplayName } from '../../../helpers/branch-like'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; import { Component, MeasureEnhanced } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx index a53b07d4434..fa0604bcd47 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx @@ -19,7 +19,8 @@ */ import { BasicSeparator, Card, Spinner } from 'design-system'; import * as React from 'react'; -import { ComponentQualifier, isApplication } from '../../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { isApplication } from '../../../types/component'; import { QualityGateStatus } from '../../../types/quality-gates'; import { CaycStatus, Component, QualityGate } from '../../../types/types'; import IgnoredConditionWarning from '../components/IgnoredConditionWarning'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/TabsPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/TabsPanel.tsx index 775bbb53318..0e8a0c68b55 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/TabsPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/TabsPanel.tsx @@ -22,12 +22,12 @@ import { isBefore, sub } from 'date-fns'; import { ButtonLink, FlagMessage, LightLabel, Tabs } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import DocumentationLink from '../../../components/common/DocumentationLink'; import { translate } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; import { CodeScope } from '../../../helpers/urls'; import { ApplicationPeriod } from '../../../types/application'; -import { ComponentQualifier } from '../../../types/component'; import { Analysis, ProjectAnalysisEventCategory } from '../../../types/project-activity'; import { QualityGateStatus } from '../../../types/quality-gates'; import { Component, Period } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-it.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-it.tsx index 26e9adc8aa0..5095400d6fa 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-it.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-it.tsx @@ -19,6 +19,7 @@ */ import { screen, waitFor } from '@testing-library/react'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import AlmSettingsServiceMock from '../../../../api/mocks/AlmSettingsServiceMock'; import ApplicationServiceMock from '../../../../api/mocks/ApplicationServiceMock'; import BranchesServiceMock from '../../../../api/mocks/BranchesServiceMock'; @@ -39,7 +40,6 @@ import { mockLoggedInUser, mockMeasure, mockPaging } from '../../../../helpers/t import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { byRole, byText } from '../../../../helpers/testSelector'; import { SoftwareImpactSeverity, SoftwareQuality } from '../../../../types/clean-code-taxonomy'; -import { ComponentQualifier } from '../../../../types/component'; import { MetricKey } from '../../../../types/metrics'; import { ProjectAnalysisEventCategory } from '../../../../types/project-activity'; import { CaycStatus } from '../../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/AnalysisLicenseError.tsx b/server/sonar-web/src/main/js/apps/overview/components/AnalysisLicenseError.tsx index 5c63599a401..4f038e9d551 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/AnalysisLicenseError.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/AnalysisLicenseError.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { AppStateContext } from '../../../app/components/app-state/AppStateContext'; import Link from '../../../components/common/Link'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { ComponentQualifier } from '../../../types/component'; import { Task } from '../../../types/tasks'; import { useLicenseIsValid } from './useLicenseIsValid'; 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 754e63e09d6..6037324a053 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 @@ -22,6 +22,7 @@ import { FlagMessage, LargeCenteredLayout, PageContentFontWrapper, Spinner } fro import * as React from 'react'; import { Navigate } from 'react-router-dom'; import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getScannableProjects } from '../../../api/components'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; import { getBranchLikeDisplayName } from '../../../helpers/branch-like'; @@ -30,7 +31,6 @@ import { getProjectTutorialLocation } from '../../../helpers/urls'; import { hasGlobalPermission } from '../../../helpers/users'; import { useTaskForComponentQuery } from '../../../queries/component'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { Permissions } from '../../../types/permissions'; import { TaskTypes } from '../../../types/tasks'; import { Component } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx index c167092bab9..e3f9e6e096e 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx @@ -19,6 +19,7 @@ */ import { screen, waitFor } from '@testing-library/react'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getScannableProjects } from '../../../../api/components'; import BranchesServiceMock from '../../../../api/mocks/BranchesServiceMock'; import ComputeEngineServiceMock from '../../../../api/mocks/ComputeEngineServiceMock'; @@ -29,7 +30,6 @@ import { mockTask } from '../../../../helpers/mocks/tasks'; import { mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { getProjectTutorialLocation } from '../../../../helpers/urls'; -import { ComponentQualifier } from '../../../../types/component'; import { TaskStatuses, TaskTypes } from '../../../../types/tasks'; import { App } from '../App'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/PullRequestOverview-it.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/PullRequestOverview-it.tsx index f0c6fe31b6d..aa2ab4fa4ed 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/PullRequestOverview-it.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/PullRequestOverview-it.tsx @@ -20,6 +20,7 @@ import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import BranchesServiceMock from '../../../../api/mocks/BranchesServiceMock'; import { fetchQualityGate, getQualityGateProjectStatus } from '../../../../api/quality-gates'; import CurrentUserContextProvider from '../../../../app/components/current-user/CurrentUserContextProvider'; @@ -33,7 +34,6 @@ import { mockLoggedInUser, mockMeasure, mockMetric } from '../../../../helpers/t import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { byLabelText, byRole } from '../../../../helpers/testSelector'; import { ComponentPropsType } from '../../../../helpers/testUtils'; -import { ComponentQualifier } from '../../../../types/component'; import { MetricKey, MetricType } from '../../../../types/metrics'; import { CaycStatus } from '../../../../types/types'; import { NoticeType } from '../../../../types/users'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/PermissionTemplatesApp-it.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/PermissionTemplatesApp-it.tsx index cc3a6b172ee..2b16b970fb2 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/PermissionTemplatesApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/__tests__/PermissionTemplatesApp-it.tsx @@ -21,6 +21,7 @@ import { screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { UserEvent } from '@testing-library/user-event/dist/types/setup/setup'; import { uniq } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import GithubProvisioningServiceMock from '../../../../api/mocks/GithubProvisioningServiceMock'; import PermissionsServiceMock from '../../../../api/mocks/PermissionsServiceMock'; import { mockPermissionGroup, mockPermissionUser } from '../../../../helpers/mocks/permissions'; @@ -28,7 +29,6 @@ import { PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE } from '../../../../helpers/perm import { mockAppState } from '../../../../helpers/testMocks'; import { renderAppWithAdminContext } from '../../../../helpers/testReactTestingUtils'; import { byRole, byText } from '../../../../helpers/testSelector'; -import { ComponentQualifier } from '../../../../types/component'; import { Feature } from '../../../../types/features'; import { Permissions } from '../../../../types/permissions'; import { PermissionGroup, PermissionUser } from '../../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/PermissionsGlobalApp.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/PermissionsGlobalApp.tsx index 00ca92e0358..d3d91fd2a1b 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/PermissionsGlobalApp.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/PermissionsGlobalApp.tsx @@ -21,6 +21,7 @@ import { LargeCenteredLayout, PageContentFontWrapper } from 'design-system'; import { without } from 'lodash'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import * as api from '../../../../api/permissions'; import withAppStateContext, { WithAppStateContextProps, @@ -34,7 +35,6 @@ import { convertToPermissionDefinitions, filterPermissions, } from '../../../../helpers/permissions'; -import { ComponentQualifier } from '../../../../types/component'; import { Paging, PermissionGroup, PermissionUser } from '../../../../types/types'; import '../../styles.css'; import PageHeader from './PageHeader'; diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/PermissionsGlobal-it.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/PermissionsGlobal-it.tsx index 7055dea9001..4400f2036fa 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/PermissionsGlobal-it.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/PermissionsGlobal-it.tsx @@ -20,13 +20,13 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { without } from 'lodash'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import PermissionsServiceMock from '../../../../../api/mocks/PermissionsServiceMock'; import { mockPermissionGroup, mockPermissionUser } from '../../../../../helpers/mocks/permissions'; import { PERMISSIONS_ORDER_GLOBAL } from '../../../../../helpers/permissions'; import { mockAppState } from '../../../../../helpers/testMocks'; import { renderAppRoutes } from '../../../../../helpers/testReactTestingUtils'; import { AppState } from '../../../../../types/appstate'; -import { ComponentQualifier } from '../../../../../types/component'; import { Permissions } from '../../../../../types/permissions'; import { PermissionGroup, PermissionUser } from '../../../../../types/types'; import { globalPermissionsRoutes } from '../../../routes'; diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx index be981f86084..5e4461aac92 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx @@ -19,6 +19,7 @@ */ import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import AlmSettingsServiceMock from '../../../../../api/mocks/AlmSettingsServiceMock'; import GithubProvisioningServiceMock from '../../../../../api/mocks/GithubProvisioningServiceMock'; import PermissionsServiceMock from '../../../../../api/mocks/PermissionsServiceMock'; @@ -34,11 +35,7 @@ import { renderAppWithComponentContext, } from '../../../../../helpers/testReactTestingUtils'; import { AlmKeys } from '../../../../../types/alm-settings'; -import { - ComponentContextShape, - ComponentQualifier, - Visibility, -} from '../../../../../types/component'; +import { ComponentContextShape, Visibility } from '../../../../../types/component'; import { Feature } from '../../../../../types/features'; import { Permissions } from '../../../../../types/permissions'; import { Component, PermissionGroup, PermissionUser, Provider } from '../../../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx index 1a41029936b..59d0ede66e8 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.tsx @@ -27,7 +27,7 @@ import DateFormatter from '../../../components/intl/DateFormatter'; import { toShortISO8601String } from '../../../helpers/dates'; import { translate } from '../../../helpers/l10n'; -import { ComponentQualifier } from '../../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { ParsedAnalysis } from '../../../types/project-activity'; import { AnalysesByDay, Query, activityQueryChanged, getAnalysesByVersionByDay } from '../utils'; import ProjectActivityAnalysis, { BaselineMarker } from './ProjectActivityAnalysis'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppRenderer.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppRenderer.tsx index 4c83ecca72a..fbee22df749 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppRenderer.tsx @@ -26,10 +26,10 @@ import { } from 'design-system'; import * as React from 'react'; import { Helmet } from 'react-helmet-async'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import A11ySkipTarget from '../../../components/a11y/A11ySkipTarget'; import Suggestions from '../../../components/embed-docs-modal/Suggestions'; import { translate } from '../../../helpers/l10n'; -import { ComponentQualifier } from '../../../types/component'; import { MeasureHistory, ParsedAnalysis } from '../../../types/project-activity'; import { Component, Metric } from '../../../types/types'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFilters.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFilters.tsx index f1db8d96cb3..eb2348a7dab 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFilters.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityPageFilters.tsx @@ -19,8 +19,9 @@ */ import { InputSelect, LabelValueSelectOption } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { translate } from '../../../helpers/l10n'; -import { ComponentQualifier, isPortfolioLike } from '../../../types/component'; +import { isPortfolioLike } from '../../../types/component'; import { ApplicationAnalysisEventCategory, ProjectAnalysisEventCategory, diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-it.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-it.tsx index d34221f2e41..d3c150434c0 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-it.tsx @@ -22,6 +22,7 @@ import userEvent from '@testing-library/user-event'; import { keyBy, times } from 'lodash'; import React from 'react'; import { Route } from 'react-router-dom'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import ApplicationServiceMock from '../../../../api/mocks/ApplicationServiceMock'; import { ProjectActivityServiceMock } from '../../../../api/mocks/ProjectActivityServiceMock'; import { TimeMachineServiceMock } from '../../../../api/mocks/TimeMachineServiceMock'; @@ -38,7 +39,6 @@ import { get } from '../../../../helpers/storage'; import { mockMetric } from '../../../../helpers/testMocks'; import { renderAppWithComponentContext } from '../../../../helpers/testReactTestingUtils'; import { byLabelText, byRole, byTestId, byText } from '../../../../helpers/testSelector'; -import { ComponentQualifier } from '../../../../types/component'; import { MetricKey, MetricType } from '../../../../types/metrics'; import { ApplicationAnalysisEventCategory, diff --git a/server/sonar-web/src/main/js/apps/projectDeletion/__tests__/ProjectDeletionApp-it.tsx b/server/sonar-web/src/main/js/apps/projectDeletion/__tests__/ProjectDeletionApp-it.tsx index bd0dcd9a795..d783ed1ea2c 100644 --- a/server/sonar-web/src/main/js/apps/projectDeletion/__tests__/ProjectDeletionApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/projectDeletion/__tests__/ProjectDeletionApp-it.tsx @@ -19,13 +19,14 @@ */ import userEvent from '@testing-library/user-event'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { deleteApplication } from '../../../api/application'; import { deletePortfolio, deleteProject } from '../../../api/project-management'; import { ComponentContext } from '../../../app/components/componentContext/ComponentContext'; import { mockComponent } from '../../../helpers/mocks/component'; import { renderApp } from '../../../helpers/testReactTestingUtils'; import { byRole, byText } from '../../../helpers/testSelector'; -import { ComponentContextShape, ComponentQualifier } from '../../../types/component'; +import { ComponentContextShape } from '../../../types/component'; import { Component } from '../../../types/types'; import App from '../App'; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/__tests__/ProjectInformationApp-it.tsx b/server/sonar-web/src/main/js/apps/projectInformation/__tests__/ProjectInformationApp-it.tsx index ec3bbbf6c69..60a00c4c931 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/__tests__/ProjectInformationApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/__tests__/ProjectInformationApp-it.tsx @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { screen } from '@testing-library/react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock'; import CodingRulesServiceMock from '../../../api/mocks/CodingRulesServiceMock'; import ComponentsServiceMock from '../../../api/mocks/ComponentsServiceMock'; @@ -29,7 +30,7 @@ import { mockComponent } from '../../../helpers/mocks/component'; import { mockCurrentUser, mockLoggedInUser, mockMeasure } from '../../../helpers/testMocks'; import { renderAppWithComponentContext } from '../../../helpers/testReactTestingUtils'; import { byRole } from '../../../helpers/testSelector'; -import { ComponentQualifier, Visibility } from '../../../types/component'; +import { Visibility } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; import { Component } from '../../../types/types'; import { CurrentUser } from '../../../types/users'; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/about/AboutProject.tsx b/server/sonar-web/src/main/js/apps/projectInformation/about/AboutProject.tsx index 086ad5b782a..642955b8ca5 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/about/AboutProject.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/about/AboutProject.tsx @@ -20,9 +20,10 @@ import classNames from 'classnames'; import { BasicSeparator, SubTitle } from 'design-system'; import React, { PropsWithChildren, useEffect, useState } from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getProjectLinks } from '../../../api/projectLinks'; import { translate } from '../../../helpers/l10n'; -import { ComponentQualifier, Visibility } from '../../../types/component'; +import { Visibility } from '../../../types/component'; import { Component, Measure, ProjectLink } from '../../../types/types'; import MetaDescription from './components/MetaDescription'; import MetaKey from './components/MetaKey'; 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 4e51c7275b8..485d2f1e86b 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 @@ -20,10 +20,10 @@ import { DrilldownLink, Note, SizeIndicator, SubHeading } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { localizeMetric } from '../../../../helpers/measures'; import { getComponentDrilldownUrl } from '../../../../helpers/urls'; -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/about/components/MetaTags.tsx b/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaTags.tsx index 81653411f40..ad7ce87ca7b 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaTags.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaTags.tsx @@ -21,11 +21,11 @@ import { Spinner } from '@sonarsource/echoes-react'; import { MultiSelector, SubHeading, Tags } from 'design-system'; import { difference, without } from 'lodash'; import React, { useEffect, useState } from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { searchProjectTags, setApplicationTags, setProjectTags } from '../../../../api/components'; import Tooltip from '../../../../components/controls/Tooltip'; import { PopupPlacement } from '../../../../components/ui/popups'; import { translate } from '../../../../helpers/l10n'; -import { ComponentQualifier } from '../../../../types/component'; import { Component } from '../../../../types/types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/projectInformation/about/components/__tests__/MetaKey-test.tsx b/server/sonar-web/src/main/js/apps/projectInformation/about/components/__tests__/MetaKey-test.tsx index cf7de999d24..c569908cf17 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/about/components/__tests__/MetaKey-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/about/components/__tests__/MetaKey-test.tsx @@ -19,8 +19,8 @@ */ import { screen } from '@testing-library/react'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { renderComponent } from '../../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../../types/component'; import MetaKey from '../MetaKey'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/projectInformation/about/components/__tests__/MetaTags-test.tsx b/server/sonar-web/src/main/js/apps/projectInformation/about/components/__tests__/MetaTags-test.tsx index 8267fa68ff1..3766af65652 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/about/components/__tests__/MetaTags-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/about/components/__tests__/MetaTags-test.tsx @@ -20,10 +20,10 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { setApplicationTags, setProjectTags } from '../../../../../api/components'; import { mockComponent } from '../../../../../helpers/mocks/component'; import { renderComponent } from '../../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../../types/component'; import { Component } from '../../../../../types/types'; import MetaTags from '../MetaTags'; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/ProjectBadges-test.tsx b/server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/ProjectBadges-test.tsx index 240d5917a8a..cf5ac702008 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/ProjectBadges-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/ProjectBadges-test.tsx @@ -21,12 +21,12 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; import selectEvent from 'react-select-event'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getProjectBadgesToken } from '../../../../api/project-badges'; import { mockBranch } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/mocks/component'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { Location } from '../../../../helpers/urls'; -import { ComponentQualifier } from '../../../../types/component'; import { MetricKey } from '../../../../types/metrics'; import ProjectBadges, { ProjectBadgesProps } from '../ProjectBadges'; import { BadgeType } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx index 738c3cbaf5f..4858fda67d6 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx @@ -32,6 +32,7 @@ import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { useSearchParams } from 'react-router-dom'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Location, RawQuery, Router } from '~sonar-aligned/types/router'; import { searchProjects } from '../../../api/components'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; @@ -45,7 +46,6 @@ import { translate } from '../../../helpers/l10n'; import { get, save } from '../../../helpers/storage'; import { isDefined } from '../../../helpers/types'; import { AppState } from '../../../types/appstate'; -import { ComponentQualifier } from '../../../types/component'; import { MetricKey } from '../../../types/metrics'; import { CurrentUser, isLoggedIn } from '../../../types/users'; import { Query, hasFilterParams, parseUrlQuery } from '../query'; 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 a2ad67b9f0c..5990e6544f2 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 @@ -21,6 +21,7 @@ import { ButtonSecondary } from 'design-system'; import * as React from 'react'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; import { throwGlobalError } from '~sonar-aligned/helpers/error'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Router } from '~sonar-aligned/types/router'; import { getComponentNavigation } from '../../../api/navigation'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; @@ -30,7 +31,6 @@ import { translate } from '../../../helpers/l10n'; import { getComponentAdminUrl, getComponentOverviewUrl } from '../../../helpers/urls'; import { hasGlobalPermission } from '../../../helpers/users'; import { AppState } from '../../../types/appstate'; -import { ComponentQualifier } from '../../../types/component'; import { Permissions } from '../../../types/permissions'; import { LoggedInUser } from '../../../types/users'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx index 9c70f662718..764553be846 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx @@ -21,12 +21,12 @@ import { screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; import { AutoSizerProps } from 'react-virtualized'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { ProjectsServiceMock } from '../../../../api/mocks/ProjectsServiceMock'; import { save } from '../../../../helpers/storage'; import { mockAppState, mockLoggedInUser } from '../../../../helpers/testMocks'; import { renderAppRoutes } from '../../../../helpers/testReactTestingUtils'; import { byLabelText, byRole, byText } from '../../../../helpers/testSelector'; -import { ComponentQualifier } from '../../../../types/component'; import { MetricKey } from '../../../../types/metrics'; import { Dict } from '../../../../types/types'; import projectRoutes from '../../routes'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/CreateApplication-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/CreateApplication-test.tsx index b27d521398a..c5702b57466 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/CreateApplication-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/CreateApplication-test.tsx @@ -20,12 +20,13 @@ import userEvent from '@testing-library/user-event'; import * as React from 'react'; import { queryToSearch } from '~sonar-aligned/helpers/urls'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { createApplication } from '../../../../api/application'; import { getComponentNavigation } from '../../../../api/navigation'; import { mockAppState, mockLoggedInUser, mockRouter } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { byRole, byText } from '../../../../helpers/testSelector'; -import { ComponentQualifier, Visibility } from '../../../../types/component'; +import { Visibility } from '../../../../types/component'; import { FCProps } from '../../../../types/misc'; import { LoggedInUser } from '../../../../types/users'; import { ApplicationCreation } from '../ApplicationCreation'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageHeader-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageHeader-test.tsx index ddc1f48f1e6..9913d211aea 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageHeader-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/PageHeader-test.tsx @@ -19,13 +19,13 @@ */ import userEvent from '@testing-library/user-event'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getAlmSettings } from '../../../../api/alm-settings'; import CurrentUserContextProvider from '../../../../app/components/current-user/CurrentUserContextProvider'; import { mockAppState, mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { byLabelText, byRole, byText } from '../../../../helpers/testSelector'; import { AlmKeys } from '../../../../types/alm-settings'; -import { ComponentQualifier } from '../../../../types/component'; import { FCProps } from '../../../../types/misc'; import { CurrentUser } from '../../../../types/users'; import PageHeader from '../PageHeader'; 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 cb188571bf0..b2e6a415f25 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 @@ -38,6 +38,7 @@ import { isEmpty } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import Favorite from '../../../../components/controls/Favorite'; import Tooltip from '../../../../components/controls/Tooltip'; import DateFromNow from '../../../../components/intl/DateFromNow'; @@ -46,7 +47,6 @@ import Measure from '../../../../components/measure/Measure'; import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { isDefined } from '../../../../helpers/types'; import { getProjectUrl } from '../../../../helpers/urls'; -import { ComponentQualifier } from '../../../../types/component'; import { MetricKey, MetricType } from '../../../../types/metrics'; import { Status } from '../../../../types/types'; import { CurrentUser, isLoggedIn } from '../../../../types/users'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx index 352418538c0..420e38cd77b 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCardMeasures.tsx @@ -26,12 +26,12 @@ import { RatingLabel, } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import Measure from '../../../../components/measure/Measure'; import { duplicationRatingConverter } from '../../../../components/measure/utils'; import { translate } from '../../../../helpers/l10n'; import { formatRating } from '../../../../helpers/measures'; import { isDefined } from '../../../../helpers/types'; -import { ComponentQualifier } from '../../../../types/component'; import { MetricKey, MetricType } from '../../../../types/metrics'; import { Dict } from '../../../../types/types'; import ProjectCardMeasure from './ProjectCardMeasure'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCard-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCard-test.tsx index a81aab52c17..fdcdaf6af55 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCard-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCard-test.tsx @@ -19,9 +19,10 @@ */ import { screen } from '@testing-library/react'; import React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockCurrentUser, mockLoggedInUser } from '../../../../../helpers/testMocks'; import { renderComponent } from '../../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier, Visibility } from '../../../../../types/component'; +import { Visibility } from '../../../../../types/component'; import { MetricKey } from '../../../../../types/metrics'; import { CurrentUser } from '../../../../../types/users'; import { Project } from '../../../types'; diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCardMeasures-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCardMeasures-test.tsx index 7efa8f2e5f3..10513b0e743 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCardMeasures-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/__tests__/ProjectCardMeasures-test.tsx @@ -20,8 +20,8 @@ import { screen } from '@testing-library/react'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { renderComponent } from '../../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../../types/component'; import { MetricKey } from '../../../../../types/metrics'; import { Dict } from '../../../../../types/types'; import ProjectCardMeasures, { ProjectCardMeasuresProps } from '../ProjectCardMeasures'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx index 561806853bb..85bf80a8c35 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/QualifierFilter.tsx @@ -19,10 +19,10 @@ */ import { FacetBox, FacetItem } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { RawQuery } from '~sonar-aligned/types/router'; import { translate } from '../../../helpers/l10n'; import { isDefined } from '../../../helpers/types'; -import { ComponentQualifier } from '../../../types/component'; import { FacetItemsList } from '../../issues/sidebar/FacetItemsList'; import { formatFacetStat } from '../../issues/utils'; import { Facet } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/projects/query.ts b/server/sonar-web/src/main/js/apps/projects/query.ts index 978b0991430..2635b966faf 100644 --- a/server/sonar-web/src/main/js/apps/projects/query.ts +++ b/server/sonar-web/src/main/js/apps/projects/query.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 { ComponentQualifier } from '~sonar-aligned/types/component'; import { RawQuery } from '~sonar-aligned/types/router'; -import { ComponentQualifier } from '../../types/component'; import { Dict } from '../../types/types'; type Level = 'ERROR' | 'WARN' | 'OK'; diff --git a/server/sonar-web/src/main/js/apps/projects/types.ts b/server/sonar-web/src/main/js/apps/projects/types.ts index b621422b6a8..437faeb5870 100644 --- a/server/sonar-web/src/main/js/apps/projects/types.ts +++ b/server/sonar-web/src/main/js/apps/projects/types.ts @@ -17,7 +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 { ComponentQualifier, Visibility } from '../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { Visibility } from '../../types/component'; import { Dict } from '../../types/types'; export interface Project { diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx index 4aff6bcc288..915cea83100 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx @@ -21,6 +21,7 @@ import { Checkbox, LinkHighlight, LinkStandalone } from '@sonarsource/echoes-react'; import { ActionCell, Badge, ContentCell, Note, TableRow } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Project } from '../../api/project-management'; import PrivacyBadgeContainer from '../../components/common/PrivacyBadgeContainer'; import Tooltip from '../../components/controls/Tooltip'; @@ -28,7 +29,6 @@ import DateFormatter from '../../components/intl/DateFormatter'; import { translate, translateWithParameters } from '../../helpers/l10n'; import { getComponentOverviewUrl } from '../../helpers/urls'; import { useGithubProvisioningEnabledQuery } from '../../queries/identity-provider/github'; -import { ComponentQualifier } from '../../types/component'; import { LoggedInUser } from '../../types/users'; import ProjectRowActions from './ProjectRowActions'; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectManagementApp-it.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectManagementApp-it.tsx index 598c13ecd90..cbf80bc1704 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectManagementApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectManagementApp-it.tsx @@ -20,6 +20,7 @@ import { screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import selectEvent from 'react-select-event'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import GithubProvisioningServiceMock from '../../../api/mocks/GithubProvisioningServiceMock'; import PermissionsServiceMock from '../../../api/mocks/PermissionsServiceMock'; import ProjectManagementServiceMock from '../../../api/mocks/ProjectsManagementServiceMock'; @@ -30,7 +31,6 @@ import { mockAppState, mockCurrentUser } from '../../../helpers/testMocks'; import { RenderContext, renderAppWithAdminContext } from '../../../helpers/testReactTestingUtils'; import { byPlaceholderText, byRole, byText } from '../../../helpers/testSelector'; import { AppState } from '../../../types/appstate'; -import { ComponentQualifier } from '../../../types/component'; import { Feature } from '../../../types/features'; import { Permissions } from '../../../types/permissions'; import { GlobalSettingKeys } from '../../../types/settings'; 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 c7a59014fd6..408950cba1a 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 @@ -22,6 +22,7 @@ import { flatMap, range } from 'lodash'; import * as React from 'react'; import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Location, Router } from '~sonar-aligned/types/router'; import { getMeasures } from '../../api/measures'; import { getSecurityHotspotList, getSecurityHotspots } from '../../api/security-hotspots'; @@ -35,7 +36,6 @@ import { KeyboardKeys } from '../../helpers/keycodes'; import { getStandards } from '../../helpers/security-standard'; import { withBranchLikes } from '../../queries/branch'; import { BranchLike } from '../../types/branch-like'; -import { ComponentQualifier } from '../../types/component'; import { MetricKey } from '../../types/metrics'; import { SecurityStandard, Standards } from '../../types/security'; import { 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 4cd77d139e3..64efe95a09d 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 @@ -32,12 +32,12 @@ import { import * as React from 'react'; import { Helmet } from 'react-helmet-async'; import { isBranch } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; 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 { BranchLike } from '../../types/branch-like'; -import { ComponentQualifier } from '../../types/component'; import { MetricKey } from '../../types/metrics'; import { SecurityStandard, Standards } from '../../types/security'; import { HotspotFilters, HotspotStatusFilter, RawHotspot } from '../../types/security-hotspots'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSimpleList.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSimpleList.tsx index 6772aa542e6..b7729278627 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSimpleList.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSimpleList.tsx @@ -25,9 +25,9 @@ import { FormattedMessage } from 'react-intl'; import ListFooter from '../../../components/controls/ListFooter'; import Tooltip from '../../../components/controls/Tooltip'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { translate } from '../../../helpers/l10n'; import { fileFromPath } from '../../../helpers/path'; -import { ComponentQualifier } from '../../../types/component'; import { SecurityStandard, Standards } from '../../../types/security'; import { RawHotspot } from '../../../types/security-hotspots'; import { SECURITY_STANDARD_RENDERER } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetHeader.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetHeader.tsx index 11e179a5dda..54673c08fcd 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetHeader.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetHeader.tsx @@ -24,11 +24,11 @@ import React from 'react'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; import { LinkHighlight, LinkStandalone } from '@sonarsource/echoes-react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { translate } from '../../../helpers/l10n'; import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path'; import { getBranchLikeUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { Hotspot } from '../../../types/security-hotspots'; import { Component } from '../../../types/types'; import { CurrentUser, isLoggedIn } from '../../../types/users'; 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 49c1aaac719..c41844ccf73 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx @@ -22,6 +22,7 @@ import { FlagMessage } from 'design-system'; import { intersection } from 'lodash'; import * as React from 'react'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getComponentData, getComponentForSourceViewer, @@ -33,7 +34,6 @@ import { isSameBranchLike } from '../../helpers/branch-like'; import { translate } from '../../helpers/l10n'; import { HttpStatus } from '../../helpers/request'; import { BranchLike } from '../../types/branch-like'; -import { ComponentQualifier } from '../../types/component'; import { Dict, DuplicatedFile, 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 694b4442a7b..a160a53f172 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx @@ -44,6 +44,7 @@ import { getComponentIssuesUrl, getComponentSecurityHotspotsUrl, } from '~sonar-aligned/helpers/urls'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { SOFTWARE_QUALITIES } from '../../helpers/constants'; import { ISSUETYPE_METRIC_KEYS_MAP, @@ -57,7 +58,6 @@ import { getBaseUrl } from '../../helpers/system'; import { isDefined } from '../../helpers/types'; import { getBranchLikeUrl, getCodeUrl } from '../../helpers/urls'; import type { BranchLike } from '../../types/branch-like'; -import { ComponentQualifier } from '../../types/component'; import { IssueType } from '../../types/issues'; import { MetricKey, MetricType } from '../../types/metrics'; import type { Measure, SourceViewerFile } from '../../types/types'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx index 0d3425ae7a8..12bfd4b176c 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx @@ -26,12 +26,12 @@ import { } from 'design-system'; import { groupBy, sortBy } from 'lodash'; import React, { Fragment, PureComponent } from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { isPullRequest } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path'; import { getProjectUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import { Dict, DuplicatedFile, DuplicationBlock, SourceViewerFile } from '../../../types/types'; import { WorkspaceContextShape } from '../../workspace/context'; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/loadIssues-test.ts b/server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/loadIssues-test.ts index 782581abcae..7d778dce69a 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/loadIssues-test.ts +++ b/server/sonar-web/src/main/js/components/SourceViewer/helpers/__tests__/loadIssues-test.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 { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockMainBranch } from '../../../../helpers/mocks/branch-like'; import { mockRawIssue } from '../../../../helpers/testMocks'; -import { ComponentQualifier } from '../../../../types/component'; import { IssueStatus, IssueType } from '../../../../types/issues'; import loadIssues from '../loadIssues'; diff --git a/server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx b/server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx index f96fcca20d8..b4877182d8d 100644 --- a/server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx +++ b/server/sonar-web/src/main/js/components/controls/ComponentReportActions.tsx @@ -20,6 +20,7 @@ import { addGlobalSuccessMessage } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getReportStatus, subscribeToEmailReport, @@ -30,7 +31,6 @@ import withCurrentUserContext from '../../app/components/current-user/withCurren import { translate, translateWithParameters } from '../../helpers/l10n'; import { AppState } from '../../types/appstate'; import { Branch } from '../../types/branch-like'; -import { ComponentQualifier } from '../../types/component'; import { ComponentReportStatus } from '../../types/component-report'; import { Component } from '../../types/types'; import { CurrentUser, isLoggedIn } from '../../types/users'; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ComponentReportActions-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ComponentReportActions-test.tsx index bce01b501c0..8fc443d6fb9 100644 --- a/server/sonar-web/src/main/js/components/controls/__tests__/ComponentReportActions-test.tsx +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ComponentReportActions-test.tsx @@ -21,6 +21,7 @@ import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { addGlobalSuccessMessage } from 'design-system'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getReportStatus, subscribeToEmailReport, @@ -31,7 +32,6 @@ import { mockComponent } from '../../../helpers/mocks/component'; import { mockComponentReportStatus } from '../../../helpers/mocks/component-report'; import { mockAppState, mockCurrentUser, mockLoggedInUser } from '../../../helpers/testMocks'; import { renderApp } from '../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../types/component'; import { ComponentReportActions } from '../ComponentReportActions'; jest.mock('design-system', () => ({ diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/Favorite-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/Favorite-test.tsx index 946a5ca6ead..5d3751a418c 100644 --- a/server/sonar-web/src/main/js/components/controls/__tests__/Favorite-test.tsx +++ b/server/sonar-web/src/main/js/components/controls/__tests__/Favorite-test.tsx @@ -20,9 +20,9 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { addFavorite, removeFavorite } from '../../../api/favorites'; import { renderComponent } from '../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../types/component'; import Favorite from '../Favorite'; jest.mock('../../../api/favorites', () => ({ diff --git a/server/sonar-web/src/main/js/components/workspace/__tests__/Workspace-test.tsx b/server/sonar-web/src/main/js/components/workspace/__tests__/Workspace-test.tsx index 12e7f9eadbe..87d712c22dd 100644 --- a/server/sonar-web/src/main/js/components/workspace/__tests__/Workspace-test.tsx +++ b/server/sonar-web/src/main/js/components/workspace/__tests__/Workspace-test.tsx @@ -19,12 +19,12 @@ */ import userEvent from '@testing-library/user-event'; import * as React from 'react'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockBranch } from '../../../helpers/mocks/branch-like'; import { get, save } from '../../../helpers/storage'; import { renderComponent } from '../../../helpers/testReactTestingUtils'; import { byRole, byText } from '../../../helpers/testSelector'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; import Workspace, { TYPE_KEY, WorkspaceTypes } from '../Workspace'; import { WorkspaceContext } from '../context'; 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 0cd087323f2..842db372470 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 @@ -19,8 +19,8 @@ */ import { searchParamsToQuery } from '~sonar-aligned/helpers/router'; import { queryToSearch } from '~sonar-aligned/helpers/urls'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { AlmKeys } from '../../types/alm-settings'; -import { ComponentQualifier } from '../../types/component'; import { IssueType } from '../../types/issues'; import { MeasurePageView } from '../../types/measures'; import { mockBranch, mockMainBranch, mockPullRequest } from '../mocks/branch-like'; diff --git a/server/sonar-web/src/main/js/helpers/constants.ts b/server/sonar-web/src/main/js/helpers/constants.ts index c11d35de71b..76ddb109484 100644 --- a/server/sonar-web/src/main/js/helpers/constants.ts +++ b/server/sonar-web/src/main/js/helpers/constants.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 { ComponentQualifier } from '~sonar-aligned/types/component'; import { colors } from '../app/theme'; import { AlmKeys } from '../types/alm-settings'; import { @@ -25,7 +26,6 @@ import { SoftwareImpactSeverity, SoftwareQuality, } from '../types/clean-code-taxonomy'; -import { ComponentQualifier } from '../types/component'; import { IssueResolution, IssueScope, diff --git a/server/sonar-web/src/main/js/helpers/mocks/component.ts b/server/sonar-web/src/main/js/helpers/mocks/component.ts index c041fe9483b..d3fec7e4e20 100644 --- a/server/sonar-web/src/main/js/helpers/mocks/component.ts +++ b/server/sonar-web/src/main/js/helpers/mocks/component.ts @@ -17,7 +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 { ComponentQualifier, TreeComponent, Visibility } from '../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { TreeComponent, Visibility } from '../../types/component'; import { MetricKey } from '../../types/metrics'; import { Component, ComponentMeasure, ComponentMeasureEnhanced } from '../../types/types'; import { mockMeasureEnhanced } from '../testMocks'; diff --git a/server/sonar-web/src/main/js/helpers/mocks/projects.ts b/server/sonar-web/src/main/js/helpers/mocks/projects.ts index 39f327a107f..a781055695f 100644 --- a/server/sonar-web/src/main/js/helpers/mocks/projects.ts +++ b/server/sonar-web/src/main/js/helpers/mocks/projects.ts @@ -17,8 +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 { ComponentQualifier } from '~sonar-aligned/types/component'; import { Project } from '../../api/project-management'; -import { ComponentQualifier, Visibility } from '../../types/component'; +import { Visibility } from '../../types/component'; export function mockProject(overrides: Partial<Project> = {}): Project { return { diff --git a/server/sonar-web/src/main/js/helpers/mocks/security-hotspots.ts b/server/sonar-web/src/main/js/helpers/mocks/security-hotspots.ts index 7d76843e6de..ccb2f630b0e 100644 --- a/server/sonar-web/src/main/js/helpers/mocks/security-hotspots.ts +++ b/server/sonar-web/src/main/js/helpers/mocks/security-hotspots.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { HotspotRatingEnum } from 'design-system'; -import { ComponentQualifier } from '../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Standards } from '../../types/security'; import { Hotspot, diff --git a/server/sonar-web/src/main/js/helpers/mocks/sources.ts b/server/sonar-web/src/main/js/helpers/mocks/sources.ts index f4126f2d8a5..3cd1fc937e3 100644 --- a/server/sonar-web/src/main/js/helpers/mocks/sources.ts +++ b/server/sonar-web/src/main/js/helpers/mocks/sources.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 { ComponentQualifier } from '../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { DuplicatedFile, Duplication, diff --git a/server/sonar-web/src/main/js/helpers/mocks/tasks.ts b/server/sonar-web/src/main/js/helpers/mocks/tasks.ts index 19ccd5345e2..f7554515b06 100644 --- a/server/sonar-web/src/main/js/helpers/mocks/tasks.ts +++ b/server/sonar-web/src/main/js/helpers/mocks/tasks.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { uniqueId } from 'lodash'; -import { ComponentQualifier } from '../../types/component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Task, TaskStatuses, TaskTypes, TaskWarning } from '../../types/tasks'; export function mockTask(overrides: Partial<Task> = {}): Task { diff --git a/server/sonar-web/src/main/js/helpers/testMocks.ts b/server/sonar-web/src/main/js/helpers/testMocks.ts index 4e9f2400902..b2ae3877adc 100644 --- a/server/sonar-web/src/main/js/helpers/testMocks.ts +++ b/server/sonar-web/src/main/js/helpers/testMocks.ts @@ -19,6 +19,7 @@ */ import { omit } from 'lodash'; import { To } from 'react-router-dom'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { Location, Router } from '~sonar-aligned/types/router'; import { CompareResponse } from '../api/quality-profiles'; import { RuleDescriptionSections } from '../apps/coding-rules/rule'; @@ -33,7 +34,6 @@ import { SoftwareQuality, } from '../types/clean-code-taxonomy'; import { RuleRepository } from '../types/coding-rules'; -import { ComponentQualifier } from '../types/component'; import { EditionKey } from '../types/editions'; import { IssueDeprecatedStatus, diff --git a/server/sonar-web/src/main/js/helpers/urls.ts b/server/sonar-web/src/main/js/helpers/urls.ts index dd95ec6b079..c4fa26967fe 100644 --- a/server/sonar-web/src/main/js/helpers/urls.ts +++ b/server/sonar-web/src/main/js/helpers/urls.ts @@ -21,10 +21,11 @@ import { Path, To } from 'react-router-dom'; import { getBranchLikeQuery, isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; import { queryToSearch } from '~sonar-aligned/helpers/urls'; import { BranchParameters } from '~sonar-aligned/types/branch-like'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { getProfilePath } from '../apps/quality-profiles/utils'; import { DEFAULT_ISSUES_QUERY } from '../components/shared/utils'; import { BranchLike } from '../types/branch-like'; -import { ComponentQualifier, isApplication, isPortfolioLike } from '../types/component'; +import { isApplication, isPortfolioLike } from '../types/component'; import { MeasurePageView } from '../types/measures'; import { GraphType } from '../types/project-activity'; import { Dict } from '../types/types'; diff --git a/server/sonar-web/src/main/js/sonar-aligned/types/component.ts b/server/sonar-web/src/main/js/sonar-aligned/types/component.ts new file mode 100644 index 00000000000..347769b5b9f --- /dev/null +++ b/server/sonar-web/src/main/js/sonar-aligned/types/component.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +export enum ComponentQualifier { + Application = 'APP', + Directory = 'DIR', + Developer = 'DEV', + File = 'FIL', + Portfolio = 'VW', + Project = 'TRK', + SubPortfolio = 'SVW', + SubProject = 'BRC', + TestFile = 'UTS', +} diff --git a/server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap b/server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap index 11feb73a504..519f2d6f978 100644 --- a/server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap +++ b/server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap @@ -3,6 +3,8 @@ exports[`[Function isApplication] should work properly 1`] = ` { "APP": true, + "BRC": false, + "DEV": false, "DIR": false, "FIL": false, "SVW": false, @@ -15,6 +17,8 @@ exports[`[Function isApplication] should work properly 1`] = ` exports[`[Function isFile] should work properly 1`] = ` { "APP": false, + "BRC": false, + "DEV": false, "DIR": false, "FIL": true, "SVW": false, @@ -27,6 +31,8 @@ exports[`[Function isFile] should work properly 1`] = ` exports[`[Function isPortfolioLike] should work properly 1`] = ` { "APP": false, + "BRC": false, + "DEV": false, "DIR": false, "FIL": false, "SVW": true, @@ -39,6 +45,8 @@ exports[`[Function isPortfolioLike] should work properly 1`] = ` exports[`[Function isProject] should work properly 1`] = ` { "APP": false, + "BRC": false, + "DEV": false, "DIR": false, "FIL": false, "SVW": false, @@ -51,6 +59,8 @@ exports[`[Function isProject] should work properly 1`] = ` exports[`[Function isView] should work properly 1`] = ` { "APP": true, + "BRC": false, + "DEV": false, "DIR": false, "FIL": false, "SVW": true, diff --git a/server/sonar-web/src/main/js/types/__tests__/component-test.ts b/server/sonar-web/src/main/js/types/__tests__/component-test.ts index c94b8417e19..f024bff9c14 100644 --- a/server/sonar-web/src/main/js/types/__tests__/component-test.ts +++ b/server/sonar-web/src/main/js/types/__tests__/component-test.ts @@ -17,14 +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 { - ComponentQualifier, - isApplication, - isFile, - isPortfolioLike, - isProject, - isView, -} from '../component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { isApplication, isFile, isPortfolioLike, isProject, isView } from '../component'; it.each([[isFile], [isView], [isProject], [isApplication], [isPortfolioLike]])( '%p should work properly', diff --git a/server/sonar-web/src/main/js/types/component.ts b/server/sonar-web/src/main/js/types/component.ts index 416034aba9b..b70eaca84f1 100644 --- a/server/sonar-web/src/main/js/types/component.ts +++ b/server/sonar-web/src/main/js/types/component.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 { ComponentQualifier } from '~sonar-aligned/types/component'; import { Task } from './tasks'; import { Component, LightComponent } from './types'; @@ -25,16 +26,6 @@ export enum Visibility { Private = 'private', } -export enum ComponentQualifier { - Application = 'APP', - Directory = 'DIR', - File = 'FIL', - Portfolio = 'VW', - Project = 'TRK', - SubPortfolio = 'SVW', - TestFile = 'UTS', -} - export enum ProjectKeyValidationResult { Valid = 'valid', Empty = 'empty', diff --git a/server/sonar-web/src/main/js/types/security-hotspots.ts b/server/sonar-web/src/main/js/types/security-hotspots.ts index f30cd41a4e3..9b9934f19dd 100644 --- a/server/sonar-web/src/main/js/types/security-hotspots.ts +++ b/server/sonar-web/src/main/js/types/security-hotspots.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { HotspotRatingEnum } from 'design-system'; -import { ComponentQualifier } from './component'; +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { MessageFormatting } from './issues'; import { FlowLocation, IssueChangelog, IssueChangelogDiff, Paging, TextRange } from './types'; import { UserBase } from './users'; diff --git a/server/sonar-web/src/main/js/types/types.ts b/server/sonar-web/src/main/js/types/types.ts index 31874615a18..cfb310e230c 100644 --- a/server/sonar-web/src/main/js/types/types.ts +++ b/server/sonar-web/src/main/js/types/types.ts @@ -17,13 +17,14 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { ComponentQualifier } from '~sonar-aligned/types/component'; import { RuleDescriptionSection } from '../apps/coding-rules/rule'; import { CleanCodeAttribute, CleanCodeAttributeCategory, SoftwareImpact, } from './clean-code-taxonomy'; -import { ComponentQualifier, Visibility } from './component'; +import { Visibility } from './component'; import { IssueStatus, IssueTransition, MessageFormatting } from './issues'; import { NewCodeDefinitionType } from './new-code-definition'; import { UserActive, UserBase } from './users'; |