diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2019-11-27 22:16:40 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-12-09 20:46:17 +0100 |
commit | 064e1d872f584f4568a12fa0f31e6a4f975a7437 (patch) | |
tree | 2dba1212e3aff2309b4d016c75ae5d9809bf423c /server/sonar-web/src/main/js/apps/overview/pullRequests | |
parent | 7197bceddc7c51d51cd46e22b68cdc71d277aa65 (diff) | |
download | sonarqube-064e1d872f584f4568a12fa0f31e6a4f975a7437.tar.gz sonarqube-064e1d872f584f4568a12fa0f31e6a4f975a7437.zip |
SONAR-12679 Drop short & long living branch concept
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview/pullRequests')
9 files changed, 24 insertions, 28 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueLabel.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueLabel.tsx index b7fa8f83677..e1f384ff9df 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueLabel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueLabel.tsx @@ -23,13 +23,14 @@ import { Link } from 'react-router'; import { formatMeasure } from 'sonar-ui-common/helpers/measures'; import DocTooltip from '../../../components/docs/DocTooltip'; import { getLeakValue } from '../../../components/measure/utils'; -import { getBranchLikeQuery } from '../../../helpers/branches'; +import { getBranchLikeQuery } from '../../../helpers/branch-like'; import { findMeasure } from '../../../helpers/measures'; import { getComponentIssuesUrl } from '../../../helpers/urls'; +import { BranchLike } from '../../../types/branch-like'; import { getMetricName, IssueType, ISSUETYPE_MAP } from '../utils'; export interface Props { - branchLike?: T.ShortLivingBranch | T.PullRequest; + branchLike?: BranchLike; className?: string; component: T.Component; docTooltip?: Promise<{ default: string }>; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueRating.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueRating.tsx index 508fd803f8e..78d18978e96 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueRating.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/IssueRating.tsx @@ -23,10 +23,11 @@ import Rating from 'sonar-ui-common/components/ui/Rating'; import { getLeakValue, getRatingTooltip } from '../../../components/measure/utils'; import DrilldownLink from '../../../components/shared/DrilldownLink'; import { findMeasure } from '../../../helpers/measures'; +import { BranchLike } from '../../../types/branch-like'; import { getRatingName, IssueType, ISSUETYPE_MAP } from '../utils'; interface Props { - branchLike?: T.ShortLivingBranch | T.PullRequest; + branchLike?: BranchLike; component: T.Component; measures: T.Measure[]; type: IssueType; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasurementLabel.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasurementLabel.tsx index 45a6e7698fd..70d4670aafe 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasurementLabel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/MeasurementLabel.tsx @@ -25,10 +25,11 @@ import { formatMeasure } from 'sonar-ui-common/helpers/measures'; import { getLeakValue } from '../../../components/measure/utils'; import DrilldownLink from '../../../components/shared/DrilldownLink'; import { findMeasure } from '../../../helpers/measures'; +import { BranchLike } from '../../../types/branch-like'; import { MEASUREMENTS_MAP, MeasurementType } from '../utils'; interface Props { - branchLike?: T.BranchLike; + branchLike?: BranchLike; className?: string; component: T.Component; measures: T.Measure[]; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/ReviewApp.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/ReviewApp.tsx index db6a3680f9b..c84f09aa15e 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/ReviewApp.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/ReviewApp.tsx @@ -25,9 +25,10 @@ import { Alert } from 'sonar-ui-common/components/ui/Alert'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getMeasures } from '../../../api/measures'; import DocTooltip from '../../../components/docs/DocTooltip'; -import { getBranchLikeQuery } from '../../../helpers/branches'; +import { getBranchLikeQuery } from '../../../helpers/branch-like'; import { fetchBranchStatus } from '../../../store/rootActions'; import { getBranchStatusByBranchLike, Store } from '../../../store/rootReducer'; +import { BranchLike } from '../../../types/branch-like'; import QualityGateConditions from '../qualityGate/QualityGateConditions'; import '../styles.css'; import { IssueType, MeasurementType, PR_METRICS } from '../utils'; @@ -38,7 +39,7 @@ import LargeQualityGateBadge from './LargeQualityGateBadge'; import MeasurementLabel from './MeasurementLabel'; interface OwnProps { - branchLike: T.PullRequest | T.ShortLivingBranch; + branchLike: BranchLike; component: T.Component; } @@ -49,7 +50,7 @@ interface StateProps { } interface DispatchProps { - fetchBranchStatus: (branchLike: T.BranchLike, projectKey: string) => Promise<void>; + fetchBranchStatus: (branchLike: BranchLike, projectKey: string) => Promise<void>; } type Props = OwnProps & StateProps & DispatchProps; diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/IssueLabel-test.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/IssueLabel-test.tsx index eda38e87bdc..96f2757a37d 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/IssueLabel-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/IssueLabel-test.tsx @@ -19,7 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { mockComponent, mockMeasure, mockPullRequest } from '../../../../helpers/testMocks'; +import { mockPullRequest } from '../../../../helpers/mocks/branch-like'; +import { mockComponent, mockMeasure } from '../../../../helpers/testMocks'; import IssueLabel, { Props } from '../IssueLabel'; it('should render correctly for bugs', () => { diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/IssueRating-test.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/IssueRating-test.tsx index 0c35519a79b..794269988dd 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/IssueRating-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/IssueRating-test.tsx @@ -19,7 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { mockComponent, mockMeasure, mockPullRequest } from '../../../../helpers/testMocks'; +import { mockPullRequest } from '../../../../helpers/mocks/branch-like'; +import { mockComponent, mockMeasure } from '../../../../helpers/testMocks'; import IssueRating from '../IssueRating'; it('should render correctly for bugs', () => { diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/MeasurementLabel-test.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/MeasurementLabel-test.tsx index 6e251163662..20d241b1a68 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/MeasurementLabel-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/MeasurementLabel-test.tsx @@ -19,7 +19,8 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { mockComponent, mockMeasure, mockShortLivingBranch } from '../../../../helpers/testMocks'; +import { mockBranch } from '../../../../helpers/mocks/branch-like'; +import { mockComponent, mockMeasure } from '../../../../helpers/testMocks'; import MeasurementLabel from '../MeasurementLabel'; it('should render correctly for coverage', () => { @@ -50,7 +51,7 @@ it('should render correctly with no value', () => { function shallowRender(props: Partial<MeasurementLabel['props']> = {}) { return shallow( <MeasurementLabel - branchLike={mockShortLivingBranch()} + branchLike={mockBranch()} component={mockComponent()} measures={[mockMeasure({ metric: 'new_coverage' })]} type="COVERAGE" diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/ReviewApp-test.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/ReviewApp-test.tsx index a2c81894995..62ffcd9b64a 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/ReviewApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/ReviewApp-test.tsx @@ -21,11 +21,8 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils'; import { getMeasures } from '../../../../api/measures'; -import { - mockComponent, - mockPullRequest, - mockQualityGateStatusCondition -} from '../../../../helpers/testMocks'; +import { mockPullRequest } from '../../../../helpers/mocks/branch-like'; +import { mockComponent, mockQualityGateStatusCondition } from '../../../../helpers/testMocks'; import { ReviewApp } from '../ReviewApp'; jest.mock('../../../../api/measures', () => { diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/__snapshots__/MeasurementLabel-test.tsx.snap b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/__snapshots__/MeasurementLabel-test.tsx.snap index c43c7b55818..6c1396c176d 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/__snapshots__/MeasurementLabel-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/__snapshots__/MeasurementLabel-test.tsx.snap @@ -16,9 +16,7 @@ exports[`should render correctly for coverage 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "master", - "name": "feature/foo", - "type": "SHORT", + "name": "branch-6.7", } } component="my-project" @@ -50,9 +48,7 @@ exports[`should render correctly for coverage 2`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "master", - "name": "feature/foo", - "type": "SHORT", + "name": "branch-6.7", } } component="my-project" @@ -74,9 +70,7 @@ exports[`should render correctly for coverage 2`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "master", - "name": "feature/foo", - "type": "SHORT", + "name": "branch-6.7", } } component="my-project" @@ -107,9 +101,7 @@ exports[`should render correctly for duplications 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "master", - "name": "feature/foo", - "type": "SHORT", + "name": "branch-6.7", } } component="my-project" |