stable

Clone or download

Read-only

Have a merge button

part of story #31186 Add management of "Merge" This contribution introduces a functional merge button. It is disabled when it is not possible to merge the PR, and enabled when it is. When clicked, the PR is merged. On error, the error modal opens. Please note that there is no warning modal or "Already merged" state yet. It will be added in a dedicated contribution. How to test: - When the user has not the right to merge, or the pull-request is already merged --> There is no merge button - When the pull request: -- is not fast-forward but merge commits are allowed --> The button is outlined and not disabled -- is not fast-forward and merge commits are disabled --> The button is outlined and disabled --> An error is displayed -- has a merge conflict --> The button is outlined and disabled --> An error is displayed -- has an unknown destination --> The button is disabled and outlined --> A warning is displayed -- has its source and destination references being the same --> The button is disabled and outlined --> A warning is displayed -- is fast forward but with a not successful CI status --> The button is outlined and not disabled -- is fast forward with a successful CI status --> The button is NOT outlined and NOT disabled --> Clicking the merge button merges the pull-request --> After a successful merge, the button disappears --> After a merge error, the error modal opens Change-Id: Id8a23764e17edbafabea60c539540770d3bf86c2

Modified Files

Name
M plugins/pullrequest/scripts/lib/constants/src/constants.ts +17 −0 Go to diff View file
M plugins/pullrequest/scripts/lib/rest-api-types/src/pull-request.ts +5 −1 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/po/fr_FR.po +34 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/api/tuleap-rest-querier.test.ts +21 −1 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/api/tuleap-rest-querier.ts +8 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/PullRequestChangeStateActions.test.ts +122 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/PullRequestChangeStateActions.vue +93 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/PullRequestMergeButton.test.ts +216 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/PullRequestMergeButton.vue +107 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/merge-status-helper.test.ts +204 −0 Go to diff View file
A plugins/pullrequest/scripts/pullrequest-overview/src/components/Actions/merge-status-helper.ts +74 −0 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Modals/PullRequestEditTitleModal.test.ts +6 −6 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Modals/PullRequestEditTitleModal.vue +7 −7 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/OverviewPane.vue +31 −19 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/ReadOnlyInfo/PullRequestCheckoutButton.vue +0 −4 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/constants.ts +8 −5 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/pullrequest-overview.ts +5 −0 Go to diff View file
M plugins/pullrequest/templates/angular-pullrequest.mustache +1 −0 Go to diff View file