Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-07-27 17:36:39 +0300
committerSean McGivern <sean@gitlab.com>2017-07-28 18:25:13 +0300
commit75d04f6a29a5506ffd53c227517411febdc54910 (patch)
tree9e1234843c638abe5e34299d21348c5bf885a5ec /app/helpers/notes_helper.rb
parent9981814514742a2ee507d4dcc2fd71099fd96585 (diff)
Fix replying to commit comments on MRs from forks
A commit comment shows in the MR, but if the MR is from a fork, it will have a different project ID to the MR's target project. In that case, add an note_project_id param so that we can pick the correct project for the note.
Diffstat (limited to 'app/helpers/notes_helper.rb')
-rw-r--r--app/helpers/notes_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 0a0881d95cf..8f4e39b8b23 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -62,7 +62,11 @@ module NotesHelper
def link_to_reply_discussion(discussion, line_type = nil)
return unless current_user
- data = { discussion_id: discussion.reply_id, line_type: line_type }
+ data = {
+ discussion_id: discussion.reply_id,
+ discussion_project_id: discussion.project&.id,
+ line_type: line_type
+ }
button_tag 'Reply...', class: 'btn btn-text-field js-discussion-reply-button',
data: data, title: 'Add a reply'