diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-03-08 16:39:20 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-03-13 08:27:51 +0100 |
commit | f82115885d07e4eefec3594bdfc4bcd0210a1277 (patch) | |
tree | ec0b1614d78e9234597d57fff55e42e69b61d023 /app/helpers | |
parent | 9709309e738aa1703afd78d2c5482b367a662d4a (diff) | |
download | gitlab-ce-f82115885d07e4eefec3594bdfc4bcd0210a1277.tar.gz |
Build link to discussions to resolve in a helper
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/issues_helper.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 4bdf07fe1ad..63b6fde60c3 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -134,6 +134,20 @@ module IssuesHelper options_from_collection_for_select(options, 'name', 'title', params[:due_date]) end + def link_to_discussions_to_resolve(merge_request, single_discussion) + link_text = merge_request.to_reference + link_text += " (discussion #{single_discussion.first_note.id})" if single_discussion + + path = if single_discussion + Gitlab::UrlBuilder.build(single_discussion.first_note) + else + project = merge_request.project + namespace_project_merge_request_path(project.namespace, project, merge_request) + end + + link_to link_text, path + end + # Required for Banzai::Filter::IssueReferenceFilter module_function :url_for_issue end |