import * as React from 'react';
import { useLocation } from '../../../../components/hoc/withRouter';
import { DEFAULT_ISSUES_QUERY } from '../../../../components/shared/utils';
-import { getBranchLikeQuery, isPullRequest } from '../../../../helpers/branch-like';
+import { isPullRequest } from '../../../../helpers/branch-like';
import { hasMessage, translate, translateWithParameters } from '../../../../helpers/l10n';
import { getPortfolioUrl, getProjectQueryUrl } from '../../../../helpers/urls';
import { useBranchesQuery } from '../../../../queries/branch';
+import { getBranchLikeQuery } from '../../../../sonar-aligned/helpers/branch-like';
import { BranchParameters } from '../../../../types/branch-like';
import {
ComponentQualifier,
import { Router, withRouter } from '../../../../../components/hoc/withRouter';
import {
getBrancheLikesAsTree,
- isBranch,
isPullRequest,
isSameBranchLike,
} from '../../../../../helpers/branch-like';
import { KeyboardKeys } from '../../../../../helpers/keycodes';
import { translate } from '../../../../../helpers/l10n';
import { getBranchLikeUrl, queryToSearch } from '../../../../../helpers/urls';
+import { isBranch } from '../../../../../sonar-aligned/helpers/branch-like';
import { BranchLike, BranchLikeTree } from '../../../../../types/branch-like';
import { ComponentQualifier } from '../../../../../types/component';
import { Component } from '../../../../../types/types';
import { Badge, ItemButton, TextBold, TextMuted } from 'design-system';
import * as React from 'react';
import BranchLikeIcon from '../../../../../components/icon-mappers/BranchLikeIcon';
-import { getBranchLikeDisplayName, isMainBranch } from '../../../../../helpers/branch-like';
+import { getBranchLikeDisplayName } from '../../../../../helpers/branch-like';
import { translate } from '../../../../../helpers/l10n';
+import { isMainBranch } from '../../../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../../../types/branch-like';
import QualityGateStatus from './QualityGateStatus';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { isBranch } from '../../../../helpers/branch-like';
+import { isBranch } from '../../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../../types/branch-like';
import { ComponentQualifier } from '../../../../types/component';
import { Component } from '../../../../types/types';
import { LinkHighlight, LinkStandalone } from '@sonarsource/echoes-react';
import { Badge, BranchIcon, LightLabel, Note, QualifierIcon } from 'design-system';
import * as React from 'react';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { isDefined } from '../../../helpers/types';
import { CodeScope, getComponentOverviewUrl, queryToSearch } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import {
ComponentQualifier,
import * as React from 'react';
import { getTree } from '../../../api/components';
import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { KeyboardKeys } from '../../../helpers/keycodes';
import { translate } from '../../../helpers/l10n';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { ComponentQualifier, isPortfolioLike, isView } from '../../../types/component';
import { ComponentMeasure } from '../../../types/types';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { getBreadcrumbs, getChildren, getComponent, getComponentData } from '../../api/components';
-import { getBranchLikeQuery, isPullRequest } from '../../helpers/branch-like';
+import { isPullRequest } from '../../helpers/branch-like';
import { CCT_SOFTWARE_QUALITY_METRICS, OLD_TAXONOMY_METRICS } from '../../helpers/constants';
+import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../types/branch-like';
import { ComponentQualifier, isPortfolioLike } from '../../types/component';
import { MetricKey } from '../../types/metrics';
import { enhanceMeasure } from '../../../components/measure/utils';
import '../../../components/search-navigator.css';
import AnalysisMissingInfoMessage from '../../../components/shared/AnalysisMissingInfoMessage';
-import { getBranchLikeQuery, isPullRequest, isSameBranchLike } from '../../../helpers/branch-like';
+import { isPullRequest, isSameBranchLike } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { areLeakAndOverallCCTMeasuresComputed } from '../../../helpers/measures';
import { WithBranchLikesProps, useBranchesQuery } from '../../../queries/branch';
import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { ComponentQualifier, isPortfolioLike } from '../../../types/component';
import { MeasurePageView } from '../../../types/measures';
import { MetricKey } from '../../../types/metrics';
import A11ySkipTarget from '../../../components/a11y/A11ySkipTarget';
import { Router } from '../../../components/hoc/withRouter';
import FilesCounter from '../../../components/ui/FilesCounter';
-import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like';
+import { isSameBranchLike } from '../../../helpers/branch-like';
import { getComponentMeasureUniqueKey } from '../../../helpers/component';
import { KeyboardKeys } from '../../../helpers/keycodes';
import { translate } from '../../../helpers/l10n';
import { RequestData } from '../../../helpers/request';
import { isDefined } from '../../../helpers/types';
import { getProjectUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { isApplication, isFile, isView } from '../../../types/component';
import { MeasurePageView } from '../../../types/measures';
import { getComponentLeaves } from '../../../api/components';
import SourceViewer from '../../../components/SourceViewer/SourceViewer';
import A11ySkipTarget from '../../../components/a11y/A11ySkipTarget';
-import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like';
+import { isSameBranchLike } from '../../../helpers/branch-like';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { isFile } from '../../../types/component';
import {
import * as React from 'react';
import { getComponentShow } from '../../../api/components';
import { Router } from '../../../components/hoc/withRouter';
-import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like';
+import { isSameBranchLike } from '../../../helpers/branch-like';
import { getProjectUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { isView } from '../../../types/component';
import {
import { Breadcrumbs, ClipboardIconButton, HoverLink } from 'design-system';
import * as React from 'react';
import { getBreadcrumbs } from '../../../api/components';
-import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branch-like';
+import { isSameBranchLike } from '../../../helpers/branch-like';
import { KeyboardKeys } from '../../../helpers/keycodes';
import { translate } from '../../../helpers/l10n';
import { collapsePath, limitComponentName } from '../../../helpers/path';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { ComponentQualifier, isProject } from '../../../types/component';
import { ComponentMeasure, ComponentMeasureIntern } from '../../../types/types';
*/
import { groupBy, memoize, sortBy, toPairs } from 'lodash';
import { enhanceMeasure } from '../../components/measure/utils';
-import { isBranch, isPullRequest } from '../../helpers/branch-like';
+import { isPullRequest } from '../../helpers/branch-like';
import {
CCT_SOFTWARE_QUALITY_METRICS,
HIDDEN_METRICS,
parseAsString,
serializeString,
} from '../../helpers/query';
+import { isBranch } from '../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../types/branch-like';
import { ComponentQualifier } from '../../types/component';
import { Domain, MeasurePageView } from '../../types/measures';
import { updateIssue } from '../../../components/issue/actions';
import IssueActionsBar from '../../../components/issue/components/IssueActionsBar';
import { WorkspaceContext } from '../../../components/workspace/context';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { isInput, isShortcut } from '../../../helpers/keyboardEventHelpers';
import { KeyboardKeys } from '../../../helpers/keycodes';
import { translate } from '../../../helpers/l10n';
import { getKeyboardShortcutEnabled } from '../../../helpers/preferences';
import { getComponentIssuesUrl, getPathUrlAsString, getRuleUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { IssueActions, IssueType } from '../../../types/issues';
import { Issue, RuleDetails } from '../../../types/types';
import IssueTabViewer from '../../../components/rules/IssueTabViewer';
import '../../../components/search-navigator.css';
import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils';
-import {
- fillBranchLike,
- getBranchLikeQuery,
- isPullRequest,
- isSameBranchLike,
-} from '../../../helpers/branch-like';
+import { fillBranchLike, isPullRequest, isSameBranchLike } from '../../../helpers/branch-like';
import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication';
import { parseIssueFromResponse } from '../../../helpers/issues';
import { isInput, isShortcut } from '../../../helpers/keyboardEventHelpers';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { serializeDate } from '../../../helpers/query';
import { withBranchLikes } from '../../../queries/branch';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { ComponentQualifier, isPortfolioLike, isProject } from '../../../types/component';
import {
import { getSources } from '../../../api/components';
import getCoverageStatus from '../../../components/SourceViewer/helpers/getCoverageStatus';
import { locationsByLine } from '../../../components/SourceViewer/helpers/indexing';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { isFile } from '../../../types/component';
import { IssueDeprecatedStatus } from '../../../types/issues';
issuesByComponentAndLine,
} from '../../../components/SourceViewer/helpers/indexing';
import { WorkspaceContext } from '../../../components/workspace/context';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { HttpStatus } from '../../../helpers/request';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { throwGlobalError } from '../../../sonar-aligned/helpers/error';
import { BranchLike } from '../../../types/branch-like';
import { isFile } from '../../../types/component';
import { ComponentContext } from '../../../app/components/componentContext/ComponentContext';
import { useCurrentUser } from '../../../app/components/current-user/CurrentUserContext';
import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils';
-import { getBranchLikeQuery, isBranch, isPullRequest } from '../../../helpers/branch-like';
+import { isPullRequest } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { collapsedDirFromPath, fileFromPath } from '../../../helpers/path';
import { getBranchLikeUrl, getComponentIssuesUrl } from '../../../helpers/urls';
import { useBranchesQuery } from '../../../queries/branch';
+import { getBranchLikeQuery, isBranch } from '../../../sonar-aligned/helpers/branch-like';
import { ComponentQualifier } from '../../../types/component';
import { SourceViewerFile } from '../../../types/types';
import { isLoggedIn } from '../../../types/users';
import { omit } from 'lodash';
import * as React from 'react';
import { getDirectories } from '../../../api/components';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { collapsePath } from '../../../helpers/path';
import { highlightTerm } from '../../../helpers/search';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { TreeComponentWithPath } from '../../../types/component';
import { Facet } from '../../../types/issues';
import { omit } from 'lodash';
import * as React from 'react';
import { getFiles } from '../../../api/components';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { collapsePath, splitPath } from '../../../helpers/path';
import { highlightTerm } from '../../../helpers/search';
import { isDefined } from '../../../helpers/types';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { TreeComponentWithPath } from '../../../types/component';
import { Facet } from '../../../types/issues';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import withAppStateContext from '../../../app/components/app-state/withAppStateContext';
-import { isBranch, isPullRequest } from '../../../helpers/branch-like';
+import { isPullRequest } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
+import { isBranch } from '../../../sonar-aligned/helpers/branch-like';
import { AppState } from '../../../types/appstate';
import { BranchLike } from '../../../types/branch-like';
import {
*/
import { Card, FlagMessage, Link } from 'design-system';
import * as React from 'react';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { useDocUrl } from '../../../helpers/docs';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { getProjectQueryUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { QualityGateStatus } from '../../../types/quality-gates';
interface Props {
getHistoryMetrics,
saveActivityGraph,
} from '../../../components/activity-graph/utils';
-import {
- getBranchLikeDisplayName,
- getBranchLikeQuery,
- isMainBranch,
-} from '../../../helpers/branch-like';
+import { getBranchLikeDisplayName } from '../../../helpers/branch-like';
import { parseDate, toISO8601WithOffsetString } from '../../../helpers/dates';
import { enhanceConditionWithMeasure, enhanceMeasuresWithMetrics } from '../../../helpers/measures';
import {
extractStatusConditionsFromProjectStatus,
} from '../../../helpers/qualityGates';
import { isDefined } from '../../../helpers/types';
+import { getBranchLikeQuery, isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { ApplicationPeriod } from '../../../types/application';
import { Branch, BranchLike } from '../../../types/branch-like';
import { ComponentQualifier } from '../../../types/component';
import { FormattedMessage } from 'react-intl';
import DocumentationLink from '../../../components/common/DocumentationLink';
import { Image } from '../../../components/common/Image';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { CodeScope, queryToSearch } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { Branch } from '../../../types/branch-like';
import { ComponentQualifier } from '../../../types/component';
import { NewCodeDefinitionType } from '../../../types/new-code-definition';
import { useIntl } from 'react-intl';
import { getLeakValue } from '../../../components/measure/utils';
import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { findMeasure, formatMeasure, formatRating } from '../../../helpers/measures';
import {
CodeScope,
getComponentIssuesUrl,
getComponentSecurityHotspotsUrl,
} from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { Branch } from '../../../types/branch-like';
import { isApplication } from '../../../types/component';
import { IssueStatus } from '../../../types/issues';
*/
import { FlagMessage } from 'design-system';
import * as React from 'react';
-import { getBranchLikeDisplayName, isMainBranch } from '../../../helpers/branch-like';
+import { getBranchLikeDisplayName } from '../../../helpers/branch-like';
import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { ComponentQualifier } from '../../../types/component';
import { MetricKey } from '../../../types/metrics';
} from 'design-system';
import * as React from 'react';
import { useIntl } from 'react-intl';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { findMeasure, formatMeasure, formatRating } from '../../../helpers/measures';
import {
CodeScope,
getComponentIssuesUrl,
getComponentSecurityHotspotsUrl,
} from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { Branch } from '../../../types/branch-like';
import { SoftwareQuality } from '../../../types/clean-code-taxonomy';
import { isApplication } from '../../../types/component';
isIssueMeasure,
propsToIssueParams,
} from '../../../components/shared/utils';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { formatMeasure, isDiffMetric, localizeMetric } from '../../../helpers/measures';
import { getOperatorLabel } from '../../../helpers/qualityGates';
getComponentIssuesUrl,
getComponentSecurityHotspotsUrl,
} from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { IssueType } from '../../../types/issues';
import { MetricKey, MetricType } from '../../../types/metrics';
import { Highlight, LinkBox } from 'design-system';
import * as React from 'react';
import { propsToIssueParams } from '../../../components/shared/utils';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { formatMeasure, isDiffMetric, localizeMetric } from '../../../helpers/measures';
import { getComponentIssuesUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { MetricKey, MetricType } from '../../../types/metrics';
import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates';
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { useLocation } from 'react-router-dom';
-import { isBranch, isMainBranch, isPullRequest } from '../../../helpers/branch-like';
+import { isPullRequest } from '../../../helpers/branch-like';
import { hasMessage, translate } from '../../../helpers/l10n';
import { getComponentBackgroundTaskUrl } from '../../../helpers/urls';
import { useBranchesQuery } from '../../../queries/branch';
+import { isBranch, isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { Task } from '../../../types/tasks';
import { Component } from '../../../types/types';
import { Navigate } from 'react-router-dom';
import { getScannableProjects } from '../../../api/components';
import withCurrentUserContext from '../../../app/components/current-user/withCurrentUserContext';
-import { getBranchLikeDisplayName, isBranch, isMainBranch } from '../../../helpers/branch-like';
+import { getBranchLikeDisplayName } from '../../../helpers/branch-like';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { getProjectTutorialLocation } from '../../../helpers/urls';
import { hasGlobalPermission } from '../../../helpers/users';
import { useTaskForComponentQuery } from '../../../queries/component';
+import { isBranch, isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { ComponentQualifier } from '../../../types/component';
import { Permissions } from '../../../types/permissions';
isIssueMeasure,
propsToIssueParams,
} from '../../../components/shared/utils';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { getLocalizedMetricName, translate } from '../../../helpers/l10n';
import { formatMeasure, getShortType, isDiffMetric } from '../../../helpers/measures';
import {
getComponentIssuesUrl,
getComponentSecurityHotspotsUrl,
} from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { IssueType } from '../../../types/issues';
import { MetricType } from '../../../types/metrics';
import { useIntl } from 'react-intl';
import { getLeakValue } from '../../../components/measure/utils';
import { DEFAULT_ISSUES_QUERY } from '../../../components/shared/utils';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { findMeasure, formatMeasure } from '../../../helpers/measures';
import { getComponentIssuesUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { PullRequest } from '../../../types/branch-like';
import { MetricKey, MetricType } from '../../../types/metrics';
import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates';
import classNames from 'classnames';
import * as React from 'react';
import { getLeakValue } from '../../../components/measure/utils';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { findMeasure } from '../../../helpers/measures';
import { getComponentDrilldownUrl, getComponentSecurityHotspotsUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { PullRequest } from '../../../types/branch-like';
import { MetricKey } from '../../../types/metrics';
import { QualityGateStatusConditionEnhanced } from '../../../types/quality-gates';
import { BasicSeparator, CenteredLayout, PageContentFontWrapper, Spinner } from 'design-system';
import { uniq } from 'lodash';
import * as React from 'react';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { enhanceConditionWithMeasure, enhanceMeasuresWithMetrics } from '../../../helpers/measures';
import { isDefined } from '../../../helpers/types';
import { useBranchStatusQuery } from '../../../queries/branch';
import { useComponentMeasuresWithMetricsQuery } from '../../../queries/component';
import { useComponentQualityGateQuery } from '../../../queries/quality-gates';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { PullRequest } from '../../../types/branch-like';
import { Component } from '../../../types/types';
import { AnalysisStatus } from '../components/AnalysisStatus';
isCustomGraph,
} from '../../../components/activity-graph/utils';
import { useLocation, useRouter } from '../../../components/hoc/withRouter';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { parseDate } from '../../../helpers/dates';
import useApplicationLeakQuery from '../../../queries/applications';
import { useBranchesQuery } from '../../../queries/branch';
import { useAllMeasuresHistoryQuery } from '../../../queries/measures';
import { useAllProjectAnalysesQuery } from '../../../queries/project-analyses';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { isApplication, isPortfolioLike, isProject } from '../../../types/component';
import { MetricKey } from '../../../types/metrics';
import { MeasureHistory, ParsedAnalysis } from '../../../types/project-activity';
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,
- isBranch,
- isMainBranch,
- isPullRequest,
-} from '../../../helpers/branch-like';
+import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branch-like';
import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { isBranch, isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { Component } from '../../../types/types';
import BranchPurgeSetting from './BranchPurgeSetting';
import { ToggleButton, getTabId, getTabPanelId } from 'design-system';
import * as React from 'react';
import { useState } from 'react';
-import {
- isBranch,
- isMainBranch,
- isPullRequest,
- sortBranches,
- sortPullRequests,
-} from '../../../helpers/branch-like';
+import { isPullRequest, sortBranches, sortPullRequests } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { useBranchesQuery } from '../../../queries/branch';
+import { isBranch, isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { Branch, BranchLike, PullRequest } from '../../../types/branch-like';
import { Component } from '../../../types/types';
import BranchLikeTable from './BranchLikeTable';
import { HelperHintIcon, Spinner, Switch } from 'design-system';
import * as React from 'react';
import { useEffect } from 'react';
-import { isMainBranch } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { useExcludeFromPurgeMutation } from '../../../queries/branch';
import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip';
+import { isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { Branch } from '../../../types/branch-like';
import { Component } from '../../../types/types';
import * as React from 'react';
import { useState } from 'react';
import { Image } from '../../../components/common/Image';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { localizeMetric } from '../../../helpers/measures';
import {
useBadgeTokenQuery,
useRenewBagdeTokenMutation,
} from '../../../queries/badges';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { MetricKey } from '../../../types/metrics';
import { Component } from '../../../types/types';
import { getBranches } from '../../../api/branches';
import { getRegulatoryReportUrl } from '../../../api/regulatory-report';
import DocumentationLink from '../../../components/common/DocumentationLink';
-import {
- getBranchLikeDisplayName,
- getBranchLikeKey,
- isMainBranch,
-} from '../../../helpers/branch-like';
+import { getBranchLikeDisplayName, getBranchLikeKey } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { LabelValueSelectOption } from '../../../helpers/search';
+import { isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { Component } from '../../../types/types';
PreviouslyNonCompliantBranchNCD,
isPreviouslyNonCompliantDaysNCD,
} from '../../../components/new-code-definition/utils';
-import { isBranch, sortBranches } from '../../../helpers/branch-like';
+import { sortBranches } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { DEFAULT_NEW_CODE_DEFINITION_TYPE } from '../../../helpers/new-code-definition';
+import { isBranch } from '../../../sonar-aligned/helpers/branch-like';
import { Branch, BranchLike, BranchWithNewCodePeriod } from '../../../types/branch-like';
import { NewCodeDefinition } from '../../../types/new-code-definition';
import { Component } from '../../../types/types';
} from '../../../app/components/available-features/withAvailableFeatures';
import withComponentContext from '../../../app/components/componentContext/withComponentContext';
import Suggestions from '../../../components/embed-docs-modal/Suggestions';
-import { isBranch, sortBranches } from '../../../helpers/branch-like';
+import { sortBranches } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import {
DEFAULT_NEW_CODE_DEFINITION_TYPE,
useNewCodeDefinitionMutation,
useNewCodeDefinitionQuery,
} from '../../../queries/newCodeDefinition';
+import { isBranch } from '../../../sonar-aligned/helpers/branch-like';
import { AppState } from '../../../types/appstate';
import { Branch, BranchLike } from '../../../types/branch-like';
import { Feature } from '../../../types/features';
import withIndexationGuard from '../../components/hoc/withIndexationGuard';
import { Location, Router, withRouter } from '../../components/hoc/withRouter';
import { getLeakValue } from '../../components/measure/utils';
-import { getBranchLikeQuery, isPullRequest, isSameBranchLike } from '../../helpers/branch-like';
+import { isPullRequest, isSameBranchLike } from '../../helpers/branch-like';
import { isInput } from '../../helpers/keyboardEventHelpers';
import { KeyboardKeys } from '../../helpers/keycodes';
import { getStandards } from '../../helpers/security-standard';
import { withBranchLikes } from '../../queries/branch';
+import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../types/branch-like';
import { ComponentQualifier } from '../../types/component';
import { MetricKey } from '../../types/metrics';
import { Helmet } from 'react-helmet-async';
import A11ySkipTarget from '../../components/a11y/A11ySkipTarget';
import Suggestions from '../../components/embed-docs-modal/Suggestions';
-import { isBranch } from '../../helpers/branch-like';
import { translate } from '../../helpers/l10n';
import useFollowScroll from '../../hooks/useFollowScroll';
+import { isBranch } from '../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../types/branch-like';
import { ComponentQualifier } from '../../types/component';
import { MetricKey } from '../../types/metrics';
StyledPageTitle,
} from 'design-system';
import React from 'react';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import {
getComponentSecurityHotspotsUrl,
getRuleUrl,
} from '../../../helpers/urls';
import { useRefreshBranchStatus } from '../../../queries/branch';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { SecurityStandard, Standards } from '../../../types/security';
import { Hotspot, HotspotStatusOption } from '../../../types/security-hotspots';
import Tooltip from '../../../components/controls/Tooltip';
import Measure from '../../../components/measure/Measure';
import { PopupPlacement } from '../../../components/ui/popups';
-import { isBranch } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import HelpTooltip from '../../../sonar-aligned/components/controls/HelpTooltip';
+import { isBranch } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { ComponentContextShape } from '../../../types/component';
import { MetricKey, MetricType } from '../../../types/metrics';
import * as React from 'react';
import { getSources } from '../../../api/components';
import { locationsByLine } from '../../../components/SourceViewer/helpers/indexing';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { Hotspot } from '../../../types/security-hotspots';
import { Component, ExpandDirection, FlowLocation, SourceLine } from '../../../types/types';
getSources,
} from '../../api/components';
import { ComponentContext } from '../../app/components/componentContext/ComponentContext';
-import { getBranchLikeQuery, isSameBranchLike } from '../../helpers/branch-like';
+import { isSameBranchLike } from '../../helpers/branch-like';
import { translate } from '../../helpers/l10n';
import { HttpStatus } from '../../helpers/request';
+import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../types/branch-like';
import { ComponentQualifier } from '../../types/component';
import {
} from 'design-system';
import * as React from 'react';
import { useIntl } from 'react-intl';
-import { getBranchLikeQuery } from '../../helpers/branch-like';
import { SOFTWARE_QUALITIES } from '../../helpers/constants';
import {
ISSUETYPE_METRIC_KEYS_MAP,
getComponentIssuesUrl,
getComponentSecurityHotspotsUrl,
} from '../../helpers/urls';
+import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like';
import type { BranchLike } from '../../types/branch-like';
import { ComponentQualifier } from '../../types/component';
import { IssueType } from '../../types/issues';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { listIssues, searchIssues } from '../../../api/issues';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { parseIssueFromResponse } from '../../../helpers/issues';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { Issue, RawQuery } from '../../../types/types';
import { DEFAULT_ISSUES_QUERY } from '../../shared/utils';
import { BareButton, BranchIcon, ChevronDownIcon, Note, StandoutLink } from 'design-system';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { isMainBranch } from '../../helpers/branch-like';
import { translate } from '../../helpers/l10n';
import { getProjectUrl } from '../../helpers/urls';
+import { isMainBranch } from '../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../types/branch-like';
import {
AnalysisEvent,
import * as React from 'react';
import { Route } from 'react-router-dom';
import BranchesServiceMock from '../../../api/mocks/BranchesServiceMock';
-import { isMainBranch } from '../../../helpers/branch-like';
import { mockBranch, mockMainBranch } from '../../../helpers/mocks/branch-like';
import { mockAnalysisEvent } from '../../../helpers/mocks/project-activity';
import { renderAppWithComponentContext } from '../../../helpers/testReactTestingUtils';
import { byRole, byText } from '../../../helpers/testSelector';
+import { isMainBranch } from '../../../sonar-aligned/helpers/branch-like';
import { Branch, BranchLike } from '../../../types/branch-like';
import {
ApplicationAnalysisEventCategory,
import { IconBranch, IconGitBranch, IconProps, IconPullrequest } from '@sonarsource/echoes-react';
import { StyledMutedText } from 'design-system';
import * as React from 'react';
-import { isMainBranch, isPullRequest } from '../../helpers/branch-like';
+import { isPullRequest } from '../../helpers/branch-like';
+import { isMainBranch } from '../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../types/branch-like';
export interface BranchLikeIconProps extends IconProps {
import * as React from 'react';
import { ComponentContext } from '../../../app/components/componentContext/ComponentContext';
import { areMyIssuesSelected, parseQuery, serializeQuery } from '../../../apps/issues/utils';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
import { translate } from '../../../helpers/l10n';
import { getComponentIssuesUrl, getIssuesUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../../types/branch-like';
import { Issue } from '../../../types/types';
import { useLocation } from '../../hoc/withRouter';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { getBranchLikeQuery } from '../../helpers/branch-like';
import { getComponentDrilldownUrl, getComponentIssuesUrl } from '../../helpers/urls';
+import { getBranchLikeQuery } from '../../sonar-aligned/helpers/branch-like';
import { BranchLike } from '../../types/branch-like';
import Link from '../common/Link';
import { isIssueMeasure, propsToIssueParams } from './utils';
} from 'design-system';
import * as React from 'react';
import { AnalysisStatus } from '../../apps/overview/components/AnalysisStatus';
-import { isMainBranch } from '../../helpers/branch-like';
import { translate } from '../../helpers/l10n';
import { getProjectTutorialLocation } from '../../helpers/urls';
import { useBranchesQuery } from '../../queries/branch';
+import { isMainBranch } from '../../sonar-aligned/helpers/branch-like';
import { AlmKeys, AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings';
import { MainBranch } from '../../types/branch-like';
import { Component } from '../../types/types';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { orderBy } from 'lodash';
-import {
- Branch,
- BranchLike,
- BranchLikeTree,
- BranchParameters,
- MainBranch,
- PullRequest,
-} from '../types/branch-like';
-
-export function isBranch(branchLike?: BranchLike): branchLike is Branch {
- return branchLike !== undefined && (branchLike as Branch).isMain !== undefined;
-}
-
-export function isMainBranch(branchLike?: BranchLike): branchLike is MainBranch {
- return isBranch(branchLike) && branchLike.isMain;
-}
+import { isBranch, isMainBranch } 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 getBranchLikeQuery(
- branchLike?: BranchLike,
- includeMainBranch = false,
-): BranchParameters {
- if (isBranch(branchLike) && (includeMainBranch || !isMainBranch(branchLike))) {
- return { branch: branchLike.name };
- } else if (isPullRequest(branchLike)) {
- return { pullRequest: branchLike.key };
- }
- return {};
-}
-
// Create branch object from branch name or pull request key
export function fillBranchLike(
branch?: string,
import { Path, To } from 'react-router-dom';
import { getProfilePath } from '../apps/quality-profiles/utils';
import { DEFAULT_ISSUES_QUERY } from '../components/shared/utils';
+import { getBranchLikeQuery, isBranch, isMainBranch } from '../sonar-aligned/helpers/branch-like';
import { BranchLike, BranchParameters } from '../types/branch-like';
import { ComponentQualifier, isApplication, isPortfolioLike } from '../types/component';
import { MeasurePageView } from '../types/measures';
import { SecurityStandard } from '../types/security';
import { Dict, RawQuery } from '../types/types';
import { HomePage } from '../types/users';
-import { getBranchLikeQuery, isBranch, isMainBranch, isPullRequest } from './branch-like';
+import { isPullRequest } from './branch-like';
import { serializeOptionalBoolean } from './query';
import { getBaseUrl } from './system';
import { getQualityGateProjectStatus } from '../api/quality-gates';
import { AvailableFeaturesContext } from '../app/components/available-features/AvailableFeaturesContext';
import { useLocation } from '../components/hoc/withRouter';
-import { isBranch, isPullRequest } from '../helpers/branch-like';
+import { isPullRequest } from '../helpers/branch-like';
import { extractStatusConditionsFromProjectStatus } from '../helpers/qualityGates';
import { searchParamsToQuery } from '../helpers/urls';
+import { isBranch } from '../sonar-aligned/helpers/branch-like';
import { Branch, BranchLike } from '../types/branch-like';
import { isApplication, isPortfolioLike, isProject } from '../types/component';
import { Feature } from '../types/features';
useComponent,
useTopLevelComponentKey,
} from '../app/components/componentContext/withComponentContext';
-import { getBranchLikeQuery } from '../helpers/branch-like';
import { parseDate } from '../helpers/dates';
import { serializeStringArray } from '../helpers/query';
+import { getBranchLikeQuery } from '../sonar-aligned/helpers/branch-like';
import { BranchParameters } from '../types/branch-like';
import { ParsedAnalysis } from '../types/project-activity';
import { useBranchesQuery } from './branch';
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2024 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { isPullRequest } from '../../helpers/branch-like';
+
+import { Branch, BranchLike, BranchParameters, MainBranch } from '../../types/branch-like';
+
+export function getBranchLikeQuery(
+ branchLike?: BranchLike,
+ includeMainBranch = false,
+): BranchParameters {
+ if (isBranch(branchLike) && (includeMainBranch || !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 isMainBranch(branchLike?: BranchLike): branchLike is MainBranch {
+ return isBranch(branchLike) && branchLike.isMain;
+}