@@ -24,6 +24,7 @@ import { createPortal } from 'react-dom'; | |||
import { Helmet } from 'react-helmet-async'; | |||
import { Outlet } from 'react-router-dom'; | |||
import { useLocation, useRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { validateProjectAlmBinding } from '../../api/alm-settings'; | |||
import { getTasksForComponent } from '../../api/ce'; | |||
@@ -33,7 +34,6 @@ import { translateWithParameters } from '../../helpers/l10n'; | |||
import { HttpStatus } from '../../helpers/request'; | |||
import { getPortfolioUrl, getProjectUrl, getPullRequestUrl } from '../../helpers/urls'; | |||
import { useBranchesQuery } from '../../queries/branch'; | |||
import { isPortfolioLike } from '../../sonar-aligned/helpers/component'; | |||
import { ProjectAlmBindingConfigurationErrors } from '../../types/alm-settings'; | |||
import { Branch } from '../../types/branch-like'; | |||
import { isFile } from '../../types/component'; |
@@ -27,15 +27,14 @@ import { | |||
} from 'design-system'; | |||
import * as React from 'react'; | |||
import { useLocation } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; | |||
import { getBranchLikeQuery, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { BranchParameters } from '~sonar-aligned/types/branch-like'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { DEFAULT_ISSUES_QUERY } from '../../../../components/shared/utils'; | |||
import { isPullRequest } from '../../../../helpers/branch-like'; | |||
import { hasMessage, translate, translateWithParameters } from '../../../../helpers/l10n'; | |||
import { getPortfolioUrl, getProjectQueryUrl } from '../../../../helpers/urls'; | |||
import { useBranchesQuery } from '../../../../queries/branch'; | |||
import { isPortfolioLike } from '../../../../sonar-aligned/helpers/component'; | |||
import { isApplication, isProject } from '../../../../types/component'; | |||
import { Feature } from '../../../../types/features'; | |||
import { Component, Dict, Extension } from '../../../../types/types'; |
@@ -20,15 +20,11 @@ | |||
import { DropdownMenu, InputSearch, ItemDivider, Link } from 'design-system'; | |||
import * as React from 'react'; | |||
import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { isBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { queryToSearchString } from '~sonar-aligned/helpers/urls'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { Router } from '~sonar-aligned/types/router'; | |||
import { | |||
getBrancheLikesAsTree, | |||
isPullRequest, | |||
isSameBranchLike, | |||
} from '../../../../../helpers/branch-like'; | |||
import { getBrancheLikesAsTree, isSameBranchLike } from '../../../../../helpers/branch-like'; | |||
import { KeyboardKeys } from '../../../../../helpers/keycodes'; | |||
import { translate } from '../../../../../helpers/l10n'; | |||
import { getBranchLikeUrl } from '../../../../../helpers/urls'; |
@@ -20,8 +20,8 @@ | |||
import { LinkStandalone } from '@sonarsource/echoes-react'; | |||
import React from 'react'; | |||
import { isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { Image } from '../../../../../components/common/Image'; | |||
import { isPullRequest } from '../../../../../helpers/branch-like'; | |||
import { translate, translateWithParameters } from '../../../../../helpers/l10n'; | |||
import { isDefined } from '../../../../../helpers/types'; | |||
import { AlmKeys } from '../../../../../types/alm-settings'; |
@@ -28,6 +28,7 @@ import { | |||
} from 'design-system'; | |||
import * as React from 'react'; | |||
import { formatMeasure } from '~sonar-aligned/helpers/measures'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { MetricType } from '~sonar-aligned/types/metrics'; | |||
import MetaLink from '../../../components/common/MetaLink'; | |||
import Tooltip from '../../../components/controls/Tooltip'; | |||
@@ -35,7 +36,7 @@ import DateFromNow from '../../../components/intl/DateFromNow'; | |||
import { translate, translateWithParameters } from '../../../helpers/l10n'; | |||
import { orderLinks } from '../../../helpers/projectLinks'; | |||
import { getProjectUrl } from '../../../helpers/urls'; | |||
import { MyProject, ProjectLink, Status } from '../../../types/types'; | |||
import { MyProject, ProjectLink } from '../../../types/types'; | |||
interface Props { | |||
project: MyProject; |
@@ -27,6 +27,7 @@ import { | |||
StandoutLink, | |||
} from 'design-system'; | |||
import * as React from 'react'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { | |||
getBranchUrl, | |||
@@ -34,7 +35,6 @@ import { | |||
getProjectUrl, | |||
getPullRequestUrl, | |||
} from '../../../helpers/urls'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { Task } from '../../../types/tasks'; | |||
interface Props { |
@@ -19,13 +19,13 @@ | |||
*/ | |||
import * as React from 'react'; | |||
import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { Location, Router } from '~sonar-aligned/types/router'; | |||
import withComponentContext from '../../../app/components/componentContext/withComponentContext'; | |||
import withMetricsContext from '../../../app/components/metrics/withMetricsContext'; | |||
import { CodeScope, getCodeUrl, getProjectUrl } from '../../../helpers/urls'; | |||
import { WithBranchLikesProps, useBranchesQuery } from '../../../queries/branch'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { Breadcrumb, Component, ComponentMeasure, Dict, Metric } from '../../../types/types'; | |||
import { addComponent, addComponentBreadcrumbs, clearBucket } from '../bucket'; | |||
import { loadMoreChildren, retrieveComponent, retrieveComponentChildren } from '../utils'; |
@@ -31,6 +31,7 @@ import * as React from 'react'; | |||
import { Helmet } from 'react-helmet-async'; | |||
import A11ySkipTarget from '~sonar-aligned/components/a11y/A11ySkipTarget'; | |||
import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { Location } from '~sonar-aligned/types/router'; | |||
import ListFooter from '../../../components/controls/ListFooter'; | |||
import Suggestions from '../../../components/embed-docs-modal/Suggestions'; | |||
@@ -39,7 +40,6 @@ import { CCT_SOFTWARE_QUALITY_METRICS, OLD_TAXONOMY_METRICS } from '../../../hel | |||
import { KeyboardKeys } from '../../../helpers/keycodes'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { areCCTMeasuresComputed } from '../../../helpers/measures'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { BranchLike } from '../../../types/branch-like'; | |||
import { isApplication } from '../../../types/component'; | |||
import { Breadcrumb, Component, ComponentMeasure, Dict, Metric } from '../../../types/types'; |
@@ -27,6 +27,7 @@ import { | |||
} from 'design-system'; | |||
import * as React from 'react'; | |||
import { formatMeasure } from '~sonar-aligned/helpers/measures'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; | |||
import Measure from '../../../components/measure/Measure'; | |||
import { getLeakValue } from '../../../components/measure/utils'; | |||
@@ -40,7 +41,7 @@ import { | |||
isDiffMetric, | |||
} from '../../../helpers/measures'; | |||
import { isApplication, isProject } from '../../../types/component'; | |||
import { Metric, Status, ComponentMeasure as TypeComponentMeasure } from '../../../types/types'; | |||
import { Metric, ComponentMeasure as TypeComponentMeasure } from '../../../types/types'; | |||
interface Props { | |||
component: TypeComponentMeasure; |
@@ -21,12 +21,12 @@ import { LinkHighlight, LinkStandalone } from '@sonarsource/echoes-react'; | |||
import { Badge, BranchIcon, LightLabel, Note, QualifierIcon } from 'design-system'; | |||
import * as React from 'react'; | |||
import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { queryToSearchString } from '~sonar-aligned/helpers/urls'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { isDefined } from '../../../helpers/types'; | |||
import { CodeScope, getComponentOverviewUrl } from '../../../helpers/urls'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { BranchLike } from '../../../types/branch-like'; | |||
import { isApplication, isProject } from '../../../types/component'; | |||
import { ComponentMeasure } from '../../../types/types'; |
@@ -23,12 +23,12 @@ import { isEmpty, omit } from 'lodash'; | |||
import * as React from 'react'; | |||
import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { Location, Router } from '~sonar-aligned/types/router'; | |||
import { getTree } from '../../../api/components'; | |||
import { KeyboardKeys } from '../../../helpers/keycodes'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { BranchLike } from '../../../types/branch-like'; | |||
import { isView } from '../../../types/component'; | |||
import { ComponentMeasure } from '../../../types/types'; |
@@ -17,12 +17,11 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; | |||
import { getBranchLikeQuery, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
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 { Breadcrumb, ComponentMeasure } from '../../types/types'; |
@@ -30,6 +30,7 @@ import { | |||
Modal, | |||
} from 'design-system'; | |||
import * as React from 'react'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import FormattingTips from '../../../components/common/FormattingTips'; | |||
import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; | |||
import { RULE_STATUSES } from '../../../helpers/constants'; | |||
@@ -43,7 +44,7 @@ import { | |||
CleanCodeAttributeCategory, | |||
SoftwareImpact, | |||
} from '../../../types/clean-code-taxonomy'; | |||
import { Dict, RuleDetails, RuleParameter, Status } from '../../../types/types'; | |||
import { Dict, RuleDetails, RuleParameter } from '../../../types/types'; | |||
import { | |||
CleanCodeAttributeField, | |||
CleanCodeCategoryField, |
@@ -33,7 +33,8 @@ import * as React from 'react'; | |||
import { Helmet } from 'react-helmet-async'; | |||
import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; | |||
import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; | |||
import { getBranchLikeQuery, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { MetricKey } from '~sonar-aligned/types/metrics'; | |||
import { Location, Router } from '~sonar-aligned/types/router'; | |||
@@ -44,11 +45,10 @@ import Suggestions from '../../../components/embed-docs-modal/Suggestions'; | |||
import { enhanceMeasure } from '../../../components/measure/utils'; | |||
import '../../../components/search-navigator.css'; | |||
import AnalysisMissingInfoMessage from '../../../components/shared/AnalysisMissingInfoMessage'; | |||
import { isPullRequest, isSameBranchLike } from '../../../helpers/branch-like'; | |||
import { isSameBranchLike } from '../../../helpers/branch-like'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { areLeakAndOverallCCTMeasuresComputed } from '../../../helpers/measures'; | |||
import { WithBranchLikesProps, useBranchesQuery } from '../../../queries/branch'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { MeasurePageView } from '../../../types/measures'; | |||
import { ComponentMeasure, Dict, MeasureEnhanced, Metric, Period } from '../../../types/types'; | |||
import Sidebar from '../sidebar/Sidebar'; |
@@ -18,12 +18,11 @@ | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { groupBy, memoize, sortBy, toPairs } from 'lodash'; | |||
import { isBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isBranch, isPullRequest } 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'; | |||
import { | |||
CCT_SOFTWARE_QUALITY_METRICS, | |||
HIDDEN_METRICS, |
@@ -36,7 +36,8 @@ import { Helmet } from 'react-helmet-async'; | |||
import { FormattedMessage } from 'react-intl'; | |||
import A11ySkipTarget from '~sonar-aligned/components/a11y/A11ySkipTarget'; | |||
import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; | |||
import { getBranchLikeQuery, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { Location, RawQuery, Router } from '~sonar-aligned/types/router'; | |||
import { listIssues, searchIssues } from '../../../api/issues'; | |||
@@ -54,7 +55,7 @@ import withIndexationGuard from '../../../components/hoc/withIndexationGuard'; | |||
import IssueTabViewer from '../../../components/rules/IssueTabViewer'; | |||
import '../../../components/search-navigator.css'; | |||
import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; | |||
import { fillBranchLike, isPullRequest, isSameBranchLike } from '../../../helpers/branch-like'; | |||
import { fillBranchLike, isSameBranchLike } from '../../../helpers/branch-like'; | |||
import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication'; | |||
import { parseIssueFromResponse } from '../../../helpers/issues'; | |||
import { isInput, isShortcut } from '../../../helpers/keyboardEventHelpers'; | |||
@@ -62,7 +63,6 @@ import { KeyboardKeys } from '../../../helpers/keycodes'; | |||
import { translate, translateWithParameters } from '../../../helpers/l10n'; | |||
import { serializeDate } from '../../../helpers/query'; | |||
import { withBranchLikes } from '../../../queries/branch'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { BranchLike } from '../../../types/branch-like'; | |||
import { isProject } from '../../../types/component'; | |||
import { |
@@ -32,13 +32,12 @@ import { | |||
themeColor, | |||
} from 'design-system'; | |||
import * as React from 'react'; | |||
import { getBranchLikeQuery, isBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { getBranchLikeQuery, isBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { getComponentIssuesUrl } from '~sonar-aligned/helpers/urls'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { ComponentContext } from '../../../app/components/componentContext/ComponentContext'; | |||
import { useCurrentUser } from '../../../app/components/current-user/CurrentUserContext'; | |||
import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils'; | |||
import { isPullRequest } from '../../../helpers/branch-like'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path'; | |||
import { getBranchLikeUrl } from '../../../helpers/urls'; |
@@ -20,12 +20,11 @@ | |||
import { BasicSeparator, FlagMessage, Link } from 'design-system'; | |||
import * as React from 'react'; | |||
import { FormattedMessage } from 'react-intl'; | |||
import { isBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import withAppStateContext from '../../../app/components/app-state/withAppStateContext'; | |||
import { isPullRequest } from '../../../helpers/branch-like'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { AppState } from '../../../types/appstate'; | |||
import { BranchLike } from '../../../types/branch-like'; | |||
import { isApplication, isProject, isView } from '../../../types/component'; |
@@ -21,6 +21,7 @@ import { QualityGateIndicator } from 'design-system'; | |||
import { sortBy } from 'lodash'; | |||
import * as React from 'react'; | |||
import { FormattedMessage } from 'react-intl'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter'; | |||
import { | |||
@@ -28,7 +29,6 @@ import { | |||
ProjectAnalysisEventCategory, | |||
Analysis as TypeAnalysis, | |||
} from '../../../types/project-activity'; | |||
import { Status } from '../../../types/types'; | |||
import { AnalysisVariations } from './AnalysisVariations'; | |||
import Event from './Event'; | |||
@@ -27,12 +27,12 @@ import { | |||
import * as React from 'react'; | |||
import A11ySkipTarget from '~sonar-aligned/components/a11y/A11ySkipTarget'; | |||
import { useLocation, useRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import AnalysisMissingInfoMessage from '../../../components/shared/AnalysisMissingInfoMessage'; | |||
import { parseDate } from '../../../helpers/dates'; | |||
import { areCCTMeasuresComputed, isDiffMetric } from '../../../helpers/measures'; | |||
import { CodeScope } from '../../../helpers/urls'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { ApplicationPeriod } from '../../../types/application'; | |||
import { Branch } from '../../../types/branch-like'; | |||
import { Analysis, GraphType, MeasureHistory } from '../../../types/project-activity'; |
@@ -20,8 +20,8 @@ | |||
import { QualityGateIndicator, TextError } from 'design-system'; | |||
import React from 'react'; | |||
import { useIntl } from 'react-intl'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { Status } from '../../../types/types'; | |||
interface Props { | |||
status: Status; |
@@ -19,13 +19,14 @@ | |||
*/ | |||
import { screen } from '@testing-library/react'; | |||
import * as React from 'react'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
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 { CaycStatus, Status } from '../../../../types/types'; | |||
import { CaycStatus } from '../../../../types/types'; | |||
import { CurrentUser, NoticeType } from '../../../../types/users'; | |||
import QualityGatePanelSection, { QualityGatePanelSectionProps } from '../QualityGatePanelSection'; | |||
@@ -21,8 +21,7 @@ import { Link } from 'design-system'; | |||
import React from 'react'; | |||
import { FormattedMessage } from 'react-intl'; | |||
import { useLocation } from 'react-router-dom'; | |||
import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPullRequest } from '../../../helpers/branch-like'; | |||
import { isBranch, isMainBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { hasMessage, translate } from '../../../helpers/l10n'; | |||
import { getComponentBackgroundTaskUrl } from '../../../helpers/urls'; | |||
import { useBranchesQuery } from '../../../queries/branch'; |
@@ -19,15 +19,15 @@ | |||
*/ | |||
import * as React from 'react'; | |||
import { Helmet } from 'react-helmet-async'; | |||
import { isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import withAvailableFeatures, { | |||
WithAvailableFeaturesProps, | |||
} from '../../../app/components/available-features/withAvailableFeatures'; | |||
import withComponentContext from '../../../app/components/componentContext/withComponentContext'; | |||
import Suggestions from '../../../components/embed-docs-modal/Suggestions'; | |||
import { isPullRequest } from '../../../helpers/branch-like'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { useBranchesQuery } from '../../../queries/branch'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { Feature } from '../../../types/features'; | |||
import { Component } from '../../../types/types'; | |||
import BranchOverview from '../branches/BranchOverview'; |
@@ -21,9 +21,10 @@ import { HelperHintIcon, LightPrimary, QualityGateIndicator, TextMuted } from 'd | |||
import React from 'react'; | |||
import { useIntl } from 'react-intl'; | |||
import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { BranchLike } from '../../../types/branch-like'; | |||
import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates'; | |||
import { Component, Status } from '../../../types/types'; | |||
import { Component } from '../../../types/types'; | |||
import BranchQualityGateConditions from './BranchQualityGateConditions'; | |||
interface Props { |
@@ -31,9 +31,9 @@ import { | |||
} from 'design-system'; | |||
import React from 'react'; | |||
import { useIntl } from 'react-intl'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { useCurrentUser } from '../../../app/components/current-user/CurrentUserContext'; | |||
import useLocalStorage from '../../../hooks/useLocalStorage'; | |||
import { Status } from '../../../types/types'; | |||
import { isLoggedIn } from '../../../types/users'; | |||
import { Status as QGStatus } from '../utils'; | |||
@@ -20,12 +20,12 @@ | |||
import { ButtonPrimary, FlagMessage, Title } from 'design-system'; | |||
import * as React from 'react'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import GitHubSynchronisationWarning from '../../../../app/components/GitHubSynchronisationWarning'; | |||
import { Image } from '../../../../components/common/Image'; | |||
import { translate } from '../../../../helpers/l10n'; | |||
import { isDefined } from '../../../../helpers/types'; | |||
import { useGithubProvisioningEnabledQuery } from '../../../../queries/identity-provider/github'; | |||
import { isPortfolioLike } from '../../../../sonar-aligned/helpers/component'; | |||
import { isApplication, isProject } from '../../../../types/component'; | |||
import { Component } from '../../../../types/types'; | |||
import ApplyTemplate from './ApplyTemplate'; |
@@ -19,9 +19,9 @@ | |||
*/ | |||
import { InputSelect, LabelValueSelectOption } from 'design-system'; | |||
import * as React from 'react'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { isPortfolioLike } from '../../../sonar-aligned/helpers/component'; | |||
import { | |||
ApplicationAnalysisEventCategory, | |||
ProjectAnalysisEventCategory, |
@@ -27,11 +27,11 @@ import { | |||
TableRowInteractive, | |||
} from 'design-system'; | |||
import * as React from 'react'; | |||
import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isBranch, isMainBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import QualityGateStatus from '../../../app/components/nav/component/branch-like/QualityGateStatus'; | |||
import BranchLikeIcon from '../../../components/icon-mappers/BranchLikeIcon'; | |||
import DateFromNow from '../../../components/intl/DateFromNow'; | |||
import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branch-like'; | |||
import { getBranchLikeDisplayName } from '../../../helpers/branch-like'; | |||
import { translate, translateWithParameters } from '../../../helpers/l10n'; | |||
import { BranchLike } from '../../../types/branch-like'; | |||
import { Component } from '../../../types/types'; |
@@ -22,8 +22,8 @@ import { IconGitBranch, IconPullrequest } from '@sonarsource/echoes-react'; | |||
import { ToggleButton, getTabId, getTabPanelId } from 'design-system'; | |||
import * as React from 'react'; | |||
import { useState } from 'react'; | |||
import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPullRequest, sortBranches, sortPullRequests } from '../../../helpers/branch-like'; | |||
import { isBranch, isMainBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { sortBranches, sortPullRequests } from '../../../helpers/branch-like'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { useBranchesQuery } from '../../../queries/branch'; | |||
import { Branch, BranchLike, PullRequest } from '../../../types/branch-like'; |
@@ -20,7 +20,8 @@ | |||
import { DangerButtonPrimary, Modal } from 'design-system'; | |||
import * as React from 'react'; | |||
import { FormattedMessage } from 'react-intl'; | |||
import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branch-like'; | |||
import { isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { getBranchLikeDisplayName } from '../../../helpers/branch-like'; | |||
import { useDeletBranchMutation } from '../../../queries/branch'; | |||
import { BranchLike } from '../../../types/branch-like'; | |||
import { Component } from '../../../types/types'; |
@@ -21,12 +21,12 @@ | |||
import { DangerButtonPrimary, addGlobalSuccessMessage } from 'design-system'; | |||
import * as React from 'react'; | |||
import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { Router } from '~sonar-aligned/types/router'; | |||
import { deleteApplication } from '../../api/application'; | |||
import { deletePortfolio, deleteProject } from '../../api/project-management'; | |||
import ConfirmButton from '../../components/controls/ConfirmButton'; | |||
import { translate, translateWithParameters } from '../../helpers/l10n'; | |||
import { isPortfolioLike } from '../../sonar-aligned/helpers/component'; | |||
import { isApplication } from '../../types/component'; | |||
import { Component } from '../../types/types'; | |||
@@ -19,8 +19,8 @@ | |||
*/ | |||
import { Title } from 'design-system'; | |||
import * as React from 'react'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { translate } from '../../helpers/l10n'; | |||
import { isPortfolioLike } from '../../sonar-aligned/helpers/component'; | |||
import { isApplication } from '../../types/component'; | |||
import { Component } from '../../types/types'; | |||
@@ -38,6 +38,7 @@ import { isEmpty } from 'lodash'; | |||
import * as React from 'react'; | |||
import { FormattedMessage } from 'react-intl'; | |||
import { formatMeasure } from '~sonar-aligned/helpers/measures'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { MetricKey, MetricType } from '~sonar-aligned/types/metrics'; | |||
import Favorite from '../../../../components/controls/Favorite'; | |||
@@ -48,7 +49,6 @@ import Measure from '../../../../components/measure/Measure'; | |||
import { translate, translateWithParameters } from '../../../../helpers/l10n'; | |||
import { isDefined } from '../../../../helpers/types'; | |||
import { getProjectUrl } from '../../../../helpers/urls'; | |||
import { Status } from '../../../../types/types'; | |||
import { CurrentUser, isLoggedIn } from '../../../../types/users'; | |||
import { Project } from '../../types'; | |||
import ProjectCardLanguages from './ProjectCardLanguages'; |
@@ -21,10 +21,10 @@ import { FacetBox, FacetItem, HelperHintIcon, QualityGateIndicator } from 'desig | |||
import { without } from 'lodash'; | |||
import * as React from 'react'; | |||
import HelpTooltip from '~sonar-aligned/components/controls/HelpTooltip'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { RawQuery } from '~sonar-aligned/types/router'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { isDefined } from '../../../helpers/types'; | |||
import { Status } from '../../../types/types'; | |||
import { FacetItemsList } from '../../issues/sidebar/FacetItemsList'; | |||
import { formatFacetStat } from '../../issues/utils'; | |||
import { Facet } from '../types'; |
@@ -21,7 +21,7 @@ | |||
import { flatMap, range } from 'lodash'; | |||
import * as React from 'react'; | |||
import { withRouter } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { getBranchLikeQuery } from '~sonar-aligned/helpers/branch-like'; | |||
import { getBranchLikeQuery, isPullRequest } 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'; | |||
@@ -31,7 +31,7 @@ import withComponentContext from '../../app/components/componentContext/withComp | |||
import withCurrentUserContext from '../../app/components/current-user/withCurrentUserContext'; | |||
import withIndexationGuard from '../../components/hoc/withIndexationGuard'; | |||
import { getLeakValue } from '../../components/measure/utils'; | |||
import { isPullRequest, isSameBranchLike } from '../../helpers/branch-like'; | |||
import { isSameBranchLike } from '../../helpers/branch-like'; | |||
import { isInput } from '../../helpers/keyboardEventHelpers'; | |||
import { KeyboardKeys } from '../../helpers/keycodes'; | |||
import { getStandards } from '../../helpers/security-standard'; |
@@ -26,8 +26,8 @@ import { | |||
} from 'design-system'; | |||
import { groupBy, sortBy } from 'lodash'; | |||
import React, { Fragment, PureComponent } from 'react'; | |||
import { isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { isPullRequest } from '../../../helpers/branch-like'; | |||
import { translate } from '../../../helpers/l10n'; | |||
import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path'; | |||
import { getProjectUrl } from '../../../helpers/urls'; |
@@ -21,8 +21,7 @@ | |||
import { IconBranch, IconGitBranch, IconProps, IconPullrequest } from '@sonarsource/echoes-react'; | |||
import { StyledMutedText } from 'design-system'; | |||
import * as React from 'react'; | |||
import { isMainBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPullRequest } from '../../helpers/branch-like'; | |||
import { isMainBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { BranchLike } from '../../types/branch-like'; | |||
export interface BranchLikeIconProps extends IconProps { |
@@ -20,10 +20,10 @@ | |||
import { MetricsRatingBadge, QualityGateIndicator, RatingLabel } from 'design-system'; | |||
import * as React from 'react'; | |||
import { formatMeasure } from '~sonar-aligned/helpers/measures'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { MetricType } from '~sonar-aligned/types/metrics'; | |||
import Tooltip from '../../components/controls/Tooltip'; | |||
import { translate, translateWithParameters } from '../../helpers/l10n'; | |||
import { Status } from '../../types/types'; | |||
import RatingTooltipContent from './RatingTooltipContent'; | |||
interface Props { |
@@ -18,17 +18,13 @@ | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { orderBy } from 'lodash'; | |||
import { isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isBranch, isMainBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { Branch, BranchLike, BranchLikeTree, PullRequest } from '../types/branch-like'; | |||
export function sortBranches(branches: Branch[]) { | |||
return orderBy(branches, [(b) => b.isMain, (b) => b.name], ['desc', 'asc']); | |||
} | |||
export function isPullRequest(branchLike?: BranchLike): branchLike is PullRequest { | |||
return branchLike !== undefined && (branchLike as PullRequest).key !== undefined; | |||
} | |||
export function sortPullRequests(pullRequests: PullRequest[]) { | |||
return orderBy(pullRequests, (pr) => getPullRequestDisplayName(pr)); | |||
} |
@@ -18,20 +18,24 @@ | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { Path, To } from 'react-router-dom'; | |||
import { getBranchLikeQuery, isBranch, isMainBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { | |||
getBranchLikeQuery, | |||
isBranch, | |||
isMainBranch, | |||
isPullRequest, | |||
} from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { queryToSearchString } from '~sonar-aligned/helpers/urls'; | |||
import { BranchParameters } from '~sonar-aligned/types/branch-like'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { getProfilePath } from '../apps/quality-profiles/utils'; | |||
import { DEFAULT_ISSUES_QUERY } from '../components/shared/utils'; | |||
import { isPortfolioLike } from '../sonar-aligned/helpers/component'; | |||
import { BranchLike } from '../types/branch-like'; | |||
import { isApplication } from '../types/component'; | |||
import { MeasurePageView } from '../types/measures'; | |||
import { GraphType } from '../types/project-activity'; | |||
import { Dict } from '../types/types'; | |||
import { HomePage } from '../types/users'; | |||
import { isPullRequest } from './branch-like'; | |||
import { serializeOptionalBoolean } from './query'; | |||
import { getBaseUrl } from './system'; | |||
@@ -23,7 +23,8 @@ import * as React from 'react'; | |||
import { useCallback, useContext } from 'react'; | |||
import { useSearchParams } from 'react-router-dom'; | |||
import { useLocation } from '~sonar-aligned/components/hoc/withRouter'; | |||
import { isBranch } from '~sonar-aligned/helpers/branch-like'; | |||
import { isBranch, isPullRequest } from '~sonar-aligned/helpers/branch-like'; | |||
import { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { searchParamsToQuery } from '~sonar-aligned/helpers/router'; | |||
import { | |||
deleteBranch, | |||
@@ -37,9 +38,7 @@ import { | |||
import { dismissAnalysisWarning, getAnalysisStatus } from '../api/ce'; | |||
import { getQualityGateProjectStatus } from '../api/quality-gates'; | |||
import { AvailableFeaturesContext } from '../app/components/available-features/AvailableFeaturesContext'; | |||
import { isPullRequest } from '../helpers/branch-like'; | |||
import { extractStatusConditionsFromProjectStatus } from '../helpers/qualityGates'; | |||
import { isPortfolioLike } from '../sonar-aligned/helpers/component'; | |||
import { Branch, BranchLike } from '../types/branch-like'; | |||
import { isApplication, isProject } from '../types/component'; | |||
import { Feature } from '../types/features'; |
@@ -17,25 +17,37 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { isPullRequest } from '../../helpers/branch-like'; | |||
import { | |||
BranchBase, | |||
BranchLikeBase, | |||
BranchParameters, | |||
PullRequestBase, | |||
} from '~sonar-aligned/types/branch-like'; | |||
import { BranchParameters } from '~sonar-aligned/types/branch-like'; | |||
import { Branch, BranchLike, MainBranch } from '../../types/branch-like'; | |||
export function getBranchLikeQuery( | |||
branchLike?: BranchLike, | |||
includeMainBranch = false, | |||
export function getBranchLikeQuery<T extends BranchLikeBase>( | |||
branchLike?: T, | |||
withMainBranch = false, | |||
): BranchParameters { | |||
if (isBranch(branchLike) && (includeMainBranch || !isMainBranch(branchLike))) { | |||
if (isBranch(branchLike) && (withMainBranch || !isMainBranch(branchLike))) { | |||
return { branch: branchLike.name }; | |||
} else if (isPullRequest(branchLike)) { | |||
return { pullRequest: branchLike.key }; | |||
} | |||
return {}; | |||
} | |||
export function isBranch(branchLike?: BranchLike): branchLike is Branch { | |||
return branchLike !== undefined && (branchLike as Branch).isMain !== undefined; | |||
export function isBranch<T extends BranchBase>(branchLike?: T | PullRequestBase): branchLike is T { | |||
return branchLike !== undefined && (branchLike as T).isMain !== undefined; | |||
} | |||
export function isMainBranch(branchLike?: BranchLike): branchLike is MainBranch { | |||
export function isMainBranch<T extends BranchBase>( | |||
branchLike?: T | PullRequestBase, | |||
): branchLike is T & { isMain: true } { | |||
return isBranch(branchLike) && branchLike.isMain; | |||
} | |||
export function isPullRequest<T extends PullRequestBase>( | |||
branchLike?: T | BranchBase, | |||
): branchLike is T { | |||
return branchLike !== undefined && (branchLike as T).key !== undefined; | |||
} |
@@ -21,9 +21,9 @@ import { mapValues, omitBy, pick } from 'lodash'; | |||
import { Path, URLSearchParamsInit, createSearchParams } from 'react-router-dom'; | |||
import { cleanQuery } from '../../helpers/query'; | |||
import { Query } from '../../helpers/urls'; | |||
import { BranchLike } from '../../types/branch-like'; | |||
import { SecurityStandard } from '../../types/security'; | |||
import { getBranchLikeQuery } from '../helpers/branch-like'; | |||
import { BranchLikeBase } from '../types/branch-like'; | |||
import { RawQuery } from '../types/router'; | |||
export function queryToSearchString(query: RawQuery | URLSearchParamsInit = {}) { | |||
@@ -56,7 +56,7 @@ export function getComponentIssuesUrl(componentKey: string, query?: Query): Part | |||
*/ | |||
export function getComponentSecurityHotspotsUrl( | |||
componentKey: string, | |||
branchLike?: BranchLike, | |||
branchLike?: BranchLikeBase, | |||
query: Query = {}, | |||
): Partial<Path> { | |||
const { inNewCodePeriod, hotspots, assignedToMe, files } = query; |
@@ -17,4 +17,27 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { Status } from './common'; | |||
export type BranchParameters = { branch?: string } | { pullRequest?: string }; | |||
export type BranchLikeBase = BranchBase | PullRequestBase; | |||
export interface BranchBase { | |||
analysisDate?: string; | |||
isMain: boolean; | |||
name: string; | |||
status?: { qualityGateStatus: Status }; | |||
} | |||
export interface PullRequestBase { | |||
analysisDate?: string; | |||
base: string; | |||
branch: string; | |||
key: string; | |||
isOrphan?: true; | |||
status?: { qualityGateStatus: Status }; | |||
target: string; | |||
title: string; | |||
url?: string; | |||
} |
@@ -0,0 +1,20 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2024 SonarSource SA | |||
* mailto:info AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
export type Status = 'ERROR' | 'OK' | 'NONE'; |
@@ -17,33 +17,20 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { BranchBase, PullRequestBase } from '~sonar-aligned/types/branch-like'; | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { NewCodeDefinition } from './new-code-definition'; | |||
import { QualityGateStatusCondition } from './quality-gates'; | |||
import { Status } from './types'; | |||
export interface Branch { | |||
analysisDate?: string; | |||
export interface Branch extends BranchBase { | |||
excludedFromPurge: boolean; | |||
isMain: boolean; | |||
name: string; | |||
status?: { qualityGateStatus: Status }; | |||
} | |||
export interface MainBranch extends Branch { | |||
isMain: true; | |||
} | |||
export interface PullRequest { | |||
analysisDate?: string; | |||
base: string; | |||
branch: string; | |||
key: string; | |||
isOrphan?: true; | |||
status?: { qualityGateStatus: Status }; | |||
target: string; | |||
title: string; | |||
url?: string; | |||
} | |||
export interface PullRequest extends PullRequestBase {} | |||
export type BranchLike = Branch | PullRequest; | |||
@@ -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 { isPortfolioLike } from '~sonar-aligned/helpers/component'; | |||
import { ComponentQualifier } from '~sonar-aligned/types/component'; | |||
import { isPortfolioLike } from '../sonar-aligned/helpers/component'; | |||
import { Task } from './tasks'; | |||
import { Component, LightComponent } from './types'; | |||
@@ -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 { Status } from '~sonar-aligned/types/common'; | |||
import { MetricKey } from '~sonar-aligned/types/metrics'; | |||
import { Status } from './types'; | |||
interface BaseAnalysis { | |||
buildString?: string; |
@@ -17,9 +17,10 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { Status } from '~sonar-aligned/types/common'; | |||
import { MetricKey } from '~sonar-aligned/types/metrics'; | |||
import { BranchLike } from './branch-like'; | |||
import { CaycStatus, MeasureEnhanced, Metric, Status } from './types'; | |||
import { CaycStatus, MeasureEnhanced, Metric } from './types'; | |||
import { UserBase } from './users'; | |||
export interface QualityGateProjectStatus { |
@@ -712,8 +712,6 @@ export interface SourceViewerFile { | |||
export type StandardSecurityCategories = Dict<{ title: string; description?: string }>; | |||
export type Status = 'ERROR' | 'OK'; | |||
export interface SubscriptionPlan { | |||
maxNcloc: number; | |||
price: number; |