stable

Clone or download

Read-only

feat: display an empty state when there are no pull-requests

part of story #33006 Create filters on my PR When there aren't any open, nor closed pull-requests in the repository, we need to display an empty state. In the mockups, this empty state contains the "create-pullrequest-button", which means we cannot display it from the pull-request-homepage app, because it is already a vue app, with its own mount-point. How to test: - Create a repository - Clone and add a readme.md to it - Checkout a new branch - Make some changes in the readme file - Push on a remote branch - Go to the dashboad view of your repository - In the url, add a parameter `tab=homepage` --> There is an empty state saying "no pull-requests yet". --> It contains the "create-pullrequest-button" - Create a new PR from the button in the empty state, from the previously pushed branch into master --> You are redirected to the overview page if the creation is a success. --> The empty state is no longer displayed if you go back to the dashboard view (using `tab=homepage`). - Fork this repository --> In the fork, the dashboard view shows the empty state. --> You can create a PR in the fork, or in its parent repository Change-Id: I400edb88ebeb9eca6f9c7f6c1055e614dcd0460c

Modified Files

Name
M plugins/git/include/Git/Repository/View/ParentRepositoryPresenter.php +4 −4 Go to diff View file
A plugins/git/include/Git/Repository/View/PresentPullRequest.php +26 −0 Go to diff View file
M plugins/git/templates/repository/header.mustache +1 −1 Go to diff View file
M plugins/git/tests/unit/Tests/Builders/GitRepositoryTestBuilder.php +29 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/PullRequestEmptyStatePresenter.php +45 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/PullRequestEmptyStatePresenterBuilder.php +76 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/PullRequestPresenter.php +2 −1 Go to diff View file
M plugins/pullrequest/include/PullrequestDisplayer.php +25 −17 Go to diff View file
M plugins/pullrequest/include/pullrequestPlugin.php +16 −2 Go to diff View file
M plugins/pullrequest/scripts/create-pullrequest-button/src/index.js +13 −6 Go to diff View file
M plugins/pullrequest/site-content/fr_FR/LC_MESSAGES/tuleap-pullrequest.po +6 −0 Go to diff View file
M plugins/pullrequest/site-content/pt_BR/LC_MESSAGES/tuleap-pullrequest.po +6 −0 Go to diff View file
A plugins/pullrequest/templates/pullrequest-empty-state.mustache +20 −0 Go to diff View file
A plugins/pullrequest/tests/unit/PullRequestEmptyStatePresenterBuilderTest.php +85 −0 Go to diff View file