stable

Clone or download

Read-only

feat: Adjust "Create Git branch" label

The artifact actions dropdown allows to create a git branch and a pull request. The label should reflect that, like it is done for gitlab entry. However the label (and subsequent PR creation) depends on the availability of the plugin pullrequest: * If the plugin is not installed, or disabled, then the label is "Create Git branch" and there isn't any checkbox in the modal to allow creation of the PR. * If the plugin is enabled, then the label is "Create Git branch and pull request" and the checkbox is present. From the implementation point of view, I took the opportunity to convert the constant based event to an object, which should not have any repercussion on existing code, like retrieving git/:id/pullrequests. Part of story #26803: create Tuleap Git branch & pull request from artifact Change-Id: I0938237e023b2bd145570c0fb2103905ac09e428

Modified Files

Name
M plugins/git/include/Artifact/Action/CreateBranchButtonFetcher.php +15 −5 Go to diff View file
A plugins/git/include/PullRequestEndpointsAvailableChecker.php +39 −0 Go to diff View file
A plugins/git/include/PullRequestEndpointsAvailableEvent.php +42 −0 Go to diff View file
M plugins/git/include/REST/v1/RepositoryResource.class.php +3 −9 Go to diff View file
M plugins/git/include/constants.php +0 −1 Go to diff View file
M plugins/git/include/gitPlugin.php +2 −1 Go to diff View file
M plugins/git/scripts/artifact-create-branch-action/src/components/MainComponent.vue +2 −0 Go to diff View file
M plugins/git/scripts/artifact-create-branch-action/src/components/ModalContent.vue +3 −2 Go to diff View file
M plugins/git/scripts/artifact-create-branch-action/src/modal.ts +4 −0 Go to diff View file
M plugins/git/site-content/fr_FR/LC_MESSAGES/tuleap-git.po +4 −1 Go to diff View file
M plugins/git/site-content/pt_BR/LC_MESSAGES/tuleap-git.po +3 −0 Go to diff View file
M plugins/git/tests/unit/Artifact/Action/CreateBranchButtonFetcherTest.php +4 −1 Go to diff View file
M plugins/git/tests/unit/Hook/Asynchronous/CommitAnalysisProcessorTest.php +1 −1 Go to diff View file
M plugins/git/tests/unit/Hook/GitPushReceptionDispatcherTest.php +1 −1 Go to diff View file
A plugins/git/tests/unit/PullRequestEndpointsAvailableCheckerTest.php +51 −0 Go to diff View file
A plugins/git/tests/unit/PullRequestEndpointsAvailableEventTest.php +44 −0 Go to diff View file
M plugins/git/tests/unit/Stub/EventDispatcherStub.php +5 −0 Go to diff View file
M plugins/pullrequest/include/pullrequestPlugin.php +4 −6 Go to diff View file