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/projectBranches | |
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/projectBranches')
18 files changed, 83 insertions, 217 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx index 770f58d818a..768916e34b4 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx @@ -19,11 +19,12 @@ */ import * as React from 'react'; import { translate } from 'sonar-ui-common/helpers/l10n'; +import { BranchLike } from '../../../types/branch-like'; import BranchLikeTabs from './BranchLikeTabs'; import LifetimeInformation from './LifetimeInformation'; export interface AppProps { - branchLikes: T.BranchLike[]; + branchLikes: BranchLike[]; component: T.Component; onBranchesChange: () => void; } diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx index 071cda5c964..c1b90f73115 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeRow.tsx @@ -31,11 +31,12 @@ import { isBranch, isMainBranch, isPullRequest -} from '../../../helpers/branches'; +} from '../../../helpers/branch-like'; +import { BranchLike } from '../../../types/branch-like'; import BranchPurgeSetting from './BranchPurgeSetting'; export interface BranchLikeRowProps { - branchLike: T.BranchLike; + branchLike: BranchLike; component: T.Component; displayPurgeSetting?: boolean; onDelete: () => void; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx index d4b90ed5fdb..9d1bb43cd33 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTable.tsx @@ -21,15 +21,16 @@ import * as React from 'react'; import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip'; import { translate } from 'sonar-ui-common/helpers/l10n'; -import { getBranchLikeKey } from '../../../helpers/branches'; +import { getBranchLikeKey } from '../../../helpers/branch-like'; +import { BranchLike } from '../../../types/branch-like'; import BranchLikeRow from './BranchLikeRow'; export interface BranchLikeTableProps { - branchLikes: T.BranchLike[]; + branchLikes: BranchLike[]; component: T.Component; displayPurgeSetting?: boolean; - onDelete: (branchLike: T.BranchLike) => void; - onRename: (branchLike: T.BranchLike) => void; + onDelete: (branchLike: BranchLike) => void; + onRename: (branchLike: BranchLike) => void; title: string; } diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx index 6e05bcbfcad..785cf78b58b 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchLikeTabs.tsx @@ -20,8 +20,8 @@ import * as React from 'react'; import BoxedTabs from 'sonar-ui-common/components/controls/BoxedTabs'; +import BranchIcon from 'sonar-ui-common/components/icons/BranchIcon'; import PullRequestIcon from 'sonar-ui-common/components/icons/PullRequestIcon'; -import ShortLivingBranchIcon from 'sonar-ui-common/components/icons/ShortLivingBranchIcon'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { isBranch, @@ -29,21 +29,22 @@ import { isPullRequest, sortBranches, sortPullRequests -} from '../../../helpers/branches'; +} from '../../../helpers/branch-like'; +import { BranchLike } from '../../../types/branch-like'; import BranchLikeTable from './BranchLikeTable'; import DeleteBranchModal from './DeleteBranchModal'; import RenameBranchModal from './RenameBranchModal'; interface Props { - branchLikes: T.BranchLike[]; + branchLikes: BranchLike[]; component: T.Component; onBranchesChange: () => void; } interface State { currentTab: Tabs; - deleting?: T.BranchLike; - renaming?: T.BranchLike; + deleting?: BranchLike; + renaming?: BranchLike; } export enum Tabs { @@ -56,7 +57,7 @@ const TABS = [ key: Tabs.Branch, label: ( <> - <ShortLivingBranchIcon /> + <BranchIcon /> <span className="spacer-left"> {translate('project_branch_pull_request.tabs.branches')} </span> @@ -83,9 +84,9 @@ export default class BranchLikeTabs extends React.PureComponent<Props, State> { this.setState({ currentTab }); }; - onDeleteBranchLike = (branchLike: T.BranchLike) => this.setState({ deleting: branchLike }); + onDeleteBranchLike = (branchLike: BranchLike) => this.setState({ deleting: branchLike }); - onRenameBranchLike = (branchLike: T.BranchLike) => this.setState({ renaming: branchLike }); + onRenameBranchLike = (branchLike: BranchLike) => this.setState({ renaming: branchLike }); onClose = () => this.setState({ deleting: undefined, renaming: undefined }); @@ -99,7 +100,7 @@ export default class BranchLikeTabs extends React.PureComponent<Props, State> { const { currentTab, deleting, renaming } = this.state; const isBranchMode = currentTab === Tabs.Branch; - const branchLikesToDisplay: T.BranchLike[] = isBranchMode + const branchLikesToDisplay: BranchLike[] = isBranchMode ? sortBranches(branchLikes.filter(isBranch)) : sortPullRequests(branchLikes.filter(isPullRequest)); const title = translate( diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx index dfe91f278ce..896521f600b 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/BranchPurgeSetting.tsx @@ -24,10 +24,11 @@ import Toggle from 'sonar-ui-common/components/controls/Toggle'; import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { excludeBranchFromPurge } from '../../../api/branches'; -import { isMainBranch } from '../../../helpers/branches'; +import { isMainBranch } from '../../../helpers/branch-like'; +import { Branch } from '../../../types/branch-like'; interface Props { - branch: T.Branch; + branch: Branch; component: T.Component; } diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx index a89bc85e157..b051fc67cc9 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx @@ -22,10 +22,11 @@ import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/contro import Modal from 'sonar-ui-common/components/controls/Modal'; import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n'; import { deleteBranch, deletePullRequest } from '../../../api/branches'; -import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branches'; +import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branch-like'; +import { BranchLike } from '../../../types/branch-like'; interface Props { - branchLike: T.BranchLike; + branchLike: BranchLike; component: T.Component; onClose: () => void; onDelete: () => void; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx index 6ec14c34324..125061368b4 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx @@ -22,9 +22,10 @@ import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/contro import Modal from 'sonar-ui-common/components/controls/Modal'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { renameBranch } from '../../../api/branches'; +import { MainBranch } from '../../../types/branch-like'; interface Props { - branch: T.MainBranch; + branch: MainBranch; component: T.Component; onClose: () => void; onRename: () => void; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx index 27e23b77806..7f25329c492 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; -import { mockSetOfBranchAndPullRequest } from '../../../../helpers/mocks/branch-pull-request'; +import { mockSetOfBranchAndPullRequest } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/testMocks'; import { App, AppProps } from '../App'; import BranchLikeTabs from '../BranchLikeTabs'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeRow-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeRow-test.tsx index 0c162b9d435..80b8658ea39 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeRow-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeRow-test.tsx @@ -20,13 +20,8 @@ import { shallow } from 'enzyme'; import * as React from 'react'; -import { - mockComponent, - mockLongLivingBranch, - mockMainBranch, - mockPullRequest, - mockShortLivingBranch -} from '../../../../helpers/testMocks'; +import { mockBranch, mockMainBranch, mockPullRequest } from '../../../../helpers/mocks/branch-like'; +import { mockComponent } from '../../../../helpers/testMocks'; import { BranchLikeRow, BranchLikeRowProps } from '../BranchLikeRow'; it('should render correctly for pull request', () => { @@ -34,13 +29,8 @@ it('should render correctly for pull request', () => { expect(wrapper).toMatchSnapshot(); }); -it('should render correctly for short lived branch', () => { - const wrapper = shallowRender({ branchLike: mockShortLivingBranch(), displayPurgeSetting: true }); - expect(wrapper).toMatchSnapshot(); -}); - -it('should render correctly for long lived branch', () => { - const wrapper = shallowRender({ branchLike: mockLongLivingBranch(), displayPurgeSetting: true }); +it('should render correctly for branch', () => { + const wrapper = shallowRender({ branchLike: mockBranch(), displayPurgeSetting: true }); expect(wrapper).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTable-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTable-test.tsx index 834c09db53e..acfc64cb99d 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTable-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTable-test.tsx @@ -20,7 +20,7 @@ import { shallow } from 'enzyme'; import * as React from 'react'; -import { mockSetOfBranchAndPullRequest } from '../../../../helpers/mocks/branch-pull-request'; +import { mockSetOfBranchAndPullRequest } from '../../../../helpers/mocks/branch-like'; import { mockComponent } from '../../../../helpers/testMocks'; import { BranchLikeRow } from '../BranchLikeRow'; import { BranchLikeTable, BranchLikeTableProps } from '../BranchLikeTable'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx index 1fcf0a8ddbf..805017d88d0 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx @@ -21,8 +21,12 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import BoxedTabs from 'sonar-ui-common/components/controls/BoxedTabs'; -import { mockSetOfBranchAndPullRequest } from '../../../../helpers/mocks/branch-pull-request'; -import { mockComponent, mockMainBranch, mockPullRequest } from '../../../../helpers/testMocks'; +import { + mockMainBranch, + mockPullRequest, + mockSetOfBranchAndPullRequest +} from '../../../../helpers/mocks/branch-like'; +import { mockComponent } from '../../../../helpers/testMocks'; import { BranchLikeTable } from '../BranchLikeTable'; import BranchLikeTabs, { Tabs } from '../BranchLikeTabs'; import DeleteBranchModal from '../DeleteBranchModal'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchPurgeSetting-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchPurgeSetting-test.tsx index bdac2023af4..882219f4275 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchPurgeSetting-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchPurgeSetting-test.tsx @@ -22,7 +22,8 @@ import { shallow } from 'enzyme'; import * as React from 'react'; import Toggle from 'sonar-ui-common/components/controls/Toggle'; import { excludeBranchFromPurge } from '../../../../api/branches'; -import { mockComponent, mockLongLivingBranch, mockMainBranch } from '../../../../helpers/testMocks'; +import { mockBranch, mockMainBranch } from '../../../../helpers/mocks/branch-like'; +import { mockComponent } from '../../../../helpers/testMocks'; import BranchPurgeSetting from '../BranchPurgeSetting'; jest.mock('../../../../api/branches', () => ({ @@ -61,7 +62,7 @@ it('should correctly call the webservice if the user changes the value', () => { function shallowRender(props?: Partial<BranchPurgeSetting['props']>) { return shallow<BranchPurgeSetting>( <BranchPurgeSetting - branch={mockLongLivingBranch({ excludedFromPurge: true })} + branch={mockBranch({ excludedFromPurge: true })} component={mockComponent()} {...props} /> diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/DeleteBranchModal-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/DeleteBranchModal-test.tsx index 198ed29d27e..9d297362864 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/DeleteBranchModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/DeleteBranchModal-test.tsx @@ -22,11 +22,9 @@ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; import { click, doAsync, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils'; import { deleteBranch, deletePullRequest } from '../../../../api/branches'; -import { - mockComponent, - mockPullRequest, - mockShortLivingBranch -} from '../../../../helpers/testMocks'; +import { mockBranch, mockPullRequest } from '../../../../helpers/mocks/branch-like'; +import { mockComponent } from '../../../../helpers/testMocks'; +import { BranchLike } from '../../../../types/branch-like'; import DeleteBranchModal from '../DeleteBranchModal'; jest.mock('../../../../api/branches', () => ({ @@ -34,7 +32,7 @@ jest.mock('../../../../api/branches', () => ({ deletePullRequest: jest.fn() })); -const branch = mockShortLivingBranch(); +const branch = mockBranch({ name: 'feature/foo' }); beforeEach(() => { jest.clearAllMocks(); @@ -99,7 +97,7 @@ it('stops loading on WS error', async () => { }); function shallowRender( - branchLike: T.BranchLike, + branchLike: BranchLike, onDelete: () => void = jest.fn(), onClose: () => void = jest.fn() ) { diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/RenameBranchModal-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/RenameBranchModal-test.tsx index 050ec427bb7..f78f10804cf 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/RenameBranchModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/RenameBranchModal-test.tsx @@ -22,7 +22,8 @@ import { shallow, ShallowWrapper } from 'enzyme'; import * as React from 'react'; import { change, click, doAsync, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils'; import { renameBranch } from '../../../../api/branches'; -import { mockComponent, mockMainBranch } from '../../../../helpers/testMocks'; +import { mockMainBranch } from '../../../../helpers/mocks/branch-like'; +import { mockComponent } from '../../../../helpers/testMocks'; import RenameBranchModal from '../RenameBranchModal'; jest.mock('../../../../api/branches', () => ({ renameBranch: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/App-test.tsx.snap index f0cf79259bf..0e39878623b 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/App-test.tsx.snap @@ -19,16 +19,13 @@ exports[`should render correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "master", - "name": "slb-1", - "type": "SHORT", + "name": "branch-11", }, Object { "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-1", - "type": "LONG", + "name": "branch-1", }, Object { "analysisDate": "2018-01-01", @@ -48,9 +45,7 @@ exports[`should render correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "llb-1", - "name": "slb-2", - "type": "SHORT", + "name": "branch-12", }, Object { "analysisDate": "2018-01-01", @@ -64,15 +59,13 @@ exports[`should render correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-3", - "type": "LONG", + "name": "branch-3", }, Object { "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-2", - "type": "LONG", + "name": "branch-2", }, Object { "analysisDate": "2018-01-01", diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeRow-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeRow-test.tsx.snap index aa1b8391809..7406b9a94fa 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeRow-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeRow-test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should render correctly for long lived branch 1`] = ` +exports[`should render correctly for branch 1`] = ` <tr> <td className="nowrap hide-overflow" @@ -12,7 +12,6 @@ exports[`should render correctly for long lived branch 1`] = ` "excludedFromPurge": true, "isMain": false, "name": "branch-6.7", - "type": "LONG", } } className="little-spacer-right" @@ -34,7 +33,6 @@ exports[`should render correctly for long lived branch 1`] = ` "excludedFromPurge": true, "isMain": false, "name": "branch-6.7", - "type": "LONG", } } component="my-project" @@ -57,7 +55,6 @@ exports[`should render correctly for long lived branch 1`] = ` "excludedFromPurge": true, "isMain": false, "name": "branch-6.7", - "type": "LONG", } } component={ @@ -268,107 +265,3 @@ exports[`should render correctly for pull request 1`] = ` </td> </tr> `; - -exports[`should render correctly for short lived branch 1`] = ` -<tr> - <td - className="nowrap hide-overflow" - > - <BranchLikeIcon - branchLike={ - Object { - "analysisDate": "2018-01-01", - "excludedFromPurge": true, - "isMain": false, - "mergeBranch": "master", - "name": "feature/foo", - "type": "SHORT", - } - } - className="little-spacer-right" - /> - <span - title="feature/foo" - > - feature/foo - </span> - <span /> - </td> - <td - className="nowrap" - > - <Connect(BranchStatus) - branchLike={ - Object { - "analysisDate": "2018-01-01", - "excludedFromPurge": true, - "isMain": false, - "mergeBranch": "master", - "name": "feature/foo", - "type": "SHORT", - } - } - component="my-project" - /> - </td> - <td - className="nowrap" - > - <DateFromNow - date="2018-01-01" - /> - </td> - <td - className="nowrap" - > - <BranchPurgeSetting - branch={ - Object { - "analysisDate": "2018-01-01", - "excludedFromPurge": true, - "isMain": false, - "mergeBranch": "master", - "name": "feature/foo", - "type": "SHORT", - } - } - component={ - Object { - "breadcrumbs": Array [], - "key": "my-project", - "name": "MyProject", - "organization": "foo", - "qualifier": "TRK", - "qualityGate": Object { - "isDefault": true, - "key": "30", - "name": "Sonar way", - }, - "qualityProfiles": Array [ - Object { - "deleted": false, - "key": "my-qp", - "language": "ts", - "name": "Sonar way", - }, - ], - "tags": Array [], - } - } - /> - </td> - <td - className="nowrap" - > - <ActionsDropdown> - <ActionsDropdownItem - className="js-delete" - destructive={true} - onClick={[MockFunction]} - > - project_branch_pull_request.branch.delete - </ActionsDropdownItem> - </ActionsDropdown> - </td> -</tr> -`; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeTable-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeTable-test.tsx.snap index f56120ef7c5..bc1c1a44bd3 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeTable-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeTable-test.tsx.snap @@ -53,9 +53,7 @@ exports[`should render correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "master", - "name": "slb-1", - "type": "SHORT", + "name": "branch-11", } } component={ @@ -81,7 +79,7 @@ exports[`should render correctly 1`] = ` "tags": Array [], } } - key="branch-slb-1" + key="branch-branch-11" onDelete={[Function]} onRename={[Function]} /> @@ -91,8 +89,7 @@ exports[`should render correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-1", - "type": "LONG", + "name": "branch-1", } } component={ @@ -118,7 +115,7 @@ exports[`should render correctly 1`] = ` "tags": Array [], } } - key="branch-llb-1" + key="branch-branch-1" onDelete={[Function]} onRename={[Function]} /> @@ -202,9 +199,7 @@ exports[`should render correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "llb-1", - "name": "slb-2", - "type": "SHORT", + "name": "branch-12", } } component={ @@ -230,7 +225,7 @@ exports[`should render correctly 1`] = ` "tags": Array [], } } - key="branch-slb-2" + key="branch-branch-12" onDelete={[Function]} onRename={[Function]} /> @@ -278,8 +273,7 @@ exports[`should render correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-3", - "type": "LONG", + "name": "branch-3", } } component={ @@ -305,7 +299,7 @@ exports[`should render correctly 1`] = ` "tags": Array [], } } - key="branch-llb-3" + key="branch-branch-3" onDelete={[Function]} onRename={[Function]} /> @@ -315,8 +309,7 @@ exports[`should render correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-2", - "type": "LONG", + "name": "branch-2", } } component={ @@ -342,7 +335,7 @@ exports[`should render correctly 1`] = ` "tags": Array [], } } - key="branch-llb-2" + key="branch-branch-2" onDelete={[Function]} onRename={[Function]} /> @@ -463,9 +456,7 @@ exports[`should render purge setting correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "master", - "name": "slb-1", - "type": "SHORT", + "name": "branch-11", } } component={ @@ -492,7 +483,7 @@ exports[`should render purge setting correctly 1`] = ` } } displayPurgeSetting={true} - key="branch-slb-1" + key="branch-branch-11" onDelete={[Function]} onRename={[Function]} /> @@ -502,8 +493,7 @@ exports[`should render purge setting correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-1", - "type": "LONG", + "name": "branch-1", } } component={ @@ -530,7 +520,7 @@ exports[`should render purge setting correctly 1`] = ` } } displayPurgeSetting={true} - key="branch-llb-1" + key="branch-branch-1" onDelete={[Function]} onRename={[Function]} /> @@ -616,9 +606,7 @@ exports[`should render purge setting correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "llb-1", - "name": "slb-2", - "type": "SHORT", + "name": "branch-12", } } component={ @@ -645,7 +633,7 @@ exports[`should render purge setting correctly 1`] = ` } } displayPurgeSetting={true} - key="branch-slb-2" + key="branch-branch-12" onDelete={[Function]} onRename={[Function]} /> @@ -694,8 +682,7 @@ exports[`should render purge setting correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-3", - "type": "LONG", + "name": "branch-3", } } component={ @@ -722,7 +709,7 @@ exports[`should render purge setting correctly 1`] = ` } } displayPurgeSetting={true} - key="branch-llb-3" + key="branch-branch-3" onDelete={[Function]} onRename={[Function]} /> @@ -732,8 +719,7 @@ exports[`should render purge setting correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-2", - "type": "LONG", + "name": "branch-2", } } component={ @@ -760,7 +746,7 @@ exports[`should render purge setting correctly 1`] = ` } } displayPurgeSetting={true} - key="branch-llb-2" + key="branch-branch-2" onDelete={[Function]} onRename={[Function]} /> diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeTabs-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeTabs-test.tsx.snap index 805b5566eb6..3dfe2a1e639 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeTabs-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchLikeTabs-test.tsx.snap @@ -10,7 +10,7 @@ exports[`should render all tabs correctly 1`] = ` Object { "key": 0, "label": <React.Fragment> - <ShortLivingBranchIcon /> + <BranchIcon /> <span className="spacer-left" > @@ -45,38 +45,31 @@ exports[`should render all tabs correctly 1`] = ` "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-1", - "type": "LONG", + "name": "branch-1", }, Object { "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-2", - "type": "LONG", + "name": "branch-11", }, Object { "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "name": "llb-3", - "type": "LONG", + "name": "branch-12", }, Object { "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "master", - "name": "slb-1", - "type": "SHORT", + "name": "branch-2", }, Object { "analysisDate": "2018-01-01", "excludedFromPurge": true, "isMain": false, - "mergeBranch": "llb-1", - "name": "slb-2", - "type": "SHORT", + "name": "branch-3", }, ] } @@ -121,7 +114,7 @@ exports[`should render all tabs correctly 2`] = ` Object { "key": 0, "label": <React.Fragment> - <ShortLivingBranchIcon /> + <BranchIcon /> <span className="spacer-left" > |