diff options
author | Viktor Vorona <viktor.vorona@sonarsource.com> | 2024-04-25 16:15:10 +0200 |
---|---|---|
committer | Matteo Mara <matteo.mara@sonarsource.com> | 2024-04-30 10:59:04 +0200 |
commit | 3ed9a8fb882a5f69cfac321007139916f687cdf0 (patch) | |
tree | 997be95eb2e66af8a29223bf7daa3e7c06ad4a05 /server/sonar-web/src/main/js/apps | |
parent | dade4edf434e12c90e9c39b114047540b5d352b6 (diff) | |
download | sonarqube-3ed9a8fb882a5f69cfac321007139916f687cdf0.tar.gz sonarqube-3ed9a8fb882a5f69cfac321007139916f687cdf0.zip |
SONAR-22049 Align MetricKey, MetricType
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
93 files changed, 95 insertions, 95 deletions
diff --git a/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx b/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx index c314f388849..b655713b167 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx +++ b/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx @@ -28,13 +28,13 @@ import { } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import MetaLink from '../../../components/common/MetaLink'; import Tooltip from '../../../components/controls/Tooltip'; import DateFromNow from '../../../components/intl/DateFromNow'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { orderLinks } from '../../../helpers/projectLinks'; import { getProjectUrl } from '../../../helpers/urls'; -import { MetricType } from '../../../types/metrics'; import { MyProject, ProjectLink, Status } from '../../../types/types'; 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 0b47121cad7..69f25326f11 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 @@ -22,6 +22,7 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock'; import ComponentsServiceMock from '../../../api/mocks/ComponentsServiceMock'; import IssuesServiceMock from '../../../api/mocks/IssuesServiceMock'; @@ -31,7 +32,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 { MetricKey } from '../../../types/metrics'; import { Component } from '../../../types/types'; import routes from '../routes'; diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx index 6092b1081fc..98f076fbee3 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.tsx @@ -27,6 +27,7 @@ import { } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import Measure from '../../../components/measure/Measure'; import { getLeakValue } from '../../../components/measure/utils'; import { @@ -39,7 +40,6 @@ import { isDiffMetric, } from '../../../helpers/measures'; import { isApplication, isProject } from '../../../types/component'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { Metric, Status, ComponentMeasure as TypeComponentMeasure } from '../../../types/types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx index c0ffe39b973..7c5f749e512 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx @@ -19,13 +19,13 @@ */ import { ContentCell, NumericalCell, RatingCell } from 'design-system'; import * as React from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { CCT_SOFTWARE_QUALITY_METRICS, OLD_TO_NEW_TAXONOMY_METRICS_MAP, } from '../../../helpers/constants'; import { translate } from '../../../helpers/l10n'; import { isPortfolioLike } from '../../../types/component'; -import { MetricKey } from '../../../types/metrics'; import { ComponentMeasure } from '../../../types/types'; interface ComponentsHeaderProps { 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 89d9333d7c1..60a43d3cd4b 100644 --- a/server/sonar-web/src/main/js/apps/code/utils.ts +++ b/server/sonar-web/src/main/js/apps/code/utils.ts @@ -19,12 +19,12 @@ */ import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey } from '~sonar-aligned/types/metrics'; 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 { isPortfolioLike } from '../../types/component'; -import { MetricKey } from '../../types/metrics'; import { Breadcrumb, ComponentMeasure } from '../../types/types'; import { addComponent, diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx index de69a9319e9..d1d0a55ad19 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx @@ -20,11 +20,11 @@ import { ButtonPrimary, FlagMessage, FormField, Modal, Spinner } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { Profile, bulkActivateRules, bulkDeactivateRules } from '../../../api/quality-profiles'; import withLanguagesContext from '../../../app/components/languages/withLanguagesContext'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { Languages } from '../../../types/languages'; -import { MetricType } from '../../../types/metrics'; import { Dict } from '../../../types/types'; import { Query, serializeQuery } from '../query'; import { QualityProfileSelector } from './QualityProfileSelector'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx index cabaca83040..eb4d06aba2f 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx @@ -22,9 +22,9 @@ import { FacetBox, FacetItem } from 'design-system'; import { orderBy, sortBy, without } from 'lodash'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import Tooltip from '../../../components/controls/Tooltip'; import { translate } from '../../../helpers/l10n'; -import { MetricType } from '../../../types/metrics'; import { Dict } from '../../../types/types'; import { FacetItemsList } from '../../issues/sidebar/FacetItemsList'; import { MultipleSelectionHint } from '../../issues/sidebar/MultipleSelectionHint'; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx index 2813d2bf9c6..c09f2c8b9c0 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx @@ -22,6 +22,7 @@ import { keyBy } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { getComponentData } from '../../../api/components'; import { getFacet } from '../../../api/issues'; import withAvailableFeatures, { @@ -33,7 +34,6 @@ import { translate } from '../../../helpers/l10n'; import { getIssuesUrl } from '../../../helpers/urls'; import { Feature } from '../../../types/features'; import { FacetName } from '../../../types/issues'; -import { MetricType } from '../../../types/metrics'; import { Dict, RuleDetails } from '../../../types/types'; interface Props extends WithAvailableFeaturesProps { 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 3bd91c2e763..622cdbe9b28 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 @@ -22,6 +22,7 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock'; import ComponentsServiceMock from '../../../api/mocks/ComponentsServiceMock'; import IssuesServiceMock from '../../../api/mocks/IssuesServiceMock'; @@ -32,7 +33,6 @@ import { renderAppWithComponentContext } from '../../../helpers/testReactTesting import { byLabelText, byRole, byTestId, byText } from '../../../helpers/testSelector'; import { ComponentContextShape } from '../../../types/component'; import { Feature } from '../../../types/features'; -import { MetricKey } from '../../../types/metrics'; import routes from '../routes'; jest.mock('lodash', () => ({ 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 23eca5a2f0d..fac4fe99f9c 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 @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { MeasurePageView } from '../../../types/measures'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { ComponentMeasure } from '../../../types/types'; import * as utils from '../utils'; 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 80ad48f8a8f..a699e6a12cb 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 @@ -35,6 +35,7 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; import { Location, Router } from '~sonar-aligned/types/router'; import { getMeasuresWithPeriod } from '../../../api/measures'; import { getAllMetrics } from '../../../api/metrics'; @@ -49,7 +50,6 @@ import { areLeakAndOverallCCTMeasuresComputed } from '../../../helpers/measures' import { WithBranchLikesProps, useBranchesQuery } from '../../../queries/branch'; import { isPortfolioLike } from '../../../types/component'; import { MeasurePageView } from '../../../types/measures'; -import { MetricKey } from '../../../types/metrics'; import { ComponentMeasure, Dict, MeasureEnhanced, Metric, Period } from '../../../types/types'; import Sidebar from '../sidebar/Sidebar'; import { diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx index 2d217fc8a1c..51ed61698e4 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx @@ -20,6 +20,7 @@ import { Highlight, KeyboardHint } from 'design-system'; import * as React from 'react'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { Router } from '~sonar-aligned/types/router'; import { getComponentTree } from '../../../api/components'; import { getMeasures } from '../../../api/measures'; @@ -37,7 +38,6 @@ import { getProjectUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { isApplication, isFile, isView } from '../../../types/component'; import { MeasurePageView } from '../../../types/measures'; -import { MetricKey } from '../../../types/metrics'; import { ComponentMeasure, ComponentMeasureEnhanced, 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 7f87036451a..c0ee151f811 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 @@ -23,6 +23,7 @@ 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 { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import LanguageDistribution from '../../../components/charts/LanguageDistribution'; import Tooltip from '../../../components/controls/Tooltip'; import Measure from '../../../components/measure/Measure'; @@ -30,7 +31,6 @@ import { getLocalizedMetricName, translate, translateWithParameters } from '../. import { isDiffMetric } from '../../../helpers/measures'; import { getMeasureHistoryUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { ComponentMeasure, Metric, Period, Measure as TypeMeasure } from '../../../types/types'; import { getMetricSubnavigationName, hasFullMeasures } from '../utils'; import LeakPeriodLegend from './LeakPeriodLegend'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/config/bubbles.ts b/server/sonar-web/src/main/js/apps/component-measures/config/bubbles.ts index e6cb99ca833..1f0eeb1771a 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/config/bubbles.ts +++ b/server/sonar-web/src/main/js/apps/component-measures/config/bubbles.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 { MetricKey } from '../../../types/metrics'; +import { MetricKey } from '~sonar-aligned/types/metrics'; export const bubbles: { [domain: string]: { diff --git a/server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts b/server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts index b47adbdc3eb..bd6c430b8c5 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/config/complementary.ts +++ b/server/sonar-web/src/main/js/apps/component-measures/config/complementary.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 { MetricKey } from '../../../types/metrics'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { Dict } from '../../../types/types'; export const complementary: Dict<MetricKey[]> = { diff --git a/server/sonar-web/src/main/js/apps/component-measures/config/domains.ts b/server/sonar-web/src/main/js/apps/component-measures/config/domains.ts index b9c6fcd8f3e..6eb98c969f2 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/config/domains.ts +++ b/server/sonar-web/src/main/js/apps/component-measures/config/domains.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 { MetricKey } from '../../../types/metrics'; +import { MetricKey } from '~sonar-aligned/types/metrics'; interface Domains { [domain: string]: { categories?: string[]; order: string[] }; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChartView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChartView.tsx index cc448a7e477..a635695ddb7 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChartView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChartView.tsx @@ -29,6 +29,7 @@ import { import * as React from 'react'; import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { getLocalizedMetricDomain, getLocalizedMetricName, @@ -40,7 +41,6 @@ import { isDefined } from '../../../helpers/types'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { isProject, isView } from '../../../types/component'; -import { MetricKey } from '../../../types/metrics'; import { ComponentMeasureEnhanced, ComponentMeasure as ComponentMeasureI, diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ColorRatingsLegend.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ColorRatingsLegend.tsx index 9d01b8d4ba7..7633c1cdf0c 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ColorRatingsLegend.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ColorRatingsLegend.tsx @@ -20,8 +20,8 @@ import { ColorFilterOption, ColorsLegend } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { translateWithParameters } from '../../../helpers/l10n'; -import { MetricType } from '../../../types/metrics'; export interface ColorRatingsLegendProps { className?: string; 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 fab3b2edecb..28563b0124e 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 @@ -21,13 +21,13 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; 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 { isApplication, isProject } from '../../../types/component'; import { MeasurePageView } from '../../../types/measures'; -import { MetricKey } from '../../../types/metrics'; import { ComponentMeasure, ComponentMeasureEnhanced, Metric } from '../../../types/types'; export interface ComponentCellProps { diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx index a3820b9ceda..227d382a3a1 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.tsx @@ -21,6 +21,7 @@ import { ButtonSecondary, FlagMessage } from 'design-system'; import { throttle } from 'lodash'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import ListFooter from '../../../components/controls/ListFooter'; import { isInput, isShortcut } from '../../../helpers/keyboardEventHelpers'; import { KeyboardKeys } from '../../../helpers/keycodes'; @@ -28,7 +29,6 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; import { isDiffMetric, isPeriodBestValue } from '../../../helpers/measures'; import { BranchLike } from '../../../types/branch-like'; import { MeasurePageView } from '../../../types/measures'; -import { MetricType } from '../../../types/metrics'; import { ComponentMeasure, ComponentMeasureEnhanced, diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx index d167cce21df..11518a5c490 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/MeasureCell.tsx @@ -20,10 +20,10 @@ import { MetricsRatingBadge, NumericalCell, RatingLabel } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import Measure from '../../../components/measure/Measure'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getCCTMeasureValue, isDiffMetric } from '../../../helpers/measures'; -import { MetricType } from '../../../types/metrics'; import { ComponentMeasureEnhanced, MeasureEnhanced, Metric } from '../../../types/types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx index b33746cd45a..365eac7dba8 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.tsx @@ -33,13 +33,13 @@ import { isEmpty } from 'lodash'; import * as React from 'react'; import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import ColorBoxLegend from '../../../components/charts/ColorBoxLegend'; import ColorGradientLegend from '../../../components/charts/ColorGradientLegend'; import { getComponentMeasureUniqueKey } from '../../../helpers/component'; import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; import { isDefined } from '../../../helpers/types'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { ComponentMeasureEnhanced, ComponentMeasureIntern, Metric } from '../../../types/types'; import EmptyResult from './EmptyResult'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/SubnavigationMeasureValue.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/SubnavigationMeasureValue.tsx index 30f140b329a..f287b316657 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/SubnavigationMeasureValue.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/SubnavigationMeasureValue.tsx @@ -20,10 +20,10 @@ import { MetricsRatingBadge, Note, RatingLabel } from 'design-system'; import React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import Measure from '../../../components/measure/Measure'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { isDiffMetric } from '../../../helpers/measures'; -import { MetricType } from '../../../types/metrics'; import { MeasureEnhanced } from '../../../types/types'; interface Props { 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 bbd182854a8..13c90589ca9 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 @@ -20,6 +20,7 @@ import { groupBy, memoize, sortBy, toPairs } from 'lodash'; import { isBranch } from '~sonar-aligned/helpers/branch-like'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import { enhanceMeasure } from '../../components/measure/utils'; import { isPullRequest } from '../../helpers/branch-like'; @@ -47,7 +48,6 @@ import { } from '../../helpers/query'; import { BranchLike } from '../../types/branch-like'; import { Domain, MeasurePageView } from '../../types/measures'; -import { MetricKey, MetricType } from '../../types/metrics'; import { ComponentMeasure, ComponentMeasureEnhanced, diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx index a33ce6f4f66..df8ff0d7fea 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx @@ -23,12 +23,12 @@ import { isEmpty, max } from 'lodash'; import * as React from 'react'; import { WrappedComponentProps, injectIntl } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { longFormatterOption } from '../../../components/intl/DateFormatter'; import DateFromNow from '../../../components/intl/DateFromNow'; import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; import { parseDate } from '../../../helpers/dates'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { MetricType } from '../../../types/metrics'; import { Component, Dict } from '../../../types/types'; import { Query } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx index fe188f13811..90b5e8136a4 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx @@ -21,6 +21,7 @@ import { QualifierIcon } from 'design-system'; import { omit } from 'lodash'; import * as React from 'react'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { getDirectories } from '../../../api/components'; import { translate } from '../../../helpers/l10n'; import { collapsePath } from '../../../helpers/path'; @@ -28,7 +29,6 @@ import { highlightTerm } from '../../../helpers/search'; import { BranchLike } from '../../../types/branch-like'; import { TreeComponentWithPath } from '../../../types/component'; import { Facet } from '../../../types/issues'; -import { MetricKey } from '../../../types/metrics'; import { Query } from '../utils'; import { ListStyleFacet } from './ListStyleFacet'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx index 43f6a9ae587..f04e4358334 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx @@ -21,6 +21,7 @@ import { QualifierIcon } from 'design-system'; import { omit } from 'lodash'; import * as React from 'react'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { getFiles } from '../../../api/components'; import { translate } from '../../../helpers/l10n'; import { collapsePath, splitPath } from '../../../helpers/path'; @@ -29,7 +30,6 @@ import { isDefined } from '../../../helpers/types'; import { BranchLike } from '../../../types/branch-like'; import { TreeComponentWithPath } from '../../../types/component'; import { Facet } from '../../../types/issues'; -import { MetricKey } from '../../../types/metrics'; import { Query } from '../utils'; import { ListStyleFacet } from './ListStyleFacet'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacet.tsx index 0053437ec14..3e87f1065e3 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacet.tsx @@ -21,13 +21,13 @@ import { FacetBox, FacetItem, FlagMessage, InputSearch, Note } from 'design-syst import { max, sortBy, values, without } from 'lodash'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import ListFooter from '../../../components/controls/ListFooter'; import Tooltip from '../../../components/controls/Tooltip'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { queriesEqual } from '../../../helpers/query'; import { isDefined } from '../../../helpers/types'; -import { MetricType } from '../../../types/metrics'; import { Dict, Paging } from '../../../types/types'; import { FacetItemsList } from './FacetItemsList'; import { ListStyleFacetFooter } from './ListStyleFacetFooter'; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacetFooter.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacetFooter.tsx index 787a45cc3ae..05f264ca572 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacetFooter.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/ListStyleFacetFooter.tsx @@ -21,8 +21,8 @@ import { useTheme } from '@emotion/react'; import { DiscreetLink, Theme, themeColor } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { MetricType } from '../../../types/metrics'; export interface Props { nbShown: number; 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 3321eb714be..52b10e6cf96 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 @@ -22,12 +22,12 @@ import { IconProject, Spinner } from '@sonarsource/echoes-react'; import { omit } from 'lodash'; import * as React from 'react'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { getTree, searchProjects } from '../../../api/components'; import { translate } from '../../../helpers/l10n'; import { highlightTerm } from '../../../helpers/search'; import { useProjectQuery } from '../../../queries/projects'; import { Facet, ReferencedComponent } from '../../../types/issues'; -import { MetricKey } from '../../../types/metrics'; import { Component, Dict, Paging } from '../../../types/types'; import { Query } from '../utils'; import { ListStyleFacet } from './ListStyleFacet'; diff --git a/server/sonar-web/src/main/js/apps/issues/utils.ts b/server/sonar-web/src/main/js/apps/issues/utils.ts index d5c3eb316c1..dc9698525e2 100644 --- a/server/sonar-web/src/main/js/apps/issues/utils.ts +++ b/server/sonar-web/src/main/js/apps/issues/utils.ts @@ -19,6 +19,7 @@ */ import { intersection, isArray, uniq } from 'lodash'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import { getUsers } from '../../api/users'; import { DEFAULT_ISSUES_QUERY } from '../../components/shared/utils'; @@ -48,7 +49,6 @@ import { IssueStatus, RawFacet, } from '../../types/issues'; -import { MetricType } from '../../types/metrics'; import { SecurityStandard } from '../../types/security'; import { Dict, Flow, FlowType, Issue, Paging } from '../../types/types'; import { RestUser } from '../../types/users'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx index 9e859ff1f2a..03124fdb5e6 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/ActivityPanel.tsx @@ -20,6 +20,7 @@ import styled from '@emotion/styled'; import { BasicSeparator, Card, Spinner, TextSubdued, themeColor } from 'design-system'; import * as React from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import GraphsHeader from '../../../components/activity-graph/GraphsHeader'; import GraphsHistory from '../../../components/activity-graph/GraphsHistory'; import { @@ -33,7 +34,6 @@ import { parseDate } from '../../../helpers/dates'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { localizeMetric } from '../../../helpers/measures'; import { BranchLike } from '../../../types/branch-like'; -import { MetricKey } from '../../../types/metrics'; import { Analysis as AnalysisType, GraphType, diff --git a/server/sonar-web/src/main/js/apps/overview/branches/AnalysisVariations.tsx b/server/sonar-web/src/main/js/apps/overview/branches/AnalysisVariations.tsx index 2e5b80ad650..728f59ee6e1 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/AnalysisVariations.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/AnalysisVariations.tsx @@ -22,7 +22,7 @@ import { TrendDirection, TrendIcon, TrendType, themeColor } from 'design-system' import React from 'react'; import { FormattedMessage } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; -import { MetricType } from '../../../types/metrics'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { AnalysisMeasuresVariations } from '../../../types/project-activity'; interface AnalysisVariationsProps { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx b/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx index 053293a9a59..a3ec7989032 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx @@ -21,12 +21,12 @@ import { SeparatorCircleIcon } from 'design-system'; import React from 'react'; import { useIntl } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { getCurrentPage } from '../../../app/components/nav/component/utils'; import ComponentReportActions from '../../../components/controls/ComponentReportActions'; import HomePageSelect from '../../../components/controls/HomePageSelect'; import { findMeasure } from '../../../helpers/measures'; import { Branch } from '../../../types/branch-like'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { Component, MeasureEnhanced } from '../../../types/types'; import { HomePage } from '../../../types/users'; 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 03471874a37..42c2e80fee0 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 @@ -21,6 +21,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 { MetricKey } from '~sonar-aligned/types/metrics'; import { getApplicationDetails, getApplicationLeak } from '../../../api/application'; import { getMeasuresWithPeriodAndMetrics } from '../../../api/measures'; import { getProjectActivity } from '../../../api/projectActivity'; @@ -46,7 +47,6 @@ import { import { isDefined } from '../../../helpers/types'; import { ApplicationPeriod } from '../../../types/application'; import { Branch, BranchLike } from '../../../types/branch-like'; -import { MetricKey } from '../../../types/metrics'; import { Analysis, GraphType, MeasureHistory } from '../../../types/project-activity'; import { QualityGateStatus, QualityGateStatusCondition } 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/MeasuresPanelPercentCards.tsx b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelPercentCards.tsx index 17d5cdc8520..5086dfc64c4 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelPercentCards.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelPercentCards.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { isApplication } from '../../../types/component'; -import { MetricKey } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component, MeasureEnhanced } from '../../../types/types'; import MeasuresCardPercent from '../components/MeasuresCardPercent'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx index 0b5dfd81be2..9d86007dc2f 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx @@ -38,6 +38,7 @@ import { getComponentIssuesUrl, getComponentSecurityHotspotsUrl, } from '~sonar-aligned/helpers/urls'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { getLeakValue } from '../../../components/measure/utils'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; import { findMeasure, formatRating } from '../../../helpers/measures'; @@ -45,7 +46,6 @@ import { CodeScope } from '../../../helpers/urls'; import { Branch } from '../../../types/branch-like'; import { isApplication } from '../../../types/component'; import { IssueStatus } from '../../../types/issues'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatus } from '../../../types/quality-gates'; import { Component, MeasureEnhanced } from '../../../types/types'; import { IssueMeasuresCardInner } from '../components/IssueMeasuresCardInner'; 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 4befd866b66..e9821ae8010 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 @@ -21,10 +21,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 { MetricKey } from '~sonar-aligned/types/metrics'; import { getBranchLikeDisplayName } from '../../../helpers/branch-like'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; -import { MetricKey } from '../../../types/metrics'; import { Component, MeasureEnhanced } from '../../../types/types'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx index a888c3eec49..9bd22123d35 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx @@ -32,13 +32,13 @@ import { getComponentIssuesUrl, getComponentSecurityHotspotsUrl, } from '~sonar-aligned/helpers/urls'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { findMeasure, formatRating } from '../../../helpers/measures'; import { CodeScope } from '../../../helpers/urls'; import { Branch } from '../../../types/branch-like'; import { SoftwareQuality } from '../../../types/clean-code-taxonomy'; import { isApplication } from '../../../types/component'; import { IssueStatus } from '../../../types/issues'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatus } from '../../../types/quality-gates'; import { Component, MeasureEnhanced } from '../../../types/types'; import MeasuresCard from '../components/MeasuresCard'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx index 96d5bd9e22d..6183e718db5 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx @@ -26,6 +26,7 @@ import { getComponentIssuesUrl, getComponentSecurityHotspotsUrl, } from '~sonar-aligned/helpers/urls'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import IssueTypeIcon from '../../../components/icon-mappers/IssueTypeIcon'; import MeasureIndicator from '../../../components/measure/MeasureIndicator'; import { @@ -39,7 +40,6 @@ import { getOperatorLabel } from '../../../helpers/qualityGates'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { IssueType } from '../../../types/issues'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component, Dict } from '../../../types/types'; import { RATING_TO_SEVERITIES_MAPPING } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateConditions.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateConditions.tsx index 6b0f86f3659..7e17d21f8d1 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateConditions.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateConditions.tsx @@ -20,9 +20,9 @@ import { BasicSeparator, Link } from 'design-system'; import { sortBy } from 'lodash'; import * as React from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; -import { MetricKey } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component } from '../../../types/types'; import { CAYC_CONDITION_ORDER_PRIORITIES } from '../../quality-gates/utils'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx index 97008214a91..4a12c8adeb8 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx @@ -22,11 +22,11 @@ import * as React from 'react'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { propsToIssueParams } from '../../../components/shared/utils'; import { translate } from '../../../helpers/l10n'; import { isDiffMetric, localizeMetric } from '../../../helpers/measures'; import { BranchLike } from '../../../types/branch-like'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component } from '../../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureBreakdownCard.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureBreakdownCard.tsx index 0e3de3af596..97a2b330269 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureBreakdownCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureBreakdownCard.tsx @@ -24,10 +24,10 @@ import * as React from 'react'; import { useIntl } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; import { Branch } from '../../../types/branch-like'; import { SoftwareImpactSeverity, SoftwareQuality } from '../../../types/clean-code-taxonomy'; -import { MetricType } from '../../../types/metrics'; import { Component } from '../../../types/types'; export interface SoftwareImpactMeasureBreakdownCardProps { diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx index 09767f1ab1f..0586663c04d 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx @@ -24,6 +24,7 @@ import * as React from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import Tooltip from '../../../components/controls/Tooltip'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; import { @@ -37,7 +38,6 @@ import { SoftwareImpactSeverity, SoftwareQuality, } from '../../../types/clean-code-taxonomy'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component, MeasureEnhanced } from '../../../types/types'; import { Status, softwareQualityToMeasure } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SonarLintPromotion.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SonarLintPromotion.tsx index 359543f422c..09e34fa2359 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/SonarLintPromotion.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/SonarLintPromotion.tsx @@ -20,10 +20,10 @@ import { Card, DiscreetLink } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; import { SonarLintLogo } from '../../../components/logos/SonarLintLogo'; import { translate } from '../../../helpers/l10n'; -import { MetricKey } from '../../../types/metrics'; import { QualityGateStatusCondition } from '../../../types/quality-gates'; import { CurrentUser } from '../../../types/users'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ActivityPanel-it.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ActivityPanel-it.tsx index 45dddc7b81e..abbf0824c96 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ActivityPanel-it.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/ActivityPanel-it.tsx @@ -30,9 +30,9 @@ import { mockMetric } from '../../../../helpers/testMocks'; import userEvent from '@testing-library/user-event'; import { Route, useSearchParams } from 'react-router-dom'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { parseDate } from '../../../../helpers/dates'; import { renderAppRoutes } from '../../../../helpers/testReactTestingUtils'; -import { MetricKey } from '../../../../types/metrics'; import { ApplicationAnalysisEventCategory, DefinitionChangeType, 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 5095400d6fa..12a11855460 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 @@ -20,6 +20,7 @@ import { screen, waitFor } from '@testing-library/react'; import * as React from 'react'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import AlmSettingsServiceMock from '../../../../api/mocks/AlmSettingsServiceMock'; import ApplicationServiceMock from '../../../../api/mocks/ApplicationServiceMock'; import BranchesServiceMock from '../../../../api/mocks/BranchesServiceMock'; @@ -40,7 +41,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 { MetricKey } from '../../../../types/metrics'; import { ProjectAnalysisEventCategory } from '../../../../types/project-activity'; import { CaycStatus } from '../../../../types/types'; import BranchOverview, { NO_CI_DETECTED } from '../BranchOverview'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGateCondition-test.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGateCondition-test.tsx index 85d384bbae9..baebe48e457 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGateCondition-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGateCondition-test.tsx @@ -19,11 +19,11 @@ */ import { screen } from '@testing-library/react'; import * as React from 'react'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { mockBranch } from '../../../../helpers/mocks/branch-like'; import { mockQualityGateStatusConditionEnhanced } from '../../../../helpers/mocks/quality-gates'; import { mockMetric } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; -import { MetricKey, MetricType } from '../../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../../types/quality-gates'; import QualityGateCondition from '../QualityGateCondition'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGatePanelSection-test.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGatePanelSection-test.tsx index 3453dfdc0df..3bfb3a9d3de 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGatePanelSection-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGatePanelSection-test.tsx @@ -19,12 +19,12 @@ */ import { screen } from '@testing-library/react'; import * as React from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import CurrentUserContextProvider from '../../../../app/components/current-user/CurrentUserContextProvider'; import { mockQualityGate, mockQualityGateStatus } from '../../../../helpers/mocks/quality-gates'; import { mockLoggedInUser } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { byRole } from '../../../../helpers/testSelector'; -import { MetricKey } from '../../../../types/metrics'; import { CaycStatus, Status } from '../../../../types/types'; import { CurrentUser, NoticeType } from '../../../../types/users'; import QualityGatePanelSection, { QualityGatePanelSectionProps } from '../QualityGatePanelSection'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGateSimplifiedCondition-test.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGateSimplifiedCondition-test.tsx index fffc444c8d4..f02ac27c32b 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGateSimplifiedCondition-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/QualityGateSimplifiedCondition-test.tsx @@ -19,10 +19,10 @@ */ import { screen } from '@testing-library/react'; import React from 'react'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { mockQualityGateStatusConditionEnhanced } from '../../../../helpers/mocks/quality-gates'; import { mockMetric } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; -import { MetricKey, MetricType } from '../../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../../types/quality-gates'; import QualityGateCondition from '../QualityGateCondition'; import QualityGateSimplifiedCondition from '../QualityGateSimplifiedCondition'; diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/SonarLintPromotion-test.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/SonarLintPromotion-test.tsx index 25f8906e358..4dcd3f55b63 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/SonarLintPromotion-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/SonarLintPromotion-test.tsx @@ -19,10 +19,10 @@ */ import { screen } from '@testing-library/react'; import * as React from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { mockQualityGateStatusCondition } from '../../../../helpers/mocks/quality-gates'; import { mockCurrentUser } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; -import { MetricKey } from '../../../../types/metrics'; import { SonarLintPromotion, SonarLintPromotionProps } from '../SonarLintPromotion'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/apps/overview/components/IssueMeasuresCardInner.tsx b/server/sonar-web/src/main/js/apps/overview/components/IssueMeasuresCardInner.tsx index d72e6635d5d..00c7fa270d2 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/IssueMeasuresCardInner.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/IssueMeasuresCardInner.tsx @@ -23,9 +23,9 @@ import classNames from 'classnames'; import { Badge, NoDataIcon, themeColor } from 'design-system'; import * as React from 'react'; import { Path } from 'react-router-dom'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { localizeMetric } from '../../../helpers/measures'; -import { MetricKey } from '../../../types/metrics'; interface IssueMeasuresCardInnerProps extends React.HTMLAttributes<HTMLDivElement> { metric: MetricKey; diff --git a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCard.tsx b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCard.tsx index d5c99f62673..f5ae6d20830 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCard.tsx @@ -22,9 +22,9 @@ import { LinkHighlight, LinkStandalone } from '@sonarsource/echoes-react'; import { Badge, Card, themeBorder, themeColor } from 'design-system'; import * as React from 'react'; import { To } from 'react-router-dom'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { localizeMetric } from '../../../helpers/measures'; -import { MetricKey } from '../../../types/metrics'; export interface MeasuresCardProps { url: To; diff --git a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardNumber.tsx b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardNumber.tsx index c8629cdcd8b..78d2b7ba17a 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardNumber.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardNumber.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { useIntl } from 'react-intl'; import { To } from 'react-router-dom'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; -import { MetricKey, MetricType } from '../../../types/metrics'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Status, getConditionRequiredLabel } from '../utils'; import MeasuresCard, { MeasuresCardProps } from './MeasuresCard'; diff --git a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardPercent.tsx b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardPercent.tsx index 8f86c1c487b..a225ca5dfa7 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardPercent.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/MeasuresCardPercent.tsx @@ -29,12 +29,12 @@ import * as React from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import { To } from 'react-router-dom'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { duplicationRatingConverter, getLeakValue } from '../../../components/measure/utils'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { findMeasure, localizeMetric } from '../../../helpers/measures'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { MeasureEnhanced } from '../../../types/types'; import { diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx index b8efbefac42..b04f9a478ff 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx @@ -27,6 +27,7 @@ import { getComponentIssuesUrl, getComponentSecurityHotspotsUrl, } from '~sonar-aligned/helpers/urls'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { DEFAULT_ISSUES_QUERY, isIssueMeasure, @@ -37,7 +38,6 @@ import { getShortType, isDiffMetric } from '../../../helpers/measures'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; import { IssueType } from '../../../types/issues'; -import { MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component } from '../../../types/types'; import { diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx index 3d44d54c7ed..6dc229906c6 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx @@ -36,11 +36,11 @@ import { useIntl } from 'react-intl'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { getLeakValue } from '../../../components/measure/utils'; import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; import { findMeasure } from '../../../helpers/measures'; import { PullRequest } from '../../../types/branch-like'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component, MeasureEnhanced } from '../../../types/types'; import { IssueMeasuresCardInner } from '../components/IssueMeasuresCardInner'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx index d2119340bc2..e1780472c0f 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx @@ -20,11 +20,11 @@ import classNames from 'classnames'; import * as React from 'react'; import { getComponentSecurityHotspotsUrl } from '~sonar-aligned/helpers/urls'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { getLeakValue } from '../../../components/measure/utils'; import { findMeasure } from '../../../helpers/measures'; import { getComponentDrilldownUrl } from '../../../helpers/urls'; import { PullRequest } from '../../../types/branch-like'; -import { MetricKey } from '../../../types/metrics'; import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; import { Component, MeasureEnhanced } from '../../../types/types'; import MeasuresCardNumber from '../components/MeasuresCardNumber'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestMetaTopBar.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestMetaTopBar.tsx index 1a248f65983..5efdb695599 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestMetaTopBar.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestMetaTopBar.tsx @@ -21,11 +21,11 @@ import { SeparatorCircleIcon } from 'design-system'; import React from 'react'; import { useIntl } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import CurrentBranchLikeMergeInformation from '../../../app/components/nav/component/branch-like/CurrentBranchLikeMergeInformation'; import { getLeakValue } from '../../../components/measure/utils'; import { findMeasure } from '../../../helpers/measures'; import { PullRequest } from '../../../types/branch-like'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { MeasureEnhanced } from '../../../types/types'; import LastAnalysisLabel from '../components/LastAnalysisLabel'; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/BranchQualityGate-it.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/BranchQualityGate-it.tsx index a841f4d4436..ecde065a0a0 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/BranchQualityGate-it.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/BranchQualityGate-it.tsx @@ -18,13 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { mockPullRequest } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/mocks/component'; import { mockQualityGateStatusConditionEnhanced } from '../../../../helpers/mocks/quality-gates'; import { mockMeasureEnhanced, mockMetric } from '../../../../helpers/testMocks'; import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { byLabelText, byRole } from '../../../../helpers/testSelector'; -import { MetricKey, MetricType } from '../../../../types/metrics'; import { FCProps } from '../../../../types/misc'; import { Status } from '../../utils'; import BranchQualityGate from '../BranchQualityGate'; 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 aa2ab4fa4ed..959e5d274aa 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 @@ -21,6 +21,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 { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import BranchesServiceMock from '../../../../api/mocks/BranchesServiceMock'; import { fetchQualityGate, getQualityGateProjectStatus } from '../../../../api/quality-gates'; import CurrentUserContextProvider from '../../../../app/components/current-user/CurrentUserContextProvider'; @@ -34,14 +35,13 @@ import { mockLoggedInUser, mockMeasure, mockMetric } from '../../../../helpers/t import { renderComponent } from '../../../../helpers/testReactTestingUtils'; import { byLabelText, byRole } from '../../../../helpers/testSelector'; import { ComponentPropsType } from '../../../../helpers/testUtils'; -import { MetricKey, MetricType } from '../../../../types/metrics'; import { CaycStatus } from '../../../../types/types'; import { NoticeType } from '../../../../types/users'; import PullRequestOverview from '../PullRequestOverview'; jest.mock('../../../../api/measures', () => { return { - ...jest.requireActual('../../../../types/metrics'), + ...jest.requireActual('../../../../sonar-aligned/types/metrics'), getMeasuresWithMetrics: jest.fn().mockResolvedValue({ component: { key: '', @@ -83,7 +83,7 @@ jest.mock('../../../../api/measures', () => { jest.mock('../../../../api/quality-gates', () => { const { mockQualityGateProjectStatus, mockQualityGateApplicationStatus, mockQualityGate } = jest.requireActual('../../../../helpers/mocks/quality-gates'); - const { MetricKey } = jest.requireActual('../../../../types/metrics'); + const { MetricKey } = jest.requireActual('../../../../sonar-aligned/types/metrics'); return { getQualityGateProjectStatus: jest.fn().mockResolvedValue( mockQualityGateProjectStatus({ diff --git a/server/sonar-web/src/main/js/apps/overview/utils.tsx b/server/sonar-web/src/main/js/apps/overview/utils.tsx index 211f0e76ed0..34ed343f960 100644 --- a/server/sonar-web/src/main/js/apps/overview/utils.tsx +++ b/server/sonar-web/src/main/js/apps/overview/utils.tsx @@ -21,13 +21,13 @@ import { memoize } from 'lodash'; import React from 'react'; import { IntlShape } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import { ISSUETYPE_METRIC_KEYS_MAP } from '../../helpers/issues'; import { translate } from '../../helpers/l10n'; import { parseAsString } from '../../helpers/query'; import { SoftwareQuality } from '../../types/clean-code-taxonomy'; import { IssueType } from '../../types/issues'; -import { MetricKey, MetricType } from '../../types/metrics'; import { AnalysisMeasuresVariations, MeasureHistory } from '../../types/project-activity'; import { QualityGateStatusConditionEnhanced } from '../../types/quality-gates'; import { Dict } from '../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx index 1b5f437449a..54097f3488c 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx @@ -20,6 +20,7 @@ import React from 'react'; import { useLocation, useRouter } from '~sonar-aligned/components/hoc/withRouter'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { useComponent, useTopLevelComponentKey, @@ -37,7 +38,6 @@ import { useBranchesQuery } from '../../../queries/branch'; import { useAllMeasuresHistoryQuery } from '../../../queries/measures'; import { useAllProjectAnalysesQuery } from '../../../queries/project-analyses'; import { isApplication, isPortfolioLike, isProject } from '../../../types/component'; -import { MetricKey } from '../../../types/metrics'; import { MeasureHistory, ParsedAnalysis } from '../../../types/project-activity'; import { Query, parseQuery, serializeUrlQuery } from '../utils'; import ProjectActivityAppRenderer from './ProjectActivityAppRenderer'; 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 d3c150434c0..c9201c16af2 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 @@ -23,6 +23,7 @@ import { keyBy, times } from 'lodash'; import React from 'react'; import { Route } from 'react-router-dom'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import ApplicationServiceMock from '../../../../api/mocks/ApplicationServiceMock'; import { ProjectActivityServiceMock } from '../../../../api/mocks/ProjectActivityServiceMock'; import { TimeMachineServiceMock } from '../../../../api/mocks/TimeMachineServiceMock'; @@ -39,7 +40,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 { MetricKey, MetricType } from '../../../../types/metrics'; import { ApplicationAnalysisEventCategory, GraphType, diff --git a/server/sonar-web/src/main/js/apps/projectActivity/utils.ts b/server/sonar-web/src/main/js/apps/projectActivity/utils.ts index 214e0322146..c64d34fa0fb 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/utils.ts +++ b/server/sonar-web/src/main/js/apps/projectActivity/utils.ts @@ -19,6 +19,7 @@ */ import { startOfDay } from 'date-fns'; import { isEqual, uniq } from 'lodash'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import { DEFAULT_GRAPH } from '../../components/activity-graph/utils'; import { parseDate } from '../../helpers/dates'; @@ -32,7 +33,6 @@ import { serializeString, serializeStringArray, } from '../../helpers/query'; -import { MetricKey } from '../../types/metrics'; import { GraphType, ParsedAnalysis } from '../../types/project-activity'; import { Dict } from '../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/ProjectInformationApp.tsx b/server/sonar-web/src/main/js/apps/projectInformation/ProjectInformationApp.tsx index 7f369064c01..3e7def28b8a 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/ProjectInformationApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/ProjectInformationApp.tsx @@ -19,6 +19,7 @@ */ import { Card, LargeCenteredLayout, PageContentFontWrapper, Title } from 'design-system'; import React, { useEffect, useState } from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { getMeasures } from '../../api/measures'; import withAvailableFeatures, { WithAvailableFeaturesProps, @@ -30,7 +31,6 @@ import { translate } from '../../helpers/l10n'; import { BranchLike } from '../../types/branch-like'; import { isApplication, isProject } from '../../types/component'; import { Feature } from '../../types/features'; -import { MetricKey } from '../../types/metrics'; import { Component, Dict, Measure, Metric } from '../../types/types'; import { CurrentUser, isLoggedIn } from '../../types/users'; import AboutProject from './about/AboutProject'; 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 60a00c4c931..dabdddeda8f 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 @@ -19,6 +19,7 @@ */ import { screen } from '@testing-library/react'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock'; import CodingRulesServiceMock from '../../../api/mocks/CodingRulesServiceMock'; import ComponentsServiceMock from '../../../api/mocks/ComponentsServiceMock'; @@ -31,7 +32,6 @@ import { mockCurrentUser, mockLoggedInUser, mockMeasure } from '../../../helpers import { renderAppWithComponentContext } from '../../../helpers/testReactTestingUtils'; import { byRole } from '../../../helpers/testSelector'; import { Visibility } from '../../../types/component'; -import { MetricKey } from '../../../types/metrics'; import { Component } from '../../../types/types'; import { CurrentUser } from '../../../types/users'; import routes from '../routes'; 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 485d2f1e86b..e4541232019 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 @@ -21,10 +21,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 { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { localizeMetric } from '../../../../helpers/measures'; import { getComponentDrilldownUrl } from '../../../../helpers/urls'; -import { MetricKey, MetricType } from '../../../../types/metrics'; import { Component, Measure } from '../../../../types/types'; interface MetaSizeProps { diff --git a/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx b/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx index 7ff2e3f1099..5e9ef2178ee 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx @@ -34,6 +34,7 @@ import { isEmpty } from 'lodash'; import * as React from 'react'; import { useState } from 'react'; import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { Image } from '../../../components/common/Image'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { localizeMetric } from '../../../helpers/measures'; @@ -44,7 +45,6 @@ import { useRenewBagdeTokenMutation, } from '../../../queries/badges'; import { BranchLike } from '../../../types/branch-like'; -import { MetricKey } from '../../../types/metrics'; import { Component } from '../../../types/types'; import { BadgeFormats, BadgeOptions, BadgeType, getBadgeSnippet, getBadgeUrl } from './utils'; 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 cf5ac702008..554a9cf5817 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 @@ -22,12 +22,12 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; 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 { 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 4858fda67d6..6b920b73e11 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 @@ -33,6 +33,7 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; import { Location, RawQuery, Router } from '~sonar-aligned/types/router'; import { searchProjects } from '../../../api/components'; import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; @@ -46,7 +47,6 @@ import { translate } from '../../../helpers/l10n'; import { get, save } from '../../../helpers/storage'; import { isDefined } from '../../../helpers/types'; import { AppState } from '../../../types/appstate'; -import { MetricKey } from '../../../types/metrics'; import { CurrentUser, isLoggedIn } from '../../../types/users'; import { Query, hasFilterParams, parseUrlQuery } from '../query'; import '../styles.css'; 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 764553be846..a9c64c430b2 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 @@ -22,12 +22,12 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; 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 { MetricKey } from '../../../../types/metrics'; import { Dict } from '../../../../types/types'; import projectRoutes from '../../routes'; import { LS_PROJECTS_SORT, LS_PROJECTS_VIEW } from '../AllProjects'; 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 b2e6a415f25..5039b6ad228 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 @@ -39,6 +39,7 @@ 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 { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import Favorite from '../../../../components/controls/Favorite'; import Tooltip from '../../../../components/controls/Tooltip'; import DateFromNow from '../../../../components/intl/DateFromNow'; @@ -47,7 +48,6 @@ import Measure from '../../../../components/measure/Measure'; import { translate, translateWithParameters } from '../../../../helpers/l10n'; import { isDefined } from '../../../../helpers/types'; import { getProjectUrl } from '../../../../helpers/urls'; -import { MetricKey, MetricType } from '../../../../types/metrics'; import { Status } from '../../../../types/types'; import { CurrentUser, isLoggedIn } from '../../../../types/users'; import { Project } from '../../types'; 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 420e38cd77b..c8f9896b5c3 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 @@ -27,12 +27,12 @@ import { } from 'design-system'; import * as React from 'react'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; 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 { 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 fdcdaf6af55..1f5cfda2ca2 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 @@ -20,10 +20,10 @@ import { screen } from '@testing-library/react'; import React from 'react'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { mockCurrentUser, mockLoggedInUser } from '../../../../../helpers/testMocks'; import { renderComponent } from '../../../../../helpers/testReactTestingUtils'; import { Visibility } from '../../../../../types/component'; -import { MetricKey } from '../../../../../types/metrics'; import { CurrentUser } from '../../../../../types/users'; import { Project } from '../../../types'; import ProjectCard from '../ProjectCard'; 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 10513b0e743..c2bc48d9936 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 @@ -21,8 +21,8 @@ import { screen } from '@testing-library/react'; import * as React from 'react'; import { ComponentQualifier } from '~sonar-aligned/types/component'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { renderComponent } from '../../../../../helpers/testReactTestingUtils'; -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/CoverageFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx index 73f4796e5a1..ff6a45eb73f 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.tsx @@ -19,10 +19,10 @@ */ import { CoverageIndicator } from 'design-system'; import * as React from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getCoverageRatingAverageValue, getCoverageRatingLabel } from '../../../helpers/ratings'; -import { MetricKey } from '../../../types/metrics'; import { Facet } from '../types'; import RangeFacetBase from './RangeFacetBase'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewCoverageFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewCoverageFilter.tsx index 53c75838ace..e46860a1b62 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/NewCoverageFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/NewCoverageFilter.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { MetricKey } from '../../../types/metrics'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import CoverageFilter, { Props } from './CoverageFilter'; export default function NewCoverageFilter(props: Props) { diff --git a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx index 4bc25a02e0f..a3f3ae1366e 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/NewLinesFilter.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import { translate } from '../../../helpers/l10n'; import { getSizeRatingLabel } from '../../../helpers/ratings'; -import { MetricKey } from '../../../types/metrics'; import { Facet } from '../types'; import RangeFacetBase from './RangeFacetBase'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/RatingFacet.tsx b/server/sonar-web/src/main/js/apps/projects/filters/RatingFacet.tsx index fe816e6f24f..9b8df67e781 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/RatingFacet.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/RatingFacet.tsx @@ -20,9 +20,9 @@ import { MetricsRatingBadge, RatingEnum } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { MetricType } from '../../../types/metrics'; import { Facet } from '../types'; import RangeFacetBase from './RangeFacetBase'; diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx b/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx index 45350adbac8..dde1c3b2707 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx +++ b/server/sonar-web/src/main/js/apps/projects/filters/SecurityReviewFilter.tsx @@ -20,9 +20,9 @@ import { MetricsRatingBadge, RatingEnum } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { RawQuery } from '~sonar-aligned/types/router'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { MetricType } from '../../../types/metrics'; import { Dict } from '../../../types/types'; import { Facet } from '../types'; import RangeFacetBase from './RangeFacetBase'; diff --git a/server/sonar-web/src/main/js/apps/projects/utils.ts b/server/sonar-web/src/main/js/apps/projects/utils.ts index c31270fc0ee..a59ea6ea7b9 100644 --- a/server/sonar-web/src/main/js/apps/projects/utils.ts +++ b/server/sonar-web/src/main/js/apps/projects/utils.ts @@ -18,12 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { invert } from 'lodash'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { Facet, getScannableProjects, searchProjects } from '../../api/components'; import { getMeasuresForProjects } from '../../api/measures'; import { translate, translateWithParameters } from '../../helpers/l10n'; import { isDiffMetric } from '../../helpers/measures'; import { RequestData } from '../../helpers/request'; -import { MetricKey } from '../../types/metrics'; import { Dict } from '../../types/types'; import { Query, convertToFilter } from './query'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/quality-gates/__tests__/utils-test.ts index a4196c17980..ff393111b1b 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/quality-gates/__tests__/utils-test.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 { MetricKey } from '~sonar-aligned/types/metrics'; import { mockCondition, mockMetric } from '../../../helpers/testMocks'; -import { MetricKey } from '../../../types/metrics'; import { Condition } from '../../../types/types'; import { getLocalizedMetricNameNoDiffMetric, groupAndSortByPriorityConditions } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/CaycCondition.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/CaycCondition.tsx index f4e083e8cd3..05cef460842 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/CaycCondition.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/CaycCondition.tsx @@ -23,9 +23,9 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import withMetricsContext from '../../../app/components/metrics/withMetricsContext'; import { translate } from '../../../helpers/l10n'; -import { MetricKey } from '../../../types/metrics'; import { Condition, Dict, Metric } from '../../../types/types'; import { getCaycConditionMetadata, getLocalizedMetricNameNoDiffMetric } from '../utils'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValueDescription.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValueDescription.tsx index 77a22d47fd1..4f0bf6c5542 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValueDescription.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ConditionValueDescription.tsx @@ -19,8 +19,8 @@ */ import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { translate } from '../../../helpers/l10n'; -import { MetricKey } from '../../../types/metrics'; import { Condition, Metric } from '../../../types/types'; import { GreenColorText } from './ConditionValue'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx index 4d5d1252b38..2db45668ea6 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx @@ -34,6 +34,7 @@ import { differenceWith, map, uniqBy } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { useAvailableFeatures } from '../../../app/components/available-features/withAvailableFeatures'; import { useMetrics } from '../../../app/components/metrics/withMetricsContext'; import DocumentationLink from '../../../components/common/DocumentationLink'; @@ -41,7 +42,6 @@ import ModalButton, { ModalProps } from '../../../components/controls/ModalButto import { useDocUrl } from '../../../helpers/docs'; import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; import { Feature } from '../../../types/features'; -import { MetricKey } from '../../../types/metrics'; import { CaycStatus, Condition as ConditionType, QualityGate } from '../../../types/types'; import { groupAndSortByPriorityConditions, isQualityGateOptimized } from '../utils'; import AddConditionModal from './AddConditionModal'; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/utils.ts b/server/sonar-web/src/main/js/apps/quality-gates/utils.ts index 34353e50a9e..cb37ff4039a 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/utils.ts +++ b/server/sonar-web/src/main/js/apps/quality-gates/utils.ts @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { sortBy } from 'lodash'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import { getLocalizedMetricName } from '../../helpers/l10n'; import { isDiffMetric } from '../../helpers/measures'; -import { MetricKey } from '../../types/metrics'; import { CaycStatus, Condition, Dict, Metric, QualityGate } from '../../types/types'; interface GroupedByMetricConditions { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRow.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRow.tsx index 9fd13ab2f10..ef2d3973ec2 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRow.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRulesRow.tsx @@ -20,10 +20,10 @@ import { ContentCell, Link, Note, NumericalCell, TableRow } from 'design-system'; import * as React from 'react'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { translateWithParameters } from '../../../helpers/l10n'; import { isDefined } from '../../../helpers/types'; import { getRulesUrl } from '../../../helpers/urls'; -import { MetricType } from '../../../types/metrics'; import { RulesFacetName } from '../../../types/rules'; interface Props { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx index 4cdcd65ede0..125155c9f42 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/EvolutionRules.tsx @@ -22,11 +22,11 @@ import { noop, sortBy } from 'lodash'; import * as React from 'react'; import { useIntl } from 'react-intl'; import { formatMeasure } from '~sonar-aligned/helpers/measures'; +import { MetricType } from '~sonar-aligned/types/metrics'; import { listRules } from '../../../api/rules'; import { toShortISO8601String } from '../../../helpers/dates'; import { translateWithParameters } from '../../../helpers/l10n'; import { getRulesUrl } from '../../../helpers/urls'; -import { MetricType } from '../../../types/metrics'; import { Rule, RuleActivation } from '../../../types/types'; const RULES_LIMIT = 10; 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 408950cba1a..34c7fd9c736 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 @@ -23,6 +23,7 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; import { Location, Router } from '~sonar-aligned/types/router'; import { getMeasures } from '../../api/measures'; import { getSecurityHotspotList, getSecurityHotspots } from '../../api/security-hotspots'; @@ -36,7 +37,6 @@ import { KeyboardKeys } from '../../helpers/keycodes'; import { getStandards } from '../../helpers/security-standard'; import { withBranchLikes } from '../../queries/branch'; import { BranchLike } from '../../types/branch-like'; -import { MetricKey } from '../../types/metrics'; import { SecurityStandard, Standards } from '../../types/security'; import { HotspotFilters, 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 64efe95a09d..fd56756bc52 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 @@ -33,12 +33,12 @@ 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 { MetricKey } from '~sonar-aligned/types/metrics'; 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 { MetricKey } from '../../types/metrics'; import { SecurityStandard, Standards } from '../../types/security'; import { HotspotFilters, HotspotStatusFilter, RawHotspot } from '../../types/security-hotspots'; import { Component, StandardSecurityCategories } from '../../types/types'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsApp-it.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsApp-it.tsx index d25e5890ff9..1db2b03ae9c 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/SecurityHotspotsApp-it.tsx @@ -21,6 +21,7 @@ import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; import { Route } from 'react-router-dom'; +import { MetricKey } from '~sonar-aligned/types/metrics'; import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock'; import CodingRulesServiceMock from '../../../api/mocks/CodingRulesServiceMock'; import SecurityHotspotServiceMock from '../../../api/mocks/SecurityHotspotServiceMock'; @@ -33,7 +34,6 @@ import { mockLoggedInUser } from '../../../helpers/testMocks'; import { renderAppWithComponentContext } from '../../../helpers/testReactTestingUtils'; import { byDisplayValue, byRole, byTestId, byText } from '../../../helpers/testSelector'; import { ComponentContextShape } from '../../../types/component'; -import { MetricKey } from '../../../types/metrics'; import SecurityHotspotsApp from '../SecurityHotspotsApp'; import useStickyDetection from '../hooks/useStickyDetection'; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx index 743b3ab14b1..eda6457439b 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx @@ -33,6 +33,7 @@ import { import * as React from 'react'; import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; import { isBranch } from '~sonar-aligned/helpers/branch-like'; +import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; import withComponentContext from '../../../app/components/componentContext/withComponentContext'; import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext'; import Tooltip from '../../../components/controls/Tooltip'; @@ -41,7 +42,6 @@ import { PopupPlacement } from '../../../components/ui/popups'; import { translate } from '../../../helpers/l10n'; import { BranchLike } from '../../../types/branch-like'; import { ComponentContextShape } from '../../../types/component'; -import { MetricKey, MetricType } from '../../../types/metrics'; import { HotspotFilters } from '../../../types/security-hotspots'; import { CurrentUser, isLoggedIn } from '../../../types/users'; import { HotspotDisabledFilterTooltip } from './HotspotDisabledFilterTooltip'; |