diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-29 15:08:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-29 15:08:50 +0300 |
commit | 5a7d44a955572b912d13ba8949e976f61b5c7f1b (patch) | |
tree | 544ed48a55f80871ca0dcf588cf873ffc8ff1bc3 /app/presenters | |
parent | c3ea5eada6f28b5e46cc4114f315729cde58de87 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/release_presenter.rb | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/app/presenters/release_presenter.rb b/app/presenters/release_presenter.rb index c27059c6d63..1a89a76b4dc 100644 --- a/app/presenters/release_presenter.rb +++ b/app/presenters/release_presenter.rb @@ -23,18 +23,36 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated project_release_url(project, release) end - def merge_requests_url + def open_merge_requests_url return unless release_mr_issue_urls_available? project_merge_requests_url(project, params_for_issues_and_mrs) end - def issues_url + def merged_merge_requests_url + return unless release_mr_issue_urls_available? + + project_merge_requests_url(project, params_for_issues_and_mrs(state: 'merged')) + end + + def closed_merge_requests_url + return unless release_mr_issue_urls_available? + + project_merge_requests_url(project, params_for_issues_and_mrs(state: 'closed')) + end + + def open_issues_url return unless release_mr_issue_urls_available? project_issues_url(project, params_for_issues_and_mrs) end + def closed_issues_url + return unless release_mr_issue_urls_available? + + project_issues_url(project, params_for_issues_and_mrs(state: 'closed')) + end + def edit_url return unless release_edit_page_available? @@ -59,8 +77,8 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated can?(current_user, :download_code, project) end - def params_for_issues_and_mrs - { scope: 'all', state: 'opened', release_tag: release.tag } + def params_for_issues_and_mrs(state: 'opened') + { scope: 'all', state: state, release_tag: release.tag } end def release_mr_issue_urls_available? |