]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22049 Align branch-like helper
authorViktor Vorona <viktor.vorona@sonarsource.com>
Tue, 23 Apr 2024 12:47:22 +0000 (14:47 +0200)
committerMatteo Mara <matteo.mara@sonarsource.com>
Tue, 30 Apr 2024 08:59:03 +0000 (10:59 +0200)
62 files changed:
server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx
server/sonar-web/src/main/js/app/components/nav/component/branch-like/Menu.tsx
server/sonar-web/src/main/js/app/components/nav/component/branch-like/MenuItem.tsx
server/sonar-web/src/main/js/app/components/nav/component/utils.ts
server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx
server/sonar-web/src/main/js/apps/code/components/Search.tsx
server/sonar-web/src/main/js/apps/code/utils.ts
server/sonar-web/src/main/js/apps/component-measures/components/ComponentMeasuresApp.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverviewContainer.tsx
server/sonar-web/src/main/js/apps/component-measures/components/MeasuresBreadcrumbs.tsx
server/sonar-web/src/main/js/apps/component-measures/utils.ts
server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx
server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/IssueSourceViewerHeader.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/DirectoryFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/FileFacet.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/Sidebar.tsx
server/sonar-web/src/main/js/apps/overview/branches/ApplicationNonCaycProjectWarning.tsx
server/sonar-web/src/main/js/apps/overview/branches/BranchOverview.tsx
server/sonar-web/src/main/js/apps/overview/branches/MeasuresPanelNoNewCode.tsx
server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx
server/sonar-web/src/main/js/apps/overview/branches/NoCodeWarning.tsx
server/sonar-web/src/main/js/apps/overview/branches/OverallCodeMeasuresPanel.tsx
server/sonar-web/src/main/js/apps/overview/branches/QualityGateCondition.tsx
server/sonar-web/src/main/js/apps/overview/branches/QualityGateSimplifiedCondition.tsx
server/sonar-web/src/main/js/apps/overview/components/AnalysisErrorMessage.tsx
server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx
server/sonar-web/src/main/js/apps/overview/pullRequests/BranchQualityGateConditions.tsx
server/sonar-web/src/main/js/apps/overview/pullRequests/IssueMeasuresCard.tsx
server/sonar-web/src/main/js/apps/overview/pullRequests/MeasuresCardPanel.tsx
server/sonar-web/src/main/js/apps/overview/pullRequests/PullRequestOverview.tsx
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx
server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx
server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx
server/sonar-web/src/main/js/apps/projectNewCode/components/BranchList.tsx
server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx
server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx
server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSnippetContainer.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewer.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
server/sonar-web/src/main/js/components/SourceViewer/helpers/loadIssues.ts
server/sonar-web/src/main/js/components/activity-graph/DefinitionChangeEventInner.tsx
server/sonar-web/src/main/js/components/activity-graph/__tests__/EventInner-it.tsx
server/sonar-web/src/main/js/components/icon-mappers/BranchLikeIcon.tsx
server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx
server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx
server/sonar-web/src/main/js/helpers/branch-like.ts
server/sonar-web/src/main/js/helpers/urls.ts
server/sonar-web/src/main/js/queries/branch.tsx
server/sonar-web/src/main/js/queries/project-analyses.ts
server/sonar-web/src/main/js/sonar-aligned/helpers/branch-like.ts [new file with mode: 0644]

index a7148dd7c2224404cc6a91e2d6a52e5447c6c8d4..8718aea3a99f90abf6fc6fcb6b7ba2eadabd908b 100644 (file)
@@ -28,10 +28,11 @@ import {
 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,
index 60de85aa38e8c828cc1ee1db6681de65fd66eda2..9748cb935d6eeb21f157dbe6770c8dfdbf89d81b 100644 (file)
@@ -22,13 +22,13 @@ import * as React from 'react';
 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';
index 057a7f41d0883c34c1cfddb353a66a510ba56f38..d3ce663a6e9015e8ecb2c6d7f64b3f3ce68f42c9 100644 (file)
@@ -21,8 +21,9 @@ import classNames from 'classnames';
 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';
 
index abbb2e6acd9925104fb2f1bcc5580ee94248f0c3..730abbc8c4d974deb3827e9dbaff3979d28983c1 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { isBranch } from '../../../../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';
index 5680c74944d5662587234a0f9538fff1d3fefc3f..ddf29edee55d835a6682f2e74e3c35d7c0aff305 100644 (file)
 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,
index 242e8bf0a8043c7d7e5c58160ff06489effc783f..185863504622978454ee22f3013abd2c162d3f9a 100644 (file)
@@ -23,9 +23,9 @@ import { isEmpty, omit } from 'lodash';
 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';
index 207b1f872002aea530f5f5191a166433ed822661..b9518349bb76b07265f5095937677957e53c6650 100644 (file)
@@ -18,8 +18,9 @@
  * 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';
index 91285196104b03aa016ca33548eb59fb0866692c..4df28d0b79464174fece28ad11c2891527a9e50d 100644 (file)
@@ -39,11 +39,12 @@ import { Location, Router, withRouter } from '../../../components/hoc/withRouter
 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';
index 6c31247d8176465180109e2e78bae3558606295b..617f2880c8ea1445e727001e8a3a94a912779756 100644 (file)
@@ -25,7 +25,7 @@ import SourceViewer from '../../../components/SourceViewer/SourceViewer';
 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';
@@ -33,6 +33,7 @@ import { getCCTMeasureValue, isDiffMetric } from '../../../helpers/measures';
 import { RequestData } from '../../../helpers/request';
 import { isDefined } from '../../../helpers/types';
 import { getProjectUrl } from '../../../helpers/urls';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
 import { BranchLike } from '../../../types/branch-like';
 import { isApplication, isFile, isView } from '../../../types/component';
 import { MeasurePageView } from '../../../types/measures';
index ed3c13e329ffa9e3b67314d81433670eb5c32dc7..6d577b2f45838b6afe230e0bb64233c65d846ae2 100644 (file)
@@ -22,7 +22,8 @@ import * as React from 'react';
 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 {
index 66faba26be94372ed3b8d5e8210a3f435b7cb665..91bbc9ac8bc3f8d9050ae458589d101ed43e130c 100644 (file)
@@ -20,8 +20,9 @@
 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 {
index 41a91b139a0cfb6a3a303bb7463884f07383a034..9a6797956b5424f4b820dc650acd1f33c59564fb 100644 (file)
@@ -21,10 +21,11 @@ import classNames from 'classnames';
 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';
index 558ad1bf8fae3202b16522435fea8f52c79ceeab..6e0211e3177e2e5f4ffbe00a70426689908aaa22 100644 (file)
@@ -19,7 +19,7 @@
  */
 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,
@@ -42,6 +42,7 @@ import {
   parseAsString,
   serializeString,
 } from '../../helpers/query';
+import { isBranch } from '../../sonar-aligned/helpers/branch-like';
 import { BranchLike } from '../../types/branch-like';
 import { ComponentQualifier } from '../../types/component';
 import { Domain, MeasurePageView } from '../../types/measures';
index 2ddcaf5f43683ec50208a3aa559a24833da652bb..28840443a6786954b9fe704556423c7aacd63dc3 100644 (file)
@@ -32,12 +32,12 @@ import { setIssueAssignee } from '../../../api/issues';
 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';
index 0f8307aa4a8168c34c53c722205db827e32a1664..e3e33e2c65477ecef4c91635fbe658c7fe515e27 100644 (file)
@@ -52,12 +52,7 @@ import { Location, Router, withRouter } from '../../../components/hoc/withRouter
 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';
@@ -65,6 +60,7 @@ import { KeyboardKeys } from '../../../helpers/keycodes';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { serializeDate } from '../../../helpers/query';
 import { withBranchLikes } from '../../../queries/branch';
+import { getBranchLikeQuery } from '../../../sonar-aligned/helpers/branch-like';
 import { BranchLike } from '../../../types/branch-like';
 import { ComponentQualifier, isPortfolioLike, isProject } from '../../../types/component';
 import {
index be83012b5776a55dc9242066883d64dcd4f080e7..a51ee3debece10d82da8d551e2a4ae8f3f39d068 100644 (file)
@@ -25,8 +25,8 @@ import { FormattedMessage } from 'react-intl';
 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';
index 3e44f7a4be517aa8c427c1c7aa134f993b9dbe99..f212424c609c79a0e4d328d9e1fffbb6c2222cc6 100644 (file)
@@ -36,9 +36,9 @@ import {
   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';
index 9b2b3c398bb8675e82669911cbd41e0b74f16908..04e71337c9219fdb31c0843178010f4c295e745c 100644 (file)
@@ -35,11 +35,12 @@ import * as React from 'react';
 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';
index bd03d07840d0427419619378051a12b056e89fd0..354f678b77d892a67c70009791b48a707acf84ea 100644 (file)
@@ -21,10 +21,10 @@ import { QualifierIcon } from 'design-system';
 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';
index 001e049cf717e0ec0cecb229c95a443917b0d1e4..e6dd87f1e23d2e01dcda7dff41c862c2b13531ff 100644 (file)
@@ -21,11 +21,11 @@ import { QualifierIcon } from 'design-system';
 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';
index fc6ee8e722e1d11694376ee27819a6e775d76102..4cc16fa5f836e1eaf11d3d1b9e39095ba926aa9d 100644 (file)
@@ -21,8 +21,9 @@ import { BasicSeparator, FlagMessage, Link } from 'design-system';
 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 {
index 274bb6e8e7580b0a93d0c4f53588afa5507b0bc0..9f305cb70dd0e81ebd373e342c477afce5abd5cc 100644 (file)
  */
 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 {
index 89f06d9c6ec9491cec4e3e5d2267bf42767441e0..587891faa43523abe22c888d51e4769bd76acbfb 100644 (file)
@@ -34,11 +34,7 @@ import {
   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 {
@@ -46,6 +42,7 @@ 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';
index 104eaf2ec423a79b351c9c4d840fb0669ea3fcdf..3bda1c1733787ec65ce937e81ed54b0a205f5030 100644 (file)
@@ -24,9 +24,9 @@ import * as React from 'react';
 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';
index 05385c6a66a3b98a3b0cbc5a470139aef0be38ed..94aae3bb9870edfc223c3c93e8110eebbb61fe5b 100644 (file)
@@ -34,13 +34,13 @@ import React from 'react';
 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';
index 350209b69345507cefe0f152741d0b04b0ac4116..87b684ac607f25fceb0af1ef735ced0997cc633d 100644 (file)
@@ -19,8 +19,9 @@
  */
 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';
index b0f131aac71cff2a84d293d5c34d382b4dae8bd3..a594bfbf0edd00b51a9880a30e1a7f3d615ce6c4 100644 (file)
@@ -26,13 +26,13 @@ import {
 } 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';
index a3dd605d7907b292e33f680179dad5021799557d..d07769a9c80db7c2b73e982d278cad2f495ebbac 100644 (file)
@@ -27,7 +27,6 @@ import {
   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';
@@ -36,6 +35,7 @@ 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 { MetricKey, MetricType } from '../../../types/metrics';
index d4172a7110aa0ee37cea14b8920ee60f2d291e06..4c1b3e9ba6d892024d7d1099bfc678726809ab74 100644 (file)
 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';
index 8a42b1d2c9749467cf765adb16547fbb70c2bdbd..6f843b731b6b11b07d91b613d6e66824ce3f8058 100644 (file)
@@ -21,10 +21,11 @@ import { Link } from 'design-system';
 import React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { useLocation } from 'react-router-dom';
-import { isBranch, isMainBranch, 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';
index 9c50ad01db4c8715116ce52798c255278122f1c7..585df52db9f8b8b4e768177dae1228cc7df7c315 100644 (file)
@@ -23,11 +23,12 @@ import * as React from 'react';
 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';
index d3bfaa0bdad7ca72d2946e5fbe8af49912b8265b..9fe6fc70bb2735b19c46f699df7e5855cc1ea678 100644 (file)
@@ -26,7 +26,6 @@ import {
   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 {
@@ -34,6 +33,7 @@ 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';
index 0bca878392c1ebf9d4921a82d90e9b9d181b5315..aaed573861a641f4b03bd884c2a7e4c75ba1236e 100644 (file)
@@ -35,9 +35,9 @@ import * as React from 'react';
 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';
index b67e517ca9506c530616e3fb67be95cc4235450b..ec42bcb0ce0c48a767a049c913cec6c9b8dc179b 100644 (file)
@@ -20,9 +20,9 @@
 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';
index 476221616e71de6820926b6b15505e3fc994b198..f773f5abc5d4cb2fb41e8dbf19b8e0041a95fd7a 100644 (file)
 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';
index b0460c1475f96ecbf705e80f68be3cf2b29c0ea1..1a8801c8c998688a345fd0cd2782e37cb0ccf766 100644 (file)
@@ -30,12 +30,12 @@ import {
   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';
index a4c5369ae30637144d151d03e6416e0f4a077e36..bdf0ab3bce74327f9e3b8b9c523db509b435b3c7 100644 (file)
@@ -30,13 +30,9 @@ import * as React from 'react';
 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';
index f7bd9e280615785abb5197cbc7c6d76dd38e13c0..c3f68f998e1ee597e87390512f61156ccbb0be86 100644 (file)
@@ -22,15 +22,10 @@ import { IconGitBranch, IconPullrequest } from '@sonarsource/echoes-react';
 import { ToggleButton, getTabId, getTabPanelId } from 'design-system';
 import * as React from 'react';
 import { useState } from 'react';
-import {
-  isBranch,
-  isMainBranch,
-  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';
index ee171be74f5b2fbf604021232fb6919ea54503d1..b278726540077932aea33385ad302def20789404 100644 (file)
 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';
 
index d3ae393055612a42888d4595f9674cd84ac6023a..bc0b86a8e3d7f0fdc3ff099508a03f7c97ff65a7 100644 (file)
@@ -34,7 +34,6 @@ import { isEmpty } from 'lodash';
 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 {
@@ -43,6 +42,7 @@ 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';
index 285e4231f5d7ae8b48b7788553b3e4452a14aa36..63a35ddea271ea97c2d6ec00fe81e965506d865a 100644 (file)
@@ -32,13 +32,10 @@ import { FormattedMessage } from 'react-intl';
 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';
 
index a029b2efc7f0d8b050f440221ec06c5f77c47e04..e47aead27ed4d3a7166545b73205a4ecae51daec 100644 (file)
@@ -28,9 +28,10 @@ import {
   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';
index 7f5dbca55af8df67076f35dff935420b6b8384f3..21acdf82d5fce2f9ec36bd8dbfdd08d58e540d61 100644 (file)
@@ -27,7 +27,7 @@ import withAvailableFeatures, {
 } 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,
@@ -38,6 +38,7 @@ import {
   useNewCodeDefinitionMutation,
   useNewCodeDefinitionQuery,
 } from '../../../queries/newCodeDefinition';
+import { isBranch } from '../../../sonar-aligned/helpers/branch-like';
 import { AppState } from '../../../types/appstate';
 import { Branch, BranchLike } from '../../../types/branch-like';
 import { Feature } from '../../../types/features';
index 372d72938334081ae4a02a165c57a2c6b873e3e8..c2c23eac0af67c6a6cad802e608bdb3b59ee4169 100644 (file)
@@ -27,11 +27,12 @@ import withCurrentUserContext from '../../app/components/current-user/withCurren
 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';
index fc30449e0355c720b25bc62199e9d5394debdf61..8bafc990a3d0fa7639439ccf495c66f7bce92ca7 100644 (file)
@@ -33,9 +33,9 @@ import * as React from 'react';
 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';
index 2ae71cfa95a68629a71244af2b5e8e1b9faa6916..727ab6a29320705c0154b46079f4ce2bdfba0ca1 100644 (file)
@@ -27,7 +27,6 @@ import {
   StyledPageTitle,
 } from 'design-system';
 import React from 'react';
-import { getBranchLikeQuery } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import {
   getComponentSecurityHotspotsUrl,
@@ -35,6 +34,7 @@ import {
   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';
index 49b4badb0c24be652c996a39af51d6dd93bc1d93..390490e2303ce2c91456f104b978a7e13bc3b57c 100644 (file)
@@ -36,9 +36,9 @@ import withCurrentUserContext from '../../../app/components/current-user/withCur
 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';
index 7bb2567c02e6e0dc7f62a4d696a0977b946d5ccd..92cbd6123a3c7df731846c0906f229ca150c2d9a 100644 (file)
@@ -20,7 +20,7 @@
 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';
index d37748db9a61f5754a7d4b09c904d1ca0145684d..07ba7e6bfb0921bbe16499dfc12fca4dc66969be 100644 (file)
@@ -28,9 +28,10 @@ import {
   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 {
index 2967f417707a023dce3025d0a3f32c436b66b43e..fbe658763a64295ad0d631350586e81541a6fbb4 100644 (file)
@@ -38,7 +38,6 @@ 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,
@@ -59,6 +58,7 @@ import {
   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';
index 79bb718804c6ecc3034f703ad02b15e5af80f534..7627c87f14eb041ac5572c75ff808e72dcdc1ee0 100644 (file)
@@ -18,8 +18,8 @@
  * 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';
index 693f4dd0f0c579c3d7b9083d7f1233684d5493fa..49b18217e1c9262dd5b9b818ce8be767926b72d7 100644 (file)
@@ -20,9 +20,9 @@
 import { BareButton, BranchIcon, ChevronDownIcon, Note, StandoutLink } from 'design-system';
 import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
-import { isMainBranch } from '../../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,
index 100cc2ab9b7e85c89faccfcc8733848f305fb9af..4b6d3a001760b93da05ce8bbf910808370b140dc 100644 (file)
@@ -22,11 +22,11 @@ import userEvent from '@testing-library/user-event';
 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,
index 118109911fe340739aa32b5a716507e851f5b1f4..93b7c81f35516313a43f6dd8a2571d0eb198eac3 100644 (file)
@@ -21,7 +21,8 @@
 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 {
index 82ccf81eb2714e78de1479301689b46abe6f8874..9eb6ade7f66d541049a6adbe0d5ba2149b1f8e94 100644 (file)
@@ -21,9 +21,9 @@ import { IssueMessageHighlighting, StandoutLink } from 'design-system';
 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';
index d0a2c56a9580e5c79bc36254905169eac87f8494..53f39eaf9aac65b0a76297278f66e16310c7ab2c 100644 (file)
@@ -18,8 +18,8 @@
  * 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';
index 842584e7d6123cef4074a44d1d02d3fd4a290837..9d6cb91d871f60b89076557622f7ef1915a5b97e 100644 (file)
@@ -30,10 +30,10 @@ import {
 } 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';
index afa621317ca5194a5c9b87283a159e4903dbef11..2e4474e19cad7554a51419ef2d8f46dd675f2d40 100644 (file)
  * 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']);
@@ -113,18 +99,6 @@ export function getBrancheLikesAsTree(branchLikes: BranchLike[]): BranchLikeTree
   }
 }
 
-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,
index 2899b7999dd793f62c0b727f2270f6719a7477e7..d48bf47f45e974ee88acc1018ebf65b4e4bc7637 100644 (file)
@@ -21,6 +21,7 @@ import { isArray, mapValues, omitBy, pick } from 'lodash';
 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';
@@ -28,7 +29,7 @@ import { GraphType } from '../types/project-activity';
 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';
 
index 07ebdebf4261b0649be2ad7869b67532b511de0b..68cef8ddef5f9c13f4535e578255a44f62dc31ce 100644 (file)
@@ -35,9 +35,10 @@ import { dismissAnalysisWarning, getAnalysisStatus } from '../api/ce';
 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';
index 7365b156ea1b23e3f0af661e957cca99f0cb448e..1dadbe71e905700007f4f74dac734b47abfdec55 100644 (file)
@@ -32,9 +32,9 @@ import {
   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';
diff --git a/server/sonar-web/src/main/js/sonar-aligned/helpers/branch-like.ts b/server/sonar-web/src/main/js/sonar-aligned/helpers/branch-like.ts
new file mode 100644 (file)
index 0000000..c8fed5f
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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;
+}